mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
tendermint-rpc: Fill out RPC BlockMeta type for v0.34
This commit is contained in:
parent
3d46a76eaf
commit
230ae04dd3
@ -346,13 +346,17 @@ function decodeHeader(data: RpcHeader): responses.Header {
|
||||
|
||||
interface RpcBlockMeta {
|
||||
readonly block_id: RpcBlockId;
|
||||
readonly block_size: string;
|
||||
readonly header: RpcHeader;
|
||||
readonly num_txs: string;
|
||||
}
|
||||
|
||||
function decodeBlockMeta(data: RpcBlockMeta): responses.BlockMeta {
|
||||
return {
|
||||
blockId: decodeBlockId(data.block_id),
|
||||
blockSize: Integer.parse(assertNotEmpty(data.block_size)),
|
||||
header: decodeHeader(data.header),
|
||||
numTxs: Integer.parse(assertNotEmpty(data.num_txs)),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -195,9 +195,9 @@ export interface TxProof {
|
||||
|
||||
export interface BlockMeta {
|
||||
readonly blockId: BlockId;
|
||||
readonly blockSize: number;
|
||||
readonly header: Header;
|
||||
// TODO: Add blockSize (e.g "block_size": "471")
|
||||
// TODO: Add numTxs (e.g "num_txs": "0")
|
||||
readonly numTxs: number;
|
||||
}
|
||||
|
||||
export interface BlockId {
|
||||
|
Loading…
x
Reference in New Issue
Block a user