From 6c08f9cd97a56908fd2b73945329d114a3a8621e Mon Sep 17 00:00:00 2001 From: Qiwei Yang Date: Wed, 23 Oct 2024 19:43:05 +0800 Subject: [PATCH] fix --- RPC/Sources/RPC/Handlers/ChainHandler.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/RPC/Sources/RPC/Handlers/ChainHandler.swift b/RPC/Sources/RPC/Handlers/ChainHandler.swift index 7baf33f0..c7902487 100644 --- a/RPC/Sources/RPC/Handlers/ChainHandler.swift +++ b/RPC/Sources/RPC/Handlers/ChainHandler.swift @@ -42,12 +42,18 @@ struct ChainHandler { } let state = try await source.getState(hash: data32) // return state root for now - return ["stateRoot": state?.stateRoot.description] + return [ + "stateRoot": state?.stateRoot.description, + "blockHash": hash.description, + ] } else { // return best block state by default let block = try await source.getBestBlock() let state = try await source.getState(hash: block.hash) - return ["stateRoot": state?.stateRoot.description] + return [ + "stateRoot": state?.stateRoot.description, + "blockHash": block.hash.description, + ] } } }