diff --git a/dev/testing-utils.mjs b/dev/testing-utils.mjs index b4b29b4c..d2e38971 100644 --- a/dev/testing-utils.mjs +++ b/dev/testing-utils.mjs @@ -72,6 +72,7 @@ async function isWebSocketReady (endpoint) { } export async function jumpStartNetwork (entropy, maxTime = 360 * SECONDS) { + console.log('jumping') let timeout, unsub // if you used spinNetworkUp check what network was used // this is done this way so we can still use this for other @@ -88,7 +89,6 @@ export async function jumpStartNetwork (entropy, maxTime = 360 * SECONDS) { if (!startHeader) startHeader = header if (started) { headersSenseStart++ - if (lastEventTime) console.log('context#headers time sense last events seen:', Math.floor((Date.now() - lastEventTime)/1000), 'seconds') } if ( @@ -103,10 +103,9 @@ export async function jumpStartNetwork (entropy, maxTime = 360 * SECONDS) { ) { await entropy.substrate.tx.registry.jumpStartNetwork() .signAndSend(entropy.keyring.accounts.registration.pair) - console.log('retrying jumpstart', headersSenseStart, 'headers sense initial try') + console.log('had to tell everyone to jump again') } - console.log(`#${header.number}: ${header.author}`); if (headersSenseStart === 200) { reject('waiting period of 200 blocks sense initial jump start reached') blockUnsub() @@ -115,16 +114,14 @@ export async function jumpStartNetwork (entropy, maxTime = 360 * SECONDS) { }) unsub = await entropy.substrate.query.system.events((records) => { const nowEvents = Date.now() - if (lastEventTime) console.log('context#events time sense last events:', Math.floor((nowEvents - lastEventTime)/1000), 'seconds') lastEventTime = nowEvents - console.log('time sense start:', Math.floor((Date.now() - startTime)/1000), 'seconds') - console.log('event methods:', records.map((record) => record?.event?.method)) if (records.find(record => record?.event?.method === wantedMethod)) { unsub() blockUnsub() res(undefined) } else if (records.find(record => record?.event?.method === 'StartedNetworkJumpStart')) { started = true + console.log('everyone knows to start jumping') } }) }) @@ -132,7 +129,13 @@ export async function jumpStartNetwork (entropy, maxTime = 360 * SECONDS) { await entropy.substrate.tx.registry.jumpStartNetwork() .signAndSend(entropy.keyring.accounts.registration.pair) - await isDone.catch((err) => {console.error(err); process.exit(1)}) + return isDone.then(() => { + console.log(` +final report:jump-start +total-time: ${Math.floor((Date.now() - startTime)/1000)} seconds +total-block-time: ${headersSenseStart} blocks + `) + }).catch((err) => {console.error(err); process.exit(1)}) } export async function spinNetworkDown (networkType = 'four-nodes') { diff --git a/tests/transfer.test.ts b/tests/transfer.test.ts index 4cc9398a..0e7c8470 100644 --- a/tests/transfer.test.ts +++ b/tests/transfer.test.ts @@ -61,18 +61,6 @@ test('Transfer', async (t) => { 'initially naynay has nothing' ) } - { - const account = charlie.keyring.accounts.registration.address - const accountInfo = (await charlie.substrate.query.system.account( - account - )) as any - t.equal( - BigInt(accountInfo.data.free), - BigInt(1e17), - 'initially charlie is rich!' - ) - } - const sender = charlie.keyring.accounts.registration.pair function sendMoney(amount) { return new Promise(async (resolve, reject) => {