Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a Zerion button only for EOA addresses #2034

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions mocks/address/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,30 @@ export const token: Address = {
ens_domain_name: null,
};

export const eoa: Address = {
block_number_balance_updated_at: 30811263,
coin_balance: '2782650189688719421432220500',
creation_tx_hash: '0xf2aff6501b632604c39978b47d309813d8a1bcca721864bbe86abf59704f195e',
creator_address_hash: '0x803ad3F50b9e1fF68615e8B053A186e1be288943',
exchange_rate: '0.04311',
has_decompiled_code: false,
has_logs: true,
has_token_transfers: false,
has_tokens: true,
has_validated_blocks: false,
hash: hash,
implementations: [],
is_contract: false,
is_verified: false,
name: null,
private_tags: [ publicTag ],
public_tags: [ privateTag ],
token: null,
watchlist_names: [ watchlistName ],
watchlist_address_id: 42,
ens_domain_name: null,
};

export const contract: Address = {
block_number_balance_updated_at: 30811263,
coin_balance: '27826501896887194214322205',
Expand Down
8 changes: 4 additions & 4 deletions ui/address/details/AddressNetWorth.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.beforeEach(async({ mockApiResponse }) => {
});

test('base view', async({ render }) => {
const component = await render(<AddressNetWorth addressData={ addressMock.token } addressHash={ ADDRESS_HASH }/>);
const component = await render(<AddressNetWorth addressData={ addressMock.eoa } addressHash={ ADDRESS_HASH }/>);

await expect(component).toHaveScreenshot();
});
Expand All @@ -31,7 +31,7 @@ test('with multichain button internal +@dark-mode', async({ render, mockEnvs, mo
]);
await mockAssetResponse(ICON_URL, './playwright/mocks/image_svg.svg');

const component = await render(<AddressNetWorth addressData={ addressMock.token } addressHash={ ADDRESS_HASH }/>);
const component = await render(<AddressNetWorth addressData={ addressMock.eoa } addressHash={ ADDRESS_HASH }/>);

await expect(component).toHaveScreenshot();
});
Expand All @@ -42,7 +42,7 @@ test('with multichain button external', async({ render, mockEnvs, mockAssetRespo
]);
await mockAssetResponse(ICON_URL, './playwright/mocks/image_svg.svg');

const component = await render(<AddressNetWorth addressData={ addressMock.token } addressHash={ ADDRESS_HASH }/>);
const component = await render(<AddressNetWorth addressData={ addressMock.eoa } addressHash={ ADDRESS_HASH }/>);

await expect(component).toHaveScreenshot();
});
Expand All @@ -56,7 +56,7 @@ test('with multichain button internal small screen', async({ render, mockEnvs, m
await mockAssetResponse(ICON_URL, './playwright/mocks/image_svg.svg');

const component = await render(
<Box w="300px"><AddressNetWorth addressData={ addressMock.token } addressHash={ ADDRESS_HASH }/></Box>,
<Box w="300px"><AddressNetWorth addressData={ addressMock.eoa } addressHash={ ADDRESS_HASH }/></Box>,
);

await expect(component).toHaveScreenshot();
Expand Down
2 changes: 1 addition & 1 deletion ui/address/details/AddressNetWorth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const AddressNetWorth = ({ addressData, isLoading, addressHash }: Props) => {

let multichainItem = null;

if (multichainFeature.isEnabled) {
if (multichainFeature.isEnabled && !addressData?.is_contract) {
const buttonContent = (
<>
{ multichainFeature.logoUrl &&
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading