-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get smart-contract bytecode from websocket (#1851)
* Get smart-contract bytecode from websocket Fixes #1769 * fix test * i am stupid 😓 * Update values.yaml.gotmpl --------- Co-authored-by: Yan Vaskov <72267126+yvaskov@users.noreply.github.com>
- Loading branch information
Showing
6 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { AddressTabsCounters } from 'types/api/address'; | ||
|
||
export const base: AddressTabsCounters = { | ||
internal_txs_count: 13, | ||
logs_count: 51, | ||
token_balances_count: 3, | ||
token_transfers_count: 3, | ||
transactions_count: 51, | ||
validations_count: 42, | ||
withdrawals_count: 11, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
|
||
import * as addressMock from 'mocks/address/address'; | ||
import * as addressCountersMock from 'mocks/address/counters'; | ||
import * as addressTabCountersMock from 'mocks/address/tabCounters'; | ||
import * as socketServer from 'playwright/fixtures/socketServer'; | ||
import { test, expect } from 'playwright/lib'; | ||
|
||
import Address from './Address'; | ||
|
||
const hooksConfig = { | ||
router: { | ||
query: { hash: addressMock.hash }, | ||
}, | ||
}; | ||
|
||
test.describe('fetched bytecode', () => { | ||
test('should refetch address query', async({ render, mockApiResponse, createSocket, page }) => { | ||
const addressApiUrl = await mockApiResponse('address', addressMock.validator, { pathParams: { hash: addressMock.hash } }); | ||
await mockApiResponse('address_counters', addressCountersMock.forValidator, { pathParams: { hash: addressMock.hash } }); | ||
await mockApiResponse('address_tabs_counters', addressTabCountersMock.base, { pathParams: { hash: addressMock.hash } }); | ||
await mockApiResponse('address_txs', { items: [], next_page_params: null }, { pathParams: { hash: addressMock.hash } }); | ||
await render(<Address/>, { hooksConfig }, { withSocket: true }); | ||
|
||
const socket = await createSocket(); | ||
const channel = await socketServer.joinChannel(socket, `addresses:${ addressMock.hash.toLowerCase() }`); | ||
socketServer.sendMessage(socket, channel, 'fetched_bytecode', { fetched_bytecode: '0x0123' }); | ||
|
||
const request = await page.waitForRequest(addressApiUrl); | ||
|
||
expect(request).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters