From 81066ea13deee63c65b2637876613c9dacec9bcf Mon Sep 17 00:00:00 2001 From: girazoki Date: Wed, 9 Oct 2024 02:23:09 +0200 Subject: [PATCH] Rework author noting inherent mock and stagelight config (#834) * Stalight config and rework of nimbus author inherent * remove log * Update packages/core/src/blockchain/inherent/parachain/nimbus-author-inherent.ts * fixes * pr suggestions --------- Co-authored-by: Xiliang Chen --- configs/stagelight.yml | 14 ++++++++++++++ .../inherent/parachain/nimbus-author-inherent.ts | 10 +++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 configs/stagelight.yml diff --git a/configs/stagelight.yml b/configs/stagelight.yml new file mode 100644 index 00000000..6d1700ae --- /dev/null +++ b/configs/stagelight.yml @@ -0,0 +1,14 @@ +endpoint: wss://stagelight.tanssi-dev.network +block: ${env.FLASHBOX_BLOCK_NUMBER} +mock-signature-host: true +db: ./tmp/db_mba.sqlite + +import-storage: + System: + Account: + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - providers: 1 + data: + free: "100000000000000000000000" + Sudo: + Key: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" diff --git a/packages/core/src/blockchain/inherent/parachain/nimbus-author-inherent.ts b/packages/core/src/blockchain/inherent/parachain/nimbus-author-inherent.ts index 3b58f12c..35042410 100644 --- a/packages/core/src/blockchain/inherent/parachain/nimbus-author-inherent.ts +++ b/packages/core/src/blockchain/inherent/parachain/nimbus-author-inherent.ts @@ -11,7 +11,16 @@ export class SetNimbusAuthorInherent implements InherentProvider { if (!parent) throw new Error('parent block not found') const meta = await parent.meta + if (!meta.tx.authorInherent?.kickOffAuthorshipValidation) { + if (meta.query.authorNoting) { + newBlock + .pushStorageLayer() + .set( + compactHex(meta.query.authorNoting.didSetContainerAuthorData()), + meta.registry.createType('bool', true).toHex(), + ) + } return [] } @@ -64,7 +73,6 @@ export class SetNimbusAuthorInherent implements InherentProvider { .toHex(), ) } - layer.set( compactHex(meta.query.authorNoting.didSetContainerAuthorData()), meta.registry.createType('bool', true).toHex(),