From 53a94e0b4d0c481d8702df00b1434d1fcd81fa47 Mon Sep 17 00:00:00 2001 From: vanderian Date: Tue, 31 Jan 2023 09:40:59 +0100 Subject: [PATCH] fix callback method name & add unsub for finalized head --- src/rpc/substrate/chain.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rpc/substrate/chain.ts b/src/rpc/substrate/chain.ts index 15ffef01..64eb64cf 100644 --- a/src/rpc/substrate/chain.ts +++ b/src/rpc/substrate/chain.ts @@ -49,7 +49,7 @@ const handlers: Handlers = { let update = () => {} const id = context.chain.headState.subscribeHead(() => update()) - const callback = subscribe('chain_newFinalizedHead', id, () => context.chain.headState.unsubscribeHead(id)) + const callback = subscribe('chain_finalizedHead', id, () => context.chain.headState.unsubscribeHead(id)) update = async () => { callback(await context.chain.head.header) @@ -67,6 +67,7 @@ const handlers: Handlers = { const alias = { chain_subscribeNewHeads: handlers.chain_subscribeNewHead, chain_unsubscribeNewHeads: handlers.chain_unsubscribeNewHead, + chain_unsubscribeFinalizedHeads: handlers.chain_unsubscribeNewHead, } export default {