diff --git a/CHANGELOG.md b/CHANGELOG.md index 46a3ff87..73285665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,11 @@ and this project adheres to `AminoTypesOptions`. This is an object with a required `prefix` field. Before the prefix defaulted to "cosmos" but this is almost never the right choice for CosmJS users that need to add Amino types manually. ([#989]) +- @cosmjs/tendermint-rpc: The property `evidence` in the interface `Block` is now + non-optional. ([#1011]) [#989]: https://github.com/cosmos/cosmjs/issues/989 +[#1011]: https://github.com/cosmos/cosmjs/issues/1011 ### Removed diff --git a/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts b/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts index b8784188..b2255d99 100644 --- a/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts +++ b/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts @@ -757,7 +757,7 @@ function decodeBlock(data: RpcBlock): responses.Block { txs: data.data.txs ? assertArray(data.data.txs).map(fromBase64) : [], // Lift up .evidence.evidence to just .evidence // See https://github.com/tendermint/tendermint/issues/7697 - evidence: data.evidence?.evidence, + evidence: data.evidence?.evidence ?? [], }; } diff --git a/packages/tendermint-rpc/src/tendermint34/responses.ts b/packages/tendermint-rpc/src/tendermint34/responses.ts index c7648f69..fbbb058d 100644 --- a/packages/tendermint-rpc/src/tendermint34/responses.ts +++ b/packages/tendermint-rpc/src/tendermint34/responses.ts @@ -227,8 +227,7 @@ export interface Block { */ readonly lastCommit: Commit | null; readonly txs: readonly Uint8Array[]; - // This field becomes non-optional in 0.28 (https://github.com/cosmos/cosmjs/issues/1011) - readonly evidence?: readonly Evidence[]; + readonly evidence: readonly Evidence[]; } /**