From c51fb2154fa9995af8de7c21b444fefcaedec47b Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 24 Oct 2022 23:43:35 +0200 Subject: [PATCH] Add events to SigningCosmWasmClient's methods --- CHANGELOG.md | 2 ++ .../cosmwasm-stargate/src/signingcosmwasmclient.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 325ef099de..1bbafdc428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to replacement charater instead of throwing. - @cosmjs/stargate: Add structured `Events`s to `IndexTx.events` and `DeliverTxResponse.events`. +- @cosmjs/cosmwasm-stargate: Add structured `Events`s field to + `SigningCosmWasmClient`s transaction execution methods. ## [0.29.2] - 2022-10-13 diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts index 93b455ea20..6abf5648a5 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts @@ -20,6 +20,7 @@ import { createBankAminoConverters, defaultRegistryTypes as defaultStargateTypes, DeliverTxResponse, + Event, GasPrice, isDeliverTxFailure, logs, @@ -76,6 +77,7 @@ export interface UploadResult { readonly height: number; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; + readonly events: readonly Event[]; readonly gasWanted: number; readonly gasUsed: number; } @@ -109,6 +111,7 @@ export interface InstantiateResult { readonly height: number; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; + readonly events: readonly Event[]; readonly gasWanted: number; readonly gasUsed: number; } @@ -122,6 +125,7 @@ export interface ChangeAdminResult { readonly height: number; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; + readonly events: readonly Event[]; readonly gasWanted: number; readonly gasUsed: number; } @@ -132,6 +136,7 @@ export interface MigrateResult { readonly height: number; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; + readonly events: readonly Event[]; readonly gasWanted: number; readonly gasUsed: number; } @@ -148,6 +153,7 @@ export interface ExecuteResult { readonly height: number; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; + readonly events: readonly Event[]; readonly gasWanted: number; readonly gasUsed: number; } @@ -271,6 +277,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { logs: parsedLogs, height: result.height, transactionHash: result.transactionHash, + events: result.events, gasWanted: result.gasWanted, gasUsed: result.gasUsed, }; @@ -306,6 +313,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { logs: parsedLogs, height: result.height, transactionHash: result.transactionHash, + events: result.events, gasWanted: result.gasWanted, gasUsed: result.gasUsed, }; @@ -334,6 +342,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { logs: logs.parseRawLog(result.rawLog), height: result.height, transactionHash: result.transactionHash, + events: result.events, gasWanted: result.gasWanted, gasUsed: result.gasUsed, }; @@ -360,6 +369,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { logs: logs.parseRawLog(result.rawLog), height: result.height, transactionHash: result.transactionHash, + events: result.events, gasWanted: result.gasWanted, gasUsed: result.gasUsed, }; @@ -390,6 +400,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { logs: logs.parseRawLog(result.rawLog), height: result.height, transactionHash: result.transactionHash, + events: result.events, gasWanted: result.gasWanted, gasUsed: result.gasUsed, }; @@ -437,6 +448,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { logs: logs.parseRawLog(result.rawLog), height: result.height, transactionHash: result.transactionHash, + events: result.events, gasWanted: result.gasWanted, gasUsed: result.gasUsed, };