Skip to content

Commit

Permalink
chores: test ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
cosinlink committed Sep 8, 2024
1 parent 031dab5 commit 5d82720
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/check-bsc-hardfork-bytecode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ contractNameMap[TOKEN_RECOVER_PORTAL_ADDR] = 'TokenRecoverContract'

let hardforkName = process.env.HARDFORK
let bscUrl = process.env.BSC_URL
let bscRepoDir = __dirname + '/bsc'
let bscRepoDir = '/tmp/bsc'

const checkHardforkBytecode = async () => {
const bscHardforkBytecodeDir = bscRepoDir + '/core/systemcontracts/' + hardforkName
Expand Down Expand Up @@ -170,13 +170,20 @@ const main = async () => {

log('hardforkName', hardforkName, 'commitId', commitId)

execSync(`git clone https://github.com/bnb-chain/bsc.git && cd bsc && git checkout ${commitId} && cd ..`)
execSync(`cd /tmp && git clone https://github.com/bnb-chain/bsc.git && cd bsc && git checkout ${commitId}`)

await sleep(5)

await checkHardforkBytecode();

log('All bytecode match!')
};

const sleep = async (seconds: number) => {
console.log('sleep', seconds, 's');
await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
};

main()
.then(() => process.exit(0))
.catch((error) => {
Expand Down

0 comments on commit 5d82720

Please sign in to comment.