mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
tendermint-rpc: Add gas and code space to tx data
This commit is contained in:
parent
212318d2a8
commit
b25171cfef
@ -126,19 +126,25 @@ function decodeEvents(events: readonly RpcEvent[]): readonly responses.Event[] {
|
||||
}
|
||||
|
||||
interface RpcTxData {
|
||||
readonly codespace?: string;
|
||||
readonly code?: number;
|
||||
readonly log?: string;
|
||||
/** base64 encoded */
|
||||
readonly data?: string;
|
||||
readonly events?: readonly RpcEvent[];
|
||||
readonly gas_wanted?: string;
|
||||
readonly gas_used?: string;
|
||||
}
|
||||
|
||||
function decodeTxData(data: RpcTxData): responses.TxData {
|
||||
return {
|
||||
data: may(fromBase64, data.data),
|
||||
log: data.log,
|
||||
code: Integer.parse(assertNumber(optional<number>(data.code, 0))),
|
||||
codeSpace: data.codespace,
|
||||
log: data.log,
|
||||
data: may(fromBase64, data.data),
|
||||
events: data.events ? decodeEvents(data.events) : [],
|
||||
gasWanted: Integer.parse(optional<string>(data.gas_wanted, "0")),
|
||||
gasUsed: Integer.parse(optional<string>(data.gas_used, "0")),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -176,10 +176,12 @@ export interface Event {
|
||||
|
||||
export interface TxData {
|
||||
readonly code: number;
|
||||
readonly codeSpace?: string;
|
||||
readonly log?: string;
|
||||
readonly data?: Uint8Array;
|
||||
readonly events: readonly Event[];
|
||||
// readonly fees?: any;
|
||||
readonly gasWanted: number;
|
||||
readonly gasUsed: number;
|
||||
}
|
||||
|
||||
export interface TxProof {
|
||||
|
Loading…
x
Reference in New Issue
Block a user