-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aeef828
commit a346305
Showing
4 changed files
with
57 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -70,3 +70,6 @@ jspm_packages/ | |
dist | ||
lib | ||
*.tsbuildinfo | ||
|
||
flood | ||
flood-result |
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,49 @@ | ||
#!/bin/env node | ||
|
||
import { execSync } from 'child_process'; | ||
import { existsSync } from 'fs' | ||
|
||
(async () => { | ||
// set max block number | ||
const head = await fetch('http://localhost:8545', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
jsonrpc: "2.0", | ||
id: 1, | ||
method: "eth_getBlockByNumber", | ||
params: ["latest", false] | ||
}) | ||
}).then(res => res.json()); | ||
|
||
const latestBlock = Number(head.result.number); | ||
console.log(`Latest block: ${latestBlock}`); | ||
|
||
process.env.MAX_BLOCK_NUMBER = latestBlock.toString(); | ||
|
||
if (!existsSync('flood')) { | ||
execSync('git clone --branch acala-bodhi --depth 0 [email protected]:ermalkaleci/flood.git'); | ||
} | ||
|
||
const tests = [ | ||
"eth_call", | ||
"eth_getBalance", | ||
"eth_getBlockByNumber", | ||
"eth_getCode", | ||
"eth_getLogs", | ||
"eth_getStorageAt", | ||
"eth_getTransactionByHash", | ||
"eth_getTransactionCount", | ||
"eth_getTransactionReceipt", | ||
]; | ||
|
||
for (const test of tests) { | ||
execSync(`cd flood; python3 -m flood ${test} http://localhost:8545 -o ../flood-result/${test} --deep-check`, { | ||
stdio: 'inherit', | ||
env: process.env | ||
}); | ||
await new Promise(resolve => setTimeout(resolve, 10_000)); | ||
} | ||
})(); |