diff --git a/e2e/helper.ts b/e2e/helper.ts index 4c7cabc5..a010fdc4 100644 --- a/e2e/helper.ts +++ b/e2e/helper.ts @@ -31,7 +31,7 @@ export const env = { const setupAll = async ({ endpoint, blockHash, mockSignatureHost }: SetupOption) => { const wsProvider = new WsProvider(endpoint) - const api = new Api(wsProvider) + const api = new Api(wsProvider, { SetEvmOrigin: { payload: {}, extrinsic: {} } }) await api.isReady @@ -67,7 +67,15 @@ const setupAll = async ({ endpoint, blockHash, mockSignatureHost }: SetupOption) tasks.updateListeningPort(listeningPort) const wsProvider2 = new WsProvider(`ws://localhost:${listeningPort}`) - const api2 = await ApiPromise.create({ provider: wsProvider2 }) + const api2 = await ApiPromise.create({ + provider: wsProvider2, + signedExtensions: { + SetEvmOrigin: { + extrinsic: {}, + payload: {}, + }, + }, + }) return { chain, diff --git a/src/api.ts b/src/api.ts index cf1e87bf..f7aad5bb 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,3 +1,4 @@ +import { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types' import { HexString } from '@polkadot/util/types' import { ProviderInterface } from '@polkadot/rpc-provider/types' @@ -31,8 +32,11 @@ export class Api { #chain: Promise #chainProperties: Promise - constructor(provider: ProviderInterface) { + readonly signedExtensions: ExtDef + + constructor(provider: ProviderInterface, signedExtensions?: ExtDef) { this.#provider = provider + this.signedExtensions = signedExtensions || {} this.#isReady = new Promise((resolve, reject) => { if (this.#provider.isConnected) { setTimeout(resolve, 500) diff --git a/src/blockchain/block.ts b/src/blockchain/block.ts index 03f78cce..d6544ddc 100644 --- a/src/blockchain/block.ts +++ b/src/blockchain/block.ts @@ -43,6 +43,7 @@ export class Block { this.#extrinsics = block?.extrinsics this.#baseStorage = block?.storage ?? new RemoteStorageLayer(chain.api, hash, chain.db) this.#storages = [] + this.#registry = parentBlock?.registry } get header(): Header | Promise
{ @@ -155,7 +156,11 @@ export class Block { registry.setMetadata( new Metadata(registry, data), undefined, - objectSpread({}, getSpecExtensions(registry, chain, version.specName), {}) + objectSpread( + {}, + getSpecExtensions(registry, chain, version.specName), + this.#chain.api.signedExtensions + ) ) return registry })