diff --git a/tests/network-tests/.env b/tests/network-tests/.env index 680e8274c0..74c468b8d2 100644 --- a/tests/network-tests/.env +++ b/tests/network-tests/.env @@ -51,4 +51,4 @@ SLASH_AMOUNT = 2 # Stake decrement amount for manage working group lead testing scenario STAKE_DECREMENT = 3 # Mint capacity increment value for working gorup mint capacity test -MINT_CAPACITY_INCREMENT = 11 +MINT_CAPACITY_INCREMENT = 1000 diff --git a/tests/network-tests/package.json b/tests/network-tests/package.json index 3763f1acdd..6f2b575889 100644 --- a/tests/network-tests/package.json +++ b/tests/network-tests/package.json @@ -7,7 +7,7 @@ "test": "tap --files src/iznik/tests/unknown.unknown src/iznik/tests/councilSetup.ts src/iznik/tests/proposals/*Test.ts src/iznik/tests/leaderSetup.ts src/iznik/tests/workingGroup/*Test.ts src/iznik/tests/proposals/updateRuntime.ts -T", "test-migration-constantinople": "tap --files src/rome/tests/romeRuntimeUpgradeTest.ts --files src/constantinople/tests/electingCouncilTest.ts -T", "test-migration-nicaea": "tap --files src/constantinople/tests/proposals/updateRuntimeTest.ts --files src/nicaea/tests/electingCouncilTest.ts -T", - "debug": "tap --files src/iznik/tests/proposals/manageLeaderRoleTest.ts -T", + "debug": "tap --files src/iznik/tests/workingGroup/workerPayoutTest.ts -T", "lint": "eslint . --quiet --ext .ts", "checks": "yarn lint && tsc --noEmit --pretty && prettier ./ --check", "format": "prettier ./ --write " diff --git a/tests/network-tests/src/iznik/tests/fixtures/proposalsModule.ts b/tests/network-tests/src/iznik/tests/fixtures/proposalsModule.ts index 3225f32ab6..0745fafc14 100644 --- a/tests/network-tests/src/iznik/tests/fixtures/proposalsModule.ts +++ b/tests/network-tests/src/iznik/tests/fixtures/proposalsModule.ts @@ -4,10 +4,10 @@ import { v4 as uuid } from 'uuid' import BN from 'bn.js' import { ProposalId } from '@alexandria/types/proposals' import { Fixture } from './interfaces/fixture' -import { Bytes } from '@polkadot/types' import { assert } from 'chai' import { ApplicationId, OpeningId } from '@alexandria/types/hiring' import { WorkerId } from '@alexandria/types/working-group' +import { Utils } from '../../utils/utils' export class CreateWorkingGroupLeaderOpeningFixture implements Fixture { private apiWrapper: ApiWrapper @@ -1004,22 +1004,25 @@ export class UpdateRuntimeFixture implements Fixture { private membersKeyPairs: KeyringPair[] private councilKeyPairs: KeyringPair[] private treasury: KeyringPair + private runtimePath: string constructor( apiWrapper: ApiWrapper, membersKeyPairs: KeyringPair[], councilKeyPairs: KeyringPair[], - treasury: KeyringPair + treasury: KeyringPair, + runtimePath: string ) { this.apiWrapper = apiWrapper this.membersKeyPairs = membersKeyPairs this.councilKeyPairs = councilKeyPairs this.treasury = treasury + this.runtimePath = runtimePath } public async runner(expectFailure: boolean): Promise { // Setup - const runtime: Bytes = await this.apiWrapper.getRuntime() + const runtime: string = Utils.readRuntimeFromFile(this.runtimePath) const description = 'runtime upgrade proposal which is used for API network testing' const runtimeVoteFee: BN = this.apiWrapper.estimateVoteForProposalFee() diff --git a/tests/network-tests/src/iznik/tests/fixtures/workingGroupModule.ts b/tests/network-tests/src/iznik/tests/fixtures/workingGroupModule.ts index 63c1f5ec81..8896a742ac 100644 --- a/tests/network-tests/src/iznik/tests/fixtures/workingGroupModule.ts +++ b/tests/network-tests/src/iznik/tests/fixtures/workingGroupModule.ts @@ -1026,7 +1026,8 @@ export class ExpectLeaderRewardAmountUpdatedFixture implements Fixture { this.events.push(event) const leadWorkerId: WorkerId = (await this.apiWrapper.getLeadWorkerId(this.module))! const leadWorker: Worker = await this.apiWrapper.getWorkerById(leadWorkerId, this.module) - const receivedReward: BN = (await this.apiWrapper.getRewardRelationship(leadWorker.reward_relationship.unwrap())).amount_per_payout + const receivedReward: BN = (await this.apiWrapper.getRewardRelationship(leadWorker.reward_relationship.unwrap())) + .amount_per_payout assert( receivedReward.eq(this.expectedReward), `Unexpected reward amount for worker with id ${leadWorkerId}: ${receivedReward}, expected ${this.expectedReward}` diff --git a/tests/network-tests/src/iznik/tests/proposals/contentWorkingGroupMintCapacityProposalTest.ts b/tests/network-tests/src/iznik/tests/proposals/contentWorkingGroupMintCapacityProposalTest.ts index 8b2f0f9c45..e6d709927a 100644 --- a/tests/network-tests/src/iznik/tests/proposals/contentWorkingGroupMintCapacityProposalTest.ts +++ b/tests/network-tests/src/iznik/tests/proposals/contentWorkingGroupMintCapacityProposalTest.ts @@ -51,7 +51,7 @@ tap.mocha.describe('Validator count proposal scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } const contentWorkingGroupMintCapacityProposalFixture: ContentWorkingGroupMintCapacityProposalFixture = new ContentWorkingGroupMintCapacityProposalFixture( @@ -61,8 +61,9 @@ tap.mocha.describe('Validator count proposal scenario', async () => { sudo, mintingCapacityIncrement ) - tap.test('Content working group mint capacity test', async () => - contentWorkingGroupMintCapacityProposalFixture.runner(false) + tap.test( + 'Content working group mint capacity test', + async () => await contentWorkingGroupMintCapacityProposalFixture.runner(false) ) closeApi(apiWrapper) diff --git a/tests/network-tests/src/iznik/tests/proposals/electionParametersProposalTest.ts b/tests/network-tests/src/iznik/tests/proposals/electionParametersProposalTest.ts index 7916e286fb..0e3c2d77bc 100644 --- a/tests/network-tests/src/iznik/tests/proposals/electionParametersProposalTest.ts +++ b/tests/network-tests/src/iznik/tests/proposals/electionParametersProposalTest.ts @@ -50,7 +50,7 @@ tap.mocha.describe('Election parameters proposal scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } const electionParametersProposalFixture: ElectionParametersProposalFixture = new ElectionParametersProposalFixture( @@ -59,7 +59,7 @@ tap.mocha.describe('Election parameters proposal scenario', async () => { m2KeyPairs, sudo ) - tap.test('Election parameters proposal test', async () => electionParametersProposalFixture.runner(false)) + tap.test('Election parameters proposal test', async () => await electionParametersProposalFixture.runner(false)) closeApi(apiWrapper) }) diff --git a/tests/network-tests/src/iznik/tests/proposals/manageLeaderRoleTest.ts b/tests/network-tests/src/iznik/tests/proposals/manageLeaderRoleTest.ts index 19db843256..6036b89d24 100644 --- a/tests/network-tests/src/iznik/tests/proposals/manageLeaderRoleTest.ts +++ b/tests/network-tests/src/iznik/tests/proposals/manageLeaderRoleTest.ts @@ -81,7 +81,7 @@ tap.mocha.describe('Set lead proposal scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } const leaderMembershipFixture: BuyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture( @@ -90,7 +90,7 @@ tap.mocha.describe('Set lead proposal scenario', async () => { leadKeyPair, paidTerms ) - tap.test('Buy membership for lead', async () => leaderMembershipFixture.runner(false)) + tap.test('Buy membership for lead', async () => await leaderMembershipFixture.runner(false)) const createWorkingGroupLeaderOpeningFixture: CreateWorkingGroupLeaderOpeningFixture = new CreateWorkingGroupLeaderOpeningFixture( apiWrapper, @@ -100,7 +100,7 @@ tap.mocha.describe('Set lead proposal scenario', async () => { roleStake, 'Storage' ) - tap.test('Propose create leader opening', async () => createWorkingGroupLeaderOpeningFixture.runner(false)) + tap.test('Propose create leader opening', async () => await createWorkingGroupLeaderOpeningFixture.runner(false)) let voteForCreateOpeningProposalFixture: VoteForProposalFixture const expectLeadOpeningAddedFixture: ExpectLeadOpeningAddedFixture = new ExpectLeadOpeningAddedFixture(apiWrapper) @@ -251,7 +251,7 @@ tap.mocha.describe('Set lead proposal scenario', async () => { slashAmount, WorkingGroups.StorageWorkingGroup ) - tap.test('Propose leader slash', async () => slashLeaderProposalFixture.runner(false)) + tap.test('Propose leader slash', async () => await slashLeaderProposalFixture.runner(false)) let voteForSlashProposalFixture: VoteForProposalFixture let expectLeaderSlashedFixture: ExpectLeaderSlashedFixture @@ -276,7 +276,7 @@ tap.mocha.describe('Set lead proposal scenario', async () => { false, WorkingGroups.StorageWorkingGroup ) - tap.test('Propose terminate leader role', async () => terminateLeaderRoleProposalFixture.runner(false)) + tap.test('Propose terminate leader role', async () => await terminateLeaderRoleProposalFixture.runner(false)) let voteForLeaderRoleTerminationFixture: VoteForProposalFixture const expectLeaderRoleTerminatedFixture: ExpectLeaderRoleTerminatedFixture = new ExpectLeaderRoleTerminatedFixture( diff --git a/tests/network-tests/src/iznik/tests/proposals/setLeadProposalTest.ts b/tests/network-tests/src/iznik/tests/proposals/setLeadProposalTest.ts index cf8d8ed9b9..f6714a82ce 100644 --- a/tests/network-tests/src/iznik/tests/proposals/setLeadProposalTest.ts +++ b/tests/network-tests/src/iznik/tests/proposals/setLeadProposalTest.ts @@ -50,7 +50,7 @@ tap.mocha.describe('Set lead proposal scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } const setLeadProposalFixture: SetLeadProposalFixture = new SetLeadProposalFixture( @@ -59,7 +59,7 @@ tap.mocha.describe('Set lead proposal scenario', async () => { m2KeyPairs, sudo ) - tap.test('Set lead proposal test', async () => setLeadProposalFixture.runner(false)) + tap.test('Set lead proposal test', async () => await setLeadProposalFixture.runner(false)) closeApi(apiWrapper) }) diff --git a/tests/network-tests/src/iznik/tests/proposals/spendingProposalTest.ts b/tests/network-tests/src/iznik/tests/proposals/spendingProposalTest.ts index e9a21b08ae..7e2dda6fdd 100644 --- a/tests/network-tests/src/iznik/tests/proposals/spendingProposalTest.ts +++ b/tests/network-tests/src/iznik/tests/proposals/spendingProposalTest.ts @@ -51,7 +51,7 @@ tap.mocha.describe('Spending proposal scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } const spendingProposalFixture: SpendingProposalFixture = new SpendingProposalFixture( @@ -62,7 +62,7 @@ tap.mocha.describe('Spending proposal scenario', async () => { spendingBalance, mintCapacity ) - tap.test('Spending proposal test', async () => spendingProposalFixture.runner(false)) + tap.test('Spending proposal test', async () => await spendingProposalFixture.runner(false)) closeApi(apiWrapper) }) diff --git a/tests/network-tests/src/iznik/tests/proposals/textProposalTest.ts b/tests/network-tests/src/iznik/tests/proposals/textProposalTest.ts index 81fe621ae3..9042c21b0b 100644 --- a/tests/network-tests/src/iznik/tests/proposals/textProposalTest.ts +++ b/tests/network-tests/src/iznik/tests/proposals/textProposalTest.ts @@ -49,11 +49,11 @@ tap.mocha.describe('Text proposal scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } const textProposalFixture: TextProposalFixture = new TextProposalFixture(apiWrapper, m1KeyPairs, m2KeyPairs, sudo) - tap.test('Text proposal test', async () => textProposalFixture.runner(false)) + tap.test('Text proposal test', async () => await textProposalFixture.runner(false)) closeApi(apiWrapper) }) diff --git a/tests/network-tests/src/iznik/tests/proposals/updateRuntime.ts b/tests/network-tests/src/iznik/tests/proposals/updateRuntime.ts index fbc9b95854..8a93a3d0b3 100644 --- a/tests/network-tests/src/iznik/tests/proposals/updateRuntime.ts +++ b/tests/network-tests/src/iznik/tests/proposals/updateRuntime.ts @@ -32,6 +32,7 @@ tap.mocha.describe('Update runtime scenario', async () => { const K: number = +process.env.COUNCIL_ELECTION_K! const greaterStake: BN = new BN(+process.env.COUNCIL_STAKE_GREATER_AMOUNT!) const lesserStake: BN = new BN(+process.env.COUNCIL_STAKE_LESSER_AMOUNT!) + const runtimePath: string = process.env.RUNTIME_WASM_PATH! const durationInBlocks = 54 setTestTimeout(apiWrapper, durationInBlocks) @@ -50,11 +51,17 @@ tap.mocha.describe('Update runtime scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } - const updateRuntimeFixture: UpdateRuntimeFixture = new UpdateRuntimeFixture(apiWrapper, m1KeyPairs, m2KeyPairs, sudo) - tap.test('Upgrade runtime', async () => updateRuntimeFixture.runner(false)) + const updateRuntimeFixture: UpdateRuntimeFixture = new UpdateRuntimeFixture( + apiWrapper, + m1KeyPairs, + m2KeyPairs, + sudo, + runtimePath + ) + tap.test('Upgrade runtime', async () => await updateRuntimeFixture.runner(false)) const thirdMemberSetFixture: BuyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture( apiWrapper, @@ -62,7 +69,7 @@ tap.mocha.describe('Update runtime scenario', async () => { Utils.createKeyPairs(keyring, N), paidTerms ) - tap.test('Creating third set of members', async () => thirdMemberSetFixture.runner(false)) + tap.test('Creating third set of members', async () => await thirdMemberSetFixture.runner(false)) closeApi(apiWrapper) }) diff --git a/tests/network-tests/src/iznik/tests/proposals/validatorCountProposalTest.ts b/tests/network-tests/src/iznik/tests/proposals/validatorCountProposalTest.ts index 286b477df5..a869945f81 100644 --- a/tests/network-tests/src/iznik/tests/proposals/validatorCountProposalTest.ts +++ b/tests/network-tests/src/iznik/tests/proposals/validatorCountProposalTest.ts @@ -50,7 +50,7 @@ tap.mocha.describe('Validator count proposal scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } const validatorCountProposalFixture: ValidatorCountProposalFixture = new ValidatorCountProposalFixture( @@ -60,7 +60,7 @@ tap.mocha.describe('Validator count proposal scenario', async () => { sudo, validatorCountIncrement ) - tap.test('Validator count proposal', async () => validatorCountProposalFixture.runner(false)) + tap.test('Validator count proposal', async () => await validatorCountProposalFixture.runner(false)) closeApi(apiWrapper) }) diff --git a/tests/network-tests/src/iznik/tests/proposals/workingGroupMintCapacityProposalTest.ts b/tests/network-tests/src/iznik/tests/proposals/workingGroupMintCapacityProposalTest.ts index ecbbab0e17..374b1c0ebd 100644 --- a/tests/network-tests/src/iznik/tests/proposals/workingGroupMintCapacityProposalTest.ts +++ b/tests/network-tests/src/iznik/tests/proposals/workingGroupMintCapacityProposalTest.ts @@ -52,7 +52,7 @@ tap.mocha.describe('Set storage working group mint capacity scenario', async () greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } const newMintCapacity: BN = (await apiWrapper.getWorkingGroupMintCapacity(WorkingGroups.StorageWorkingGroup)).add( @@ -65,7 +65,7 @@ tap.mocha.describe('Set storage working group mint capacity scenario', async () newMintCapacity, WorkingGroups.StorageWorkingGroup ) - tap.test('Propose mint capacity', async () => workingGroupMintCapacityProposalFixture.runner(false)) + tap.test('Propose mint capacity', async () => await workingGroupMintCapacityProposalFixture.runner(false)) let voteForProposalFixture: VoteForProposalFixture const expectMintCapacityChanged: ExpectMintCapacityChangedFixture = new ExpectMintCapacityChangedFixture( diff --git a/tests/network-tests/src/iznik/tests/workingGroup/atLeastValueBugTest.ts b/tests/network-tests/src/iznik/tests/workingGroup/atLeastValueBugTest.ts index 0ed8d65b5c..991b03c582 100644 --- a/tests/network-tests/src/iznik/tests/workingGroup/atLeastValueBugTest.ts +++ b/tests/network-tests/src/iznik/tests/workingGroup/atLeastValueBugTest.ts @@ -12,7 +12,7 @@ import { PaidTermId } from '@alexandria/types/members' import { DbService } from '../../services/dbService' import { LeaderHiringHappyCaseFixture } from '../fixtures/leaderHiringHappyCase' -tap.mocha.describe('Worker application happy case scenario', async () => { +tap.mocha.describe('Zero at least value bug scenario', async () => { initConfig() const nodeUrl: string = process.env.NODE_URL! @@ -72,8 +72,9 @@ tap.mocha.describe('Worker application happy case scenario', async () => { unstakingPeriod, WorkingGroups.StorageWorkingGroup ) - tap.test('Add worker opening with 0 stake, expect failure', async () => - addWorkerOpeningWithoutStakeFixture.runner(true) + tap.test( + 'Add worker opening with 0 stake, expect failure', + async () => await addWorkerOpeningWithoutStakeFixture.runner(true) ) const addWorkerOpeningWithoutUnstakingPeriodFixture: AddWorkerOpeningFixture = new AddWorkerOpeningFixture( @@ -87,8 +88,9 @@ tap.mocha.describe('Worker application happy case scenario', async () => { new BN(0), WorkingGroups.StorageWorkingGroup ) - tap.test('Add worker opening with 0 unstaking period, expect failure', async () => - addWorkerOpeningWithoutUnstakingPeriodFixture.runner(true) + tap.test( + 'Add worker opening with 0 unstaking period, expect failure', + async () => await addWorkerOpeningWithoutUnstakingPeriodFixture.runner(true) ) if (!db.hasLeader(apiWrapper.getWorkingGroupString(WorkingGroups.StorageWorkingGroup))) { @@ -98,7 +100,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Leaving lead role', async () => leaveRoleFixture.runner(false)) + tap.test('Leaving lead role', async () => await leaveRoleFixture.runner(false)) } closeApi(apiWrapper) diff --git a/tests/network-tests/src/iznik/tests/workingGroup/manageWorkerAsLeadTest.ts b/tests/network-tests/src/iznik/tests/workingGroup/manageWorkerAsLeadTest.ts index 6636bfefaa..1700b9bd35 100644 --- a/tests/network-tests/src/iznik/tests/workingGroup/manageWorkerAsLeadTest.ts +++ b/tests/network-tests/src/iznik/tests/workingGroup/manageWorkerAsLeadTest.ts @@ -85,7 +85,7 @@ tap.mocha.describe('Manage worker as lead scenario', async () => { unstakingPeriod, WorkingGroups.StorageWorkingGroup ) - tap.test('Add worker opening', async () => addWorkerOpeningFixture.runner(false)) + tap.test('Add worker opening', async () => await addWorkerOpeningFixture.runner(false)) let applyForWorkerOpeningFixture: ApplyForOpeningFixture tap.test('First apply for worker opening', async () => { @@ -135,7 +135,7 @@ tap.mocha.describe('Manage worker as lead scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Leaving lead role', async () => leaveRoleFixture.runner(false)) + tap.test('Leaving lead role', async () => await leaveRoleFixture.runner(false)) const decreaseStakeFailureFixture: DecreaseStakeFixture = new DecreaseStakeFixture( apiWrapper, @@ -144,7 +144,7 @@ tap.mocha.describe('Manage worker as lead scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Decrease worker stake, expect failure', async () => decreaseStakeFailureFixture.runner(true)) + tap.test('Decrease worker stake, expect failure', async () => await decreaseStakeFailureFixture.runner(true)) const addNewLeaderOpeningFixture: AddLeaderOpeningFixture = new AddLeaderOpeningFixture( apiWrapper, @@ -204,7 +204,7 @@ tap.mocha.describe('Manage worker as lead scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Decrease worker stake', async () => decreaseStakeFixture.runner(false)) + tap.test('Decrease worker stake', async () => await decreaseStakeFixture.runner(false)) const slashFixture: SlashFixture = new SlashFixture( apiWrapper, @@ -213,7 +213,7 @@ tap.mocha.describe('Manage worker as lead scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Slash worker', async () => slashFixture.runner(false)) + tap.test('Slash worker', async () => await slashFixture.runner(false)) const terminateRoleFixture: TerminateRoleFixture = new TerminateRoleFixture( apiWrapper, @@ -222,7 +222,7 @@ tap.mocha.describe('Manage worker as lead scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Terminate worker role', async () => terminateRoleFixture.runner(false)) + tap.test('Terminate worker role', async () => await terminateRoleFixture.runner(false)) if (!db.hasLeader(apiWrapper.getWorkingGroupString(WorkingGroups.StorageWorkingGroup))) { const leaveRoleFixture: LeaveRoleFixture = new LeaveRoleFixture( @@ -231,7 +231,7 @@ tap.mocha.describe('Manage worker as lead scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Leaving lead role', async () => leaveRoleFixture.runner(false)) + tap.test('Leaving lead role', async () => await leaveRoleFixture.runner(false)) } closeApi(apiWrapper) diff --git a/tests/network-tests/src/iznik/tests/workingGroup/manageWorkerAsWorkerTest.ts b/tests/network-tests/src/iznik/tests/workingGroup/manageWorkerAsWorkerTest.ts index 91bc53745c..91c30b3c7c 100644 --- a/tests/network-tests/src/iznik/tests/workingGroup/manageWorkerAsWorkerTest.ts +++ b/tests/network-tests/src/iznik/tests/workingGroup/manageWorkerAsWorkerTest.ts @@ -81,7 +81,7 @@ tap.mocha.describe('Manage worker as worker scenario', async () => { unstakingPeriod, WorkingGroups.StorageWorkingGroup ) - tap.test('Add worker opening', async () => addWorkerOpeningFixture.runner(false)) + tap.test('Add worker opening', async () => await addWorkerOpeningFixture.runner(false)) let applyForWorkerOpeningFixture: ApplyForOpeningFixture tap.test('First apply for worker opening', async () => { @@ -131,7 +131,7 @@ tap.mocha.describe('Manage worker as worker scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Increase worker stake', async () => increaseStakeFixture.runner(false)) + tap.test('Increase worker stake', async () => await increaseStakeFixture.runner(false)) const updateRewardAccountFixture: UpdateRewardAccountFixture = new UpdateRewardAccountFixture( apiWrapper, @@ -140,7 +140,7 @@ tap.mocha.describe('Manage worker as worker scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Update reward account', async () => updateRewardAccountFixture.runner(false)) + tap.test('Update reward account', async () => await updateRewardAccountFixture.runner(false)) const updateRoleAccountFixture: UpdateRewardAccountFixture = new UpdateRewardAccountFixture( apiWrapper, @@ -149,7 +149,7 @@ tap.mocha.describe('Manage worker as worker scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Update role account', async () => updateRoleAccountFixture.runner(false)) + tap.test('Update role account', async () => await updateRoleAccountFixture.runner(false)) if (!db.hasLeader(apiWrapper.getWorkingGroupString(WorkingGroups.StorageWorkingGroup))) { const leaveRoleFixture: LeaveRoleFixture = new LeaveRoleFixture( @@ -158,7 +158,7 @@ tap.mocha.describe('Manage worker as worker scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Leaving lead role', async () => leaveRoleFixture.runner(false)) + tap.test('Leaving lead role', async () => await leaveRoleFixture.runner(false)) } closeApi(apiWrapper) diff --git a/tests/network-tests/src/iznik/tests/workingGroup/workerApplicationHappyCaseTest.ts b/tests/network-tests/src/iznik/tests/workingGroup/workerApplicationHappyCaseTest.ts index 07fdd4bd31..0c9cb75802 100644 --- a/tests/network-tests/src/iznik/tests/workingGroup/workerApplicationHappyCaseTest.ts +++ b/tests/network-tests/src/iznik/tests/workingGroup/workerApplicationHappyCaseTest.ts @@ -80,7 +80,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { unstakingPeriod, WorkingGroups.StorageWorkingGroup ) - tap.test('Add worker opening', async () => addWorkerOpeningFixture.runner(false)) + tap.test('Add worker opening', async () => await addWorkerOpeningFixture.runner(false)) let firstApplyForWorkerOpeningFixture: ApplyForOpeningFixture tap.test('First apply for worker opening', async () => { @@ -102,7 +102,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Withdraw worker application', async () => withdrawApplicationFixture.runner(false)) + tap.test('Withdraw worker application', async () => await withdrawApplicationFixture.runner(false)) let secondApplyForWorkerOpeningFixture: ApplyForOpeningFixture tap.test('Second apply for worker opening', async () => { @@ -153,7 +153,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Leaving lead role', async () => leaveRoleFixture.runner(false)) + tap.test('Leaving lead role', async () => await leaveRoleFixture.runner(false)) } closeApi(apiWrapper) diff --git a/tests/network-tests/src/iznik/tests/workingGroup/workerApplicationRejectionCaseTest.ts b/tests/network-tests/src/iznik/tests/workingGroup/workerApplicationRejectionCaseTest.ts index 24168f0e2f..4c9d1c21af 100644 --- a/tests/network-tests/src/iznik/tests/workingGroup/workerApplicationRejectionCaseTest.ts +++ b/tests/network-tests/src/iznik/tests/workingGroup/workerApplicationRejectionCaseTest.ts @@ -19,7 +19,7 @@ import { OpeningId } from '@alexandria/types/hiring' import { DbService } from '../../services/dbService' import { LeaderHiringHappyCaseFixture } from '../fixtures/leaderHiringHappyCase' -tap.mocha.describe('Worker application happy case scenario', async () => { +tap.mocha.describe('Worker application rejection case scenario', async () => { initConfig() const nodeUrl: string = process.env.NODE_URL! @@ -81,7 +81,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { unstakingPeriod, WorkingGroups.StorageWorkingGroup ) - tap.test('Add worker opening', async () => addWorkerOpeningFixture.runner(false)) + tap.test('Add worker opening', async () => await addWorkerOpeningFixture.runner(false)) let applyForWorkerOpeningBeforeAcceptanceFixture: ApplyForOpeningFixture tap.test('Apply for worker opening, expect failure', async () => { @@ -106,7 +106,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId, WorkingGroups.StorageWorkingGroup ) - acceptApplicationsFixture.runner(false) + await acceptApplicationsFixture.runner(false) }) let applyForWorkerOpeningAsNonMemberFixture: ApplyForOpeningFixture @@ -144,7 +144,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Terminate worker applicaitons', async () => terminateApplicationsFixture.runner(false)) + tap.test('Terminate worker applicaitons', async () => await terminateApplicationsFixture.runner(false)) if (!db.hasLeader(apiWrapper.getWorkingGroupString(WorkingGroups.StorageWorkingGroup))) { const leaveRoleFixture: LeaveRoleFixture = new LeaveRoleFixture( @@ -153,7 +153,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Leaving lead role', async () => leaveRoleFixture.runner(false)) + tap.test('Leaving lead role', async () => await leaveRoleFixture.runner(false)) } closeApi(apiWrapper) diff --git a/tests/network-tests/src/iznik/tests/workingGroup/workerPayoutTest.ts b/tests/network-tests/src/iznik/tests/workingGroup/workerPayoutTest.ts index d81af7a1a1..396d1beeb1 100644 --- a/tests/network-tests/src/iznik/tests/workingGroup/workerPayoutTest.ts +++ b/tests/network-tests/src/iznik/tests/workingGroup/workerPayoutTest.ts @@ -25,7 +25,7 @@ import { CouncilElectionHappyCaseFixture } from '../fixtures/councilElectionHapp import { LeaderHiringHappyCaseFixture } from '../fixtures/leaderHiringHappyCase' import { BuyMembershipHappyCaseFixture } from '../fixtures/membershipModule' -tap.mocha.describe('Worker application happy case scenario', async () => { +tap.mocha.describe('Worker payout scenario', async () => { initConfig() const nodeUrl: string = process.env.NODE_URL! @@ -68,7 +68,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { m1KeyPairs, paidTerms ) - tap.test('Recreating set of members', async () => memberSetFixture.runner(false)) + tap.test('Recreating set of members', async () => await memberSetFixture.runner(false)) m2KeyPairs = db.getCouncil() } else { const councilElectionHappyCaseFixture = new CouncilElectionHappyCaseFixture( @@ -81,7 +81,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { greaterStake, lesserStake ) - councilElectionHappyCaseFixture.runner(false) + await councilElectionHappyCaseFixture.runner(false) } if (db.hasLeader(apiWrapper.getWorkingGroupString(WorkingGroups.StorageWorkingGroup))) { @@ -111,7 +111,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { mintCapacity, WorkingGroups.StorageWorkingGroup ) - tap.test('Propose mint capacity', async () => workingGroupMintCapacityProposalFixture.runner(false)) + tap.test('Propose mint capacity', async () => await workingGroupMintCapacityProposalFixture.runner(false)) let voteForProposalFixture: VoteForProposalFixture const expectMintCapacityChanged: ExpectMintCapacityChangedFixture = new ExpectMintCapacityChangedFixture( @@ -140,7 +140,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { unstakingPeriod, WorkingGroups.StorageWorkingGroup ) - tap.test('Add worker opening', async () => addWorkerOpeningFixture.runner(false)) + tap.test('Add worker opening', async () => await addWorkerOpeningFixture.runner(false)) let applyForWorkerOpeningFixture: ApplyForOpeningFixture tap.test('First apply for worker opening', async () => { @@ -189,7 +189,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { m1KeyPairs, WorkingGroups.StorageWorkingGroup ) - tap.test('Await worker payout', async () => awaitPayoutFixture.runner(false)) + tap.test('Await worker payout', async () => await awaitPayoutFixture.runner(false)) if (!db.hasLeader(apiWrapper.getWorkingGroupString(WorkingGroups.StorageWorkingGroup))) { const leaveRoleFixture: LeaveRoleFixture = new LeaveRoleFixture( @@ -198,7 +198,7 @@ tap.mocha.describe('Worker application happy case scenario', async () => { sudo, WorkingGroups.StorageWorkingGroup ) - tap.test('Leaving lead role', async () => leaveRoleFixture.runner(false)) + tap.test('Leaving lead role', async () => await leaveRoleFixture.runner(false)) } closeApi(apiWrapper)