Skip to content

Commit

Permalink
rpc: return latest_cumulative_weight hex-encoded
Browse files Browse the repository at this point in the history
Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Feb 10, 2022
1 parent 3a430c6 commit 70c89eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/rpc/rpc_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl<N: Network, E: Environment> RpcFunctions<N> for RpcContext<N, E> {
"block_height": block_height,
"time": block_timestamp,
"difficulty_target": difficulty_target,
"cumulative_weight": cumulative_weight,
"cumulative_weight": format!("{:x}", cumulative_weight),
"ledger_root": ledger_root,
"transactions": transactions,
"coinbase_reward": coinbase_reward,
Expand Down Expand Up @@ -232,7 +232,7 @@ impl<N: Network, E: Environment> RpcFunctions<N> for RpcContext<N, E> {
"connected_peers": connected_peers,
"latest_block_hash": latest_block_hash,
"latest_block_height": latest_block_height,
"latest_cumulative_weight": latest_cumulative_weight,
"latest_cumulative_weight": format!("{:x}", latest_cumulative_weight),
"launched": format!("{} minutes ago", self.launched.elapsed().as_secs() / 60),
"number_of_candidate_peers": number_of_candidate_peers,
"number_of_connected_peers": number_of_connected_peers,
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ async fn test_get_node_state() {
"connected_peers": Vec::<SocketAddr>::new(),
"latest_block_hash": Testnet2::genesis_block().hash(),
"latest_block_height": 0u32,
"latest_cumulative_weight": 0u128,
"latest_cumulative_weight": "0",
"launched": format!("{} minutes ago", 0),
"number_of_candidate_peers": 0usize,
"number_of_connected_peers": 0usize,
Expand Down

0 comments on commit 70c89eb

Please sign in to comment.