From 864a53ad060f316acc3deb36f5f9bf6f81db22ec Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Mon, 4 Nov 2024 18:46:47 +0000 Subject: [PATCH] add archive_unstable_hashByHeight alias --- packages/core/src/rpc/substrate/chain.ts | 1 + packages/e2e/src/chain.test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/core/src/rpc/substrate/chain.ts b/packages/core/src/rpc/substrate/chain.ts index 7d00582e..b6bfe951 100644 --- a/packages/core/src/rpc/substrate/chain.ts +++ b/packages/core/src/rpc/substrate/chain.ts @@ -114,6 +114,7 @@ export const chain_unsubscribeNewHead: Handler<[string], void> = async (_context unsubscribe(subid) } +export const archive_unstable_hashByHeight = chain_getBlockHash export const chain_getHead = chain_getBlockHash export const chain_subscribeNewHeads = chain_subscribeNewHead export const chain_unsubscribeNewHeads = chain_unsubscribeNewHead diff --git a/packages/e2e/src/chain.test.ts b/packages/e2e/src/chain.test.ts index a55c0564..519777dd 100644 --- a/packages/e2e/src/chain.test.ts +++ b/packages/e2e/src/chain.test.ts @@ -29,6 +29,8 @@ describe('chain rpc', () => { expect(await api.rpc('chain_getBlockHash', '0x03e8')).toEqual(hash1000) expect(await api.rpc('chain_getBlockHash', ['0x03e8'])).toEqual(expect.arrayContaining([hash1000])) expect(await api.rpc('chain_getBlockHash', ['0x03e8', null])).toEqual(expect.arrayContaining([hash1000, hashHead])) + // alias works + expect(await api.rpc('archive_unstable_hashByHeight', [1000])).toEqual(expect.arrayContaining([hash1000])) await check(api.rpc.chain.getHeader()).toMatchSnapshot() await check(api.rpc.chain.getHeader(hashHead)).toMatchSnapshot()