Skip to content

Commit

Permalink
Show a Zerion button only for EOA addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed Jun 18, 2024
1 parent 4ca72bd commit 11e9e77
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 5 deletions.
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.

0 comments on commit 11e9e77

Please sign in to comment.