Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qiweiii committed Oct 23, 2024
1 parent ca31d47 commit 6c08f9c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions RPC/Sources/RPC/Handlers/ChainHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
}
}
}

0 comments on commit 6c08f9c

Please sign in to comment.