Skip to content

Commit

Permalink
chore: remove logs and add address to getProof response
Browse files Browse the repository at this point in the history
  • Loading branch information
kstdl committed Nov 27, 2023
1 parent 4cff9b5 commit a066cf3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 3 additions & 0 deletions libraries/core_libs/consensus/src/final_chain/final_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ class FinalChainImpl final : public FinalChain {
state_api::ProofResponse get_proof(EthBlockNumber blk_num, const addr_t& addr,
const std::vector<h256>& keys) const override {
auto h = get_block_header(blk_num);
if (!h) {
throw std::runtime_error("Future block");
}
return state_api_.get_proof(blk_num, addr, h->state_root, keys);
}

Expand Down
3 changes: 0 additions & 3 deletions libraries/core_libs/consensus/src/final_chain/trie_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ h256 hash256(BytesMap const& _s) {
HexMap hexMap;
for (auto i = _s.rbegin(); i != _s.rend(); ++i) hexMap[asNibbles(bytesConstRef(&i->first))] = i->second;
RLPStream s;
for (const auto& [k, v] : hexMap) {
std::cout << toHex(k) << ": " << toHex(v) << std::endl;
}
hash256rlp(hexMap, hexMap.cbegin(), hexMap.cend(), 0, s);
return sha3(s.out());
}
Expand Down
7 changes: 3 additions & 4 deletions libraries/core_libs/network/rpc/eth/Eth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,9 @@ class EthImpl : public Eth, EthParams {
keys.reserve(_keys.size());
std::transform(_keys.begin(), _keys.end(), std::back_inserter(keys),
[](const auto& k) { return jsToFixed<32>(k.asString()); });
const auto proof = final_chain->get_proof(block_number, addr_t(_address), keys);
// std::cout << proof.storage_hash << std::endl;
// return to JS(final_chain->get_account_storage(toAddress(_address), jsToU256(_position), block_number));
return toJson(proof);
auto proof = toJson(final_chain->get_proof(block_number, addr_t(_address), keys));
proof["address"] = _address;
return proof;
}

void note_block_executed(const BlockHeader& blk_header, const SharedTransactions& trxs,
Expand Down

0 comments on commit a066cf3

Please sign in to comment.