From b430040f0bf0faad9b7aefa03304e234dc6af7bb Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Mon, 30 Oct 2023 17:55:55 +0100 Subject: [PATCH] fix RPC getBlock number --- packages/core/src/genesis-provider.ts | 2 +- packages/core/src/rpc/substrate/chain.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/genesis-provider.ts b/packages/core/src/genesis-provider.ts index 73ff2529..d6fc034a 100644 --- a/packages/core/src/genesis-provider.ts +++ b/packages/core/src/genesis-provider.ts @@ -98,7 +98,7 @@ export class GenesisProvider implements ProviderInterface { getHeader = async () => { return { blockHash: this.blockHash, - number: 0, + number: '0x0' as HexString, stateRoot: await this.#stateRoot, digest: { logs: [], diff --git a/packages/core/src/rpc/substrate/chain.ts b/packages/core/src/rpc/substrate/chain.ts index 8a6cc9df..1aac14a6 100644 --- a/packages/core/src/rpc/substrate/chain.ts +++ b/packages/core/src/rpc/substrate/chain.ts @@ -56,7 +56,7 @@ export const chain_getBlock: Handler< } return { block: { - header: await block.header, + header: processHeader(await block.header), extrinsics: await block.extrinsics, }, justifications: null,