From 9ff5725bf2c941f538c0e5ef50ea16ca3794d1ce Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 28 Feb 2024 19:01:35 +0100 Subject: [PATCH] Deprecate logs fields but set them as before --- .../cosmwasm-stargate/src/signingcosmwasmclient.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts index 40b7faf6dc..2e0bdf2b76 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts @@ -73,6 +73,7 @@ export interface UploadResult { readonly compressedSize: number; /** The ID of the code asigned by the chain */ readonly codeId: number; + /** @deprecated Not filled in Cosmos SDK >= 0.50. Use events instead. */ readonly logs: readonly logs.Log[]; /** Block height in which the transaction is included */ readonly height: number; @@ -107,6 +108,7 @@ export interface InstantiateOptions { export interface InstantiateResult { /** The address of the newly instantiated contract */ readonly contractAddress: string; + /** @deprecated Not filled in Cosmos SDK >= 0.50. Use events instead. */ readonly logs: readonly logs.Log[]; /** Block height in which the transaction is included */ readonly height: number; @@ -121,6 +123,7 @@ export interface InstantiateResult { * Result type of updateAdmin and clearAdmin */ export interface ChangeAdminResult { + /** @deprecated Not filled in Cosmos SDK >= 0.50. Use events instead. */ readonly logs: readonly logs.Log[]; /** Block height in which the transaction is included */ readonly height: number; @@ -132,6 +135,7 @@ export interface ChangeAdminResult { } export interface MigrateResult { + /** @deprecated Not filled in Cosmos SDK >= 0.50. Use events instead. */ readonly logs: readonly logs.Log[]; /** Block height in which the transaction is included */ readonly height: number; @@ -149,6 +153,7 @@ export interface ExecuteInstruction { } export interface ExecuteResult { + /** @deprecated Not filled in Cosmos SDK >= 0.50. Use events instead. */ readonly logs: readonly logs.Log[]; /** Block height in which the transaction is included */ readonly height: number; @@ -313,7 +318,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { originalSize: wasmCode.length, compressedSize: compressed.length, codeId: Number.parseInt(codeIdAttr.value, 10), - logs: [], + logs: logs.parseRawLog(result.rawLog), height: result.height, transactionHash: result.transactionHash, events: result.events, @@ -348,7 +353,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { const contractAddressAttr = findAttribute(result.events, "instantiate", "_contract_address"); return { contractAddress: contractAddressAttr.value, - logs: [], + logs: logs.parseRawLog(result.rawLog), height: result.height, transactionHash: result.transactionHash, events: result.events, @@ -386,7 +391,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { const contractAddressAttr = findAttribute(result.events, "instantiate", "_contract_address"); return { contractAddress: contractAddressAttr.value, - logs: [], + logs: logs.parseRawLog(result.rawLog), height: result.height, transactionHash: result.transactionHash, events: result.events,