Skip to content

Commit

Permalink
Fix block_id_flag formatting in REST
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Jun 12, 2024
1 parent 2d44997 commit d245d12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,12 @@ fn parse_block(res: tendermint_rpc::endpoint::block::Response) -> Value {

json!({
"validator_address": base64::encode(signature_raw.validator_address),
"block_id_flag": signature_raw.block_id_flag,
"block_id_flag": match signature_raw.block_id_flag {
1 => "BLOCK_ID_FLAG_ABSENT",
2 => "BLOCK_ID_FLAG_COMMIT",
3 => "BLOCK_ID_FLAG_NIL",
i32::MIN..=0_i32 | 4_i32..=i32::MAX => "BLOCK_ID_FLAG_UNKNOWN"
},
"timestamp": signature_raw.timestamp,
"signature": base64::encode(signature_raw.signature),
})
Expand Down

0 comments on commit d245d12

Please sign in to comment.