-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1441 from blockscout/tom2drum/issue-1377
Tick icon doesn't appear on automatically verified contracts until re…
- Loading branch information
Showing
2 changed files
with
28 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,31 @@ test('verified with changed byte code socket', async({ mount, page, createSocket | |
await expect(component).toHaveScreenshot(); | ||
}); | ||
|
||
test('verified via lookup in eth_bytecode_db', async({ mount, page, createSocket }) => { | ||
await page.route(CONTRACT_API_URL, (route) => route.fulfill({ | ||
status: 200, | ||
body: JSON.stringify(contractMock.nonVerified), | ||
})); | ||
await page.route('https://cdn.jsdelivr.net/npm/[email protected]/**', (route) => route.abort()); | ||
|
||
await mount( | ||
<TestApp withSocket> | ||
<ContractCode addressHash={ addressHash }/> | ||
</TestApp>, | ||
{ hooksConfig }, | ||
); | ||
|
||
const socket = await createSocket(); | ||
const channel = await socketServer.joinChannel(socket, 'addresses:' + addressHash.toLowerCase()); | ||
|
||
await page.waitForResponse(CONTRACT_API_URL); | ||
socketServer.sendMessage(socket, channel, 'smart_contract_was_verified', {}); | ||
|
||
const request = await page.waitForRequest(CONTRACT_API_URL); | ||
|
||
expect(request).toBeTruthy(); | ||
}); | ||
|
||
test('verified with multiple sources', async({ mount, page }) => { | ||
await page.route(CONTRACT_API_URL, (route) => route.fulfill({ | ||
status: 200, | ||
|
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