Skip to content

Commit

Permalink
propagate tx events when broadcasting transaction (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomauricio authored Jul 15, 2024
1 parent d545720 commit 09e6a6e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/core/src/internals/adapters/extensions/Station.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export class Station implements ExtensionProviderAdapter {
return {
hash: tx.hash,
rawLogs: tx.rawLog,
events: tx.events,
response: tx,
};
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/internals/cosmos/BroadcastClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class BroadcastClient {
return {
hash: broadcast.transactionHash,
rawLogs: broadcast.rawLog || "",
events: broadcast.events,
response: broadcast,
};
}
Expand Down Expand Up @@ -76,6 +77,7 @@ export class BroadcastClient {
return {
hash: response.txHash,
rawLogs: response.rawLog,
events: response.events ?? [],
response: response,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class SignAndBroadcastClient {
return {
hash: broadcast.transactionHash,
rawLogs: broadcast.rawLog || "",
events: broadcast.events,
response: broadcast,
};
}
Expand Down
14 changes: 13 additions & 1 deletion packages/core/src/internals/transactions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Fee } from "../../internals/cosmos";
import { type DeliverTxResponse } from "@cosmjs/stargate";

export * from "./messages";

Expand All @@ -16,7 +17,18 @@ export type SimulateResult = SimulateResultSuccess | SimulateResultError;

export type BroadcastResult = {
hash: string;
rawLogs: string;
/**
* A string-based log document.
*
* This currently seems to merge attributes of multiple events into one event per type
* (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events`
* field instead.
*
* @deprecated This field is not filled anymore in Cosmos SDK 0.50+ (https://github.com/cosmos/cosmos-sdk/pull/15845).
* Please consider using `events` instead.
*/
rawLogs: DeliverTxResponse["rawLog"];
events: DeliverTxResponse["events"];
response: any;
};

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/providers/mobile/WalletMobileProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ export abstract class WalletMobileProvider {
return {
hash: "",
rawLogs: "",
events: [],
response: null,
};
}
Expand Down

0 comments on commit 09e6a6e

Please sign in to comment.