From 3e664068170a0afd10656ab3ffdeffb521efaaaa Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 22 Dec 2022 18:02:27 +0000 Subject: [PATCH] fix: notePreimage pallet for unq/qtz --- --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -150,6 +150,7 @@ constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) { options.helperBase = options.helperBase ?? DevMoonbeamHelper; + options.notePreimagePallet = options.notePreimagePallet ?? 'democracy'; super(logger, options); this.account = new MoonbeamAccountGroup(this); @@ -157,7 +158,12 @@ } } -export class DevMoonriverHelper extends DevMoonbeamHelper {} +export class DevMoonriverHelper extends DevMoonbeamHelper { + constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) { + options.notePreimagePallet = options.notePreimagePallet ?? 'preimage'; + super(logger, options); + } +} export class DevAcalaHelper extends AcalaHelper { wait: WaitGroup; --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2874,8 +2874,15 @@ } class MoonbeamDemocracyGroup extends HelperGroup { + notePreimagePallet: string; + + constructor(helper: MoonbeamHelper, options: {[key: string]: any} = {}) { + super(helper); + this.notePreimagePallet = options.notePreimagePallet; + } + async notePreimage(signer: TSigner, encodedProposal: string) { - await this.helper.executeExtrinsic(signer, 'api.tx.preimage.notePreimage', [encodedProposal], true); + await this.helper.executeExtrinsic(signer, `api.tx.${this.notePreimagePallet}.notePreimage`, [encodedProposal], true); } externalProposeMajority(proposal: any) { @@ -3013,7 +3020,7 @@ this.assetManager = new MoonbeamAssetManagerGroup(this); this.assets = new AssetsGroup(this); this.xTokens = new XTokensGroup(this); - this.democracy = new MoonbeamDemocracyGroup(this); + this.democracy = new MoonbeamDemocracyGroup(this, options); this.collective = { council: new MoonbeamCollectiveGroup(this, 'councilCollective'), techCommittee: new MoonbeamCollectiveGroup(this, 'techCommitteeCollective'), -- gitstuff