councilElectionHappyCase.ts 967 B

12345678910111213141516171819202122232425262728293031323334
  1. import { Fixture } from '../Fixture'
  2. import { ElectCouncilFixture } from './councilElectionModule'
  3. import { Api } from '../Api'
  4. import BN from 'bn.js'
  5. export class CouncilElectionHappyCaseFixture implements Fixture {
  6. private api: Api
  7. private voters: string[]
  8. private applicants: string[]
  9. private k: number
  10. private greaterStake: BN
  11. private lesserStake: BN
  12. constructor(api: Api, voters: string[], applicants: string[], k: number, greaterStake: BN, lesserStake: BN) {
  13. this.api = api
  14. this.voters = voters
  15. this.applicants = applicants
  16. this.k = k
  17. this.greaterStake = greaterStake
  18. this.lesserStake = lesserStake
  19. }
  20. public async runner(expectFailure: boolean): Promise<void> {
  21. const electCouncilFixture: ElectCouncilFixture = new ElectCouncilFixture(
  22. this.api,
  23. this.voters,
  24. this.applicants,
  25. this.k,
  26. this.greaterStake,
  27. this.lesserStake
  28. )
  29. await electCouncilFixture.runner(false)
  30. }
  31. }