Browse Source

reward relationship for leader issue fixed

Gleb Urvanov 4 years ago
parent
commit
6e0b505048

+ 1 - 1
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/workingGroup/workerPayoutTest.ts -T",
+    "debug": "tap --files src/iznik/tests/proposals/manageLeaderRoleTest.ts -T",
     "lint": "eslint . --quiet --ext .ts",
     "checks": "yarn lint && tsc --noEmit --pretty && prettier ./ --check",
     "format": "prettier ./ --write "

+ 2 - 1
tests/network-tests/src/iznik/tests/fixtures/workingGroupModule.ts

@@ -1025,7 +1025,8 @@ export class ExpectLeaderRewardAmountUpdatedFixture implements Fixture {
     const event: Event = await this.apiWrapper.expectEvent('WorkerRewardAmountUpdated')
     this.events.push(event)
     const leadWorkerId: WorkerId = (await this.apiWrapper.getLeadWorkerId(this.module))!
-    const receivedReward: BN = (await this.apiWrapper.getRewardRelationship(leadWorkerId)).amount_per_payout
+    const leadWorker: Worker = await this.apiWrapper.getWorkerById(leadWorkerId, this.module)
+    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}`