Merge pull request #943 from cosmos/add-hash-to-async-response

Add hash field to BroadcastTxAsyncResponse
This commit is contained in:
Simon Warta
2021-11-23 11:37:44 +01:00
committed by GitHub
3 changed files with 19 additions and 4 deletions
+11
View File
@@ -6,6 +6,17 @@ 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`.
### Changed
- @cosmjs/stargate: Remove verified queries from `AuthExtension` and
@@ -8,6 +8,7 @@ export type Response =
| AbciQueryResponse
| BlockResponse
| BlockResultsResponse
| BlockSearchResponse
| BlockchainResponse
| BroadcastTxAsyncResponse
| BroadcastTxSyncResponse
@@ -70,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;
@@ -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();
});