Add hash to BroadcastTxAsyncResponse

This commit is contained in:
Simon Warta 2021-11-23 10:21:32 +01:00
parent e3ce6eb3d8
commit 90ebdd2bc4
3 changed files with 14 additions and 4 deletions

View File

@ -6,6 +6,13 @@ and this project adheres to
## [Unreleased]
### Added
- @cosmjs/tendermint-rpc: Add `hash` field to `BroadcastTxAsyncResponse`
([#938]).
[#938]: https://github.com/cosmos/cosmjs/issues/938
### Fixed
- @cosmjs/tendermint-rpc: Add missing `BlockSearchResponse` case to `Response`.

View File

@ -71,8 +71,12 @@ export interface BlockchainResponse {
readonly blockMetas: readonly BlockMeta[];
}
/** No data in here because RPC method BroadcastTxAsync "returns right away, with no response" */
export interface BroadcastTxAsyncResponse {}
/**
* No transaction data in here because RPC method BroadcastTxAsync "returns right away, with no response"
*/
export interface BroadcastTxAsyncResponse {
readonly hash: Uint8Array;
}
export interface BroadcastTxSyncResponse extends TxData {
readonly hash: Uint8Array;

View File

@ -90,8 +90,7 @@ function defaultTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValues)
const tx = buildKvTx(randomString(), randomString());
const response = await client.broadcastTxAsync({ tx: tx });
// TODO: Remove any cast after https://github.com/cosmos/cosmjs/issues/938
expect((response as any).hash.length).toEqual(32);
expect(response.hash.length).toEqual(32);
client.disconnect();
});