From c71722d8895daea5043062acab8f064b723cc44a Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Tue, 10 Jan 2023 23:03:52 +1300 Subject: [PATCH] able to inject hrmp via dev_newBlock --- src/rpc/dev.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/dev.ts b/src/rpc/dev.ts index cba26291..bada1b82 100644 --- a/src/rpc/dev.ts +++ b/src/rpc/dev.ts @@ -8,7 +8,7 @@ const logger = defaultLogger.child({ name: 'rpc-dev' }) const handlers: Handlers = { dev_newBlock: async (context, [param]) => { - const { count, to } = param || {} + const { count, to, hrmp } = param || {} const now = context.chain.head.number const diff = to ? to - now : count const finalCount = diff > 0 ? diff : 1 @@ -16,7 +16,7 @@ const handlers: Handlers = { let finalHash: string | undefined for (let i = 0; i < finalCount; i++) { - const block = await context.chain.newBlock().catch((error) => { + const block = await context.chain.newBlock({ inherent: { horizontalMessages: hrmp } }).catch((error) => { throw new ResponseError(1, error.toString()) }) logger.debug({ hash: block.hash }, 'dev_newBlock')