From c0ccf9be0cc91123ee11e3c7fb5b33604a363241 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 23 Feb 2021 20:26:55 +0100 Subject: [PATCH 01/10] stargate: Add delegateTokens method to SigningStargateClient --- .../src/signingstargateclient.spec.ts | 38 +++++++++++++++++++ .../stargate/src/signingstargateclient.ts | 16 +++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/packages/stargate/src/signingstargateclient.spec.ts b/packages/stargate/src/signingstargateclient.spec.ts index 5cace77d..c6f0d3b4 100644 --- a/packages/stargate/src/signingstargateclient.spec.ts +++ b/packages/stargate/src/signingstargateclient.spec.ts @@ -40,6 +40,15 @@ describe("SigningStargateClient", () => { ], gas: "80000", }, + delegate: { + amount: [ + { + amount: "4000", + denom: "ucosm", + }, + ], + gas: "160000", + }, }); }); @@ -71,6 +80,15 @@ describe("SigningStargateClient", () => { ], gas: "80000", }, + delegate: { + amount: [ + { + amount: "502400", // 3.14 * 160_000 + denom: "utest", + }, + ], + gas: "160000", + }, }); }); @@ -79,6 +97,7 @@ describe("SigningStargateClient", () => { const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const gasLimits = { send: 160000, + delegate: 120000, }; const options = { gasLimits: gasLimits }; const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet, options); @@ -93,6 +112,15 @@ describe("SigningStargateClient", () => { ], gas: "160000", }, + delegate: { + amount: [ + { + amount: "3000", // 0.025 * 120_000 + denom: "ucosm", + }, + ], + gas: "120000", + }, }); }); @@ -102,6 +130,7 @@ describe("SigningStargateClient", () => { const gasPrice = GasPrice.fromString("3.14utest"); const gasLimits = { send: 160000, + delegate: 160000, }; const options = { gasPrice: gasPrice, gasLimits: gasLimits }; const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet, options); @@ -116,6 +145,15 @@ describe("SigningStargateClient", () => { ], gas: "160000", }, + delegate: { + amount: [ + { + amount: "502400", // 3.14 * 160_000 + denom: "utest", + }, + ], + gas: "160000", + }, }); }); }); diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index 380047fb..13c894d6 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -66,10 +66,11 @@ import { BroadcastTxResponse, StargateClient } from "./stargateclient"; */ export interface CosmosFeeTable extends FeeTable { readonly send: StdFee; + readonly delegate: StdFee; } const defaultGasPrice = GasPrice.fromString("0.025ucosm"); -const defaultGasLimits: GasLimits = { send: 80000 }; +const defaultGasLimits: GasLimits = { send: 80000, delegate: 160000 }; export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], @@ -198,6 +199,19 @@ export class SigningStargateClient extends StargateClient { return this.signAndBroadcast(senderAddress, [sendMsg], this.fees.send, memo); } + public async delegateTokens( + senderAddress: string, + validatorAddress: string, + amount: Coin, + memo = "", + ): Promise { + const delegateMsg = { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.fromPartial({ delegatorAddress: senderAddress, validatorAddress, amount }), + }; + return this.signAndBroadcast(senderAddress, [delegateMsg], this.fees.delegate, memo); + } + public async signAndBroadcast( signerAddress: string, messages: readonly EncodeObject[], From 5032acf4cec0f6b1d5946d75810cf7dcc0613179 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 23 Feb 2021 20:39:45 +0100 Subject: [PATCH 02/10] stargate: Add SigningStargateClient.undelegateTokens/withdrawRewards --- .../src/signingstargateclient.spec.ts | 73 ++++++++++++++++++- .../stargate/src/signingstargateclient.ts | 34 ++++++++- 2 files changed, 105 insertions(+), 2 deletions(-) diff --git a/packages/stargate/src/signingstargateclient.spec.ts b/packages/stargate/src/signingstargateclient.spec.ts index c6f0d3b4..7caaa979 100644 --- a/packages/stargate/src/signingstargateclient.spec.ts +++ b/packages/stargate/src/signingstargateclient.spec.ts @@ -49,6 +49,24 @@ describe("SigningStargateClient", () => { ], gas: "160000", }, + undelegate: { + amount: [ + { + amount: "4000", + denom: "ucosm", + }, + ], + gas: "160000", + }, + withdraw: { + amount: [ + { + amount: "4000", + denom: "ucosm", + }, + ], + gas: "160000", + }, }); }); @@ -89,6 +107,24 @@ describe("SigningStargateClient", () => { ], gas: "160000", }, + undelegate: { + amount: [ + { + amount: "502400", + denom: "utest", + }, + ], + gas: "160000", + }, + withdraw: { + amount: [ + { + amount: "502400", + denom: "utest", + }, + ], + gas: "160000", + }, }); }); @@ -121,6 +157,24 @@ describe("SigningStargateClient", () => { ], gas: "120000", }, + undelegate: { + amount: [ + { + amount: "4000", + denom: "ucosm", + }, + ], + gas: "160000", + }, + withdraw: { + amount: [ + { + amount: "4000", + denom: "ucosm", + }, + ], + gas: "160000", + }, }); }); @@ -130,7 +184,6 @@ describe("SigningStargateClient", () => { const gasPrice = GasPrice.fromString("3.14utest"); const gasLimits = { send: 160000, - delegate: 160000, }; const options = { gasPrice: gasPrice, gasLimits: gasLimits }; const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet, options); @@ -154,6 +207,24 @@ describe("SigningStargateClient", () => { ], gas: "160000", }, + undelegate: { + amount: [ + { + amount: "502400", + denom: "utest", + }, + ], + gas: "160000", + }, + withdraw: { + amount: [ + { + amount: "502400", + denom: "utest", + }, + ], + gas: "160000", + }, }); }); }); diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index 13c894d6..03379dd9 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -67,10 +67,17 @@ import { BroadcastTxResponse, StargateClient } from "./stargateclient"; export interface CosmosFeeTable extends FeeTable { readonly send: StdFee; readonly delegate: StdFee; + readonly undelegate: StdFee; + readonly withdraw: StdFee; } const defaultGasPrice = GasPrice.fromString("0.025ucosm"); -const defaultGasLimits: GasLimits = { send: 80000, delegate: 160000 }; +const defaultGasLimits: GasLimits = { + send: 80000, + delegate: 160000, + undelegate: 160000, + withdraw: 160000, +}; export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], @@ -212,6 +219,31 @@ export class SigningStargateClient extends StargateClient { return this.signAndBroadcast(senderAddress, [delegateMsg], this.fees.delegate, memo); } + public async undelegateTokens( + senderAddress: string, + validatorAddress: string, + amount: Coin, + memo = "", + ): Promise { + const undelegateMsg = { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.fromPartial({ delegatorAddress: senderAddress, validatorAddress, amount }), + }; + return this.signAndBroadcast(senderAddress, [undelegateMsg], this.fees.undelegate, memo); + } + + public async withdrawRewards( + senderAddress: string, + validatorAddress: string, + memo = "", + ): Promise { + const withdrawMsg = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.fromPartial({ delegatorAddress: senderAddress, validatorAddress }), + }; + return this.signAndBroadcast(senderAddress, [withdrawMsg], this.fees.withdraw, memo); + } + public async signAndBroadcast( signerAddress: string, messages: readonly EncodeObject[], From 5c2deafc8c0d1249ef483641d59397c5f3656b10 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 25 Mar 2021 12:38:41 +0100 Subject: [PATCH 03/10] Update CHANGELOG for new SigningStargateClient methods --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9eed7e..50a4928e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,8 @@ and this project adheres to not connect to Tendermint. This allows offline signing. - @cosmjs/stargate: Add `makeMultisignedTx` which allows you to assemble a transaction signed by a multisig account. +- @cosmjs/stargate: Add `delegateTokens`, `undelegateTokens` and + `withdrawRewards` methods to `SigningStargateClient`. ### Changed From d9b0f9e350c46bb2e05f2a01c23a05af4467d4da Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 25 Mar 2021 12:58:02 +0100 Subject: [PATCH 04/10] stargate: Export default gas limits/price --- packages/stargate/src/index.ts | 2 ++ packages/stargate/src/signingstargateclient.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/stargate/src/index.ts b/packages/stargate/src/index.ts index 5d7a42ec..729bdac7 100644 --- a/packages/stargate/src/index.ts +++ b/packages/stargate/src/index.ts @@ -84,6 +84,8 @@ export { } from "./stargateclient"; export { CosmosFeeTable, + defaultGasLimits, + defaultGasPrice, defaultRegistryTypes, SignerData, SigningStargateClient, diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index 03379dd9..ebf40cde 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -71,8 +71,8 @@ export interface CosmosFeeTable extends FeeTable { readonly withdraw: StdFee; } -const defaultGasPrice = GasPrice.fromString("0.025ucosm"); -const defaultGasLimits: GasLimits = { +export const defaultGasPrice = GasPrice.fromString("0.025ucosm"); +export const defaultGasLimits: GasLimits = { send: 80000, delegate: 160000, undelegate: 160000, From ac20c8aed753e71bc92bc940f7226f2fc170374a Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 25 Mar 2021 12:58:57 +0100 Subject: [PATCH 05/10] Update CHANGELOG for stargate default gas exports --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50a4928e..dd222f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to transaction signed by a multisig account. - @cosmjs/stargate: Add `delegateTokens`, `undelegateTokens` and `withdrawRewards` methods to `SigningStargateClient`. +- @cosmjs/stargate: Export `defaultGasLimits` and `defaultGasPrice`. ### Changed From 81793aea31c4988a1e5966310fe670333b3c2b05 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 25 Mar 2021 13:01:07 +0100 Subject: [PATCH 06/10] stargate: Format gas limits --- packages/stargate/src/signingstargateclient.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index ebf40cde..6a05529d 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -73,10 +73,10 @@ export interface CosmosFeeTable extends FeeTable { export const defaultGasPrice = GasPrice.fromString("0.025ucosm"); export const defaultGasLimits: GasLimits = { - send: 80000, - delegate: 160000, - undelegate: 160000, - withdraw: 160000, + send: 80_000, + delegate: 160_000, + undelegate: 160_000, + withdraw: 160_000, }; export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ From ad13e14f3d2f90a14ef1bb852d529f1403e91356 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 25 Mar 2021 13:06:04 +0100 Subject: [PATCH 07/10] cosmwasm-stargate: Update fee table etc to match stargate --- packages/cosmwasm-stargate/src/index.ts | 6 +++++- .../src/signingcosmwasmclient.ts | 20 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/cosmwasm-stargate/src/index.ts b/packages/cosmwasm-stargate/src/index.ts index 523a85c1..ab7e80ac 100644 --- a/packages/cosmwasm-stargate/src/index.ts +++ b/packages/cosmwasm-stargate/src/index.ts @@ -1,3 +1,7 @@ export { cosmWasmTypes } from "./aminotypes"; export { CosmWasmClient } from "./cosmwasmclient"; -export { SigningCosmWasmClient, SigningCosmWasmClientOptions } from "./signingcosmwasmclient"; +export { + defaultGasLimits, + SigningCosmWasmClient, + SigningCosmWasmClientOptions, +} from "./signingcosmwasmclient"; diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts index 5162cf1c..26ea525c 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts @@ -2,7 +2,6 @@ import { encodeSecp256k1Pubkey, makeSignDoc as makeSignDocAmino } from "@cosmjs/amino"; import { ChangeAdminResult, - CosmWasmFeeTable, ExecuteResult, InstantiateOptions, InstantiateResult, @@ -30,6 +29,8 @@ import { buildFeeTable, Coin, CosmosFeeTable, + defaultGasLimits as defaultStargateGasLimits, + defaultGasPrice, defaultRegistryTypes, GasLimits, GasPrice, @@ -54,6 +55,18 @@ import { } from "./codec/x/wasm/internal/types/tx"; import { CosmWasmClient } from "./cosmwasmclient"; +/** + * These fees are used by the higher level methods of SigningCosmWasmClient + */ +export interface CosmWasmFeeTable extends CosmosFeeTable { + readonly upload: StdFee; + readonly init: StdFee; + readonly exec: StdFee; + readonly migrate: StdFee; + /** Paid when setting the contract admin to a new address or unsetting it */ + readonly changeAdmin: StdFee; +} + function prepareBuilder(builder: string | undefined): string { if (builder === undefined) { return ""; // normalization needed by backend @@ -63,13 +76,12 @@ function prepareBuilder(builder: string | undefined): string { } } -const defaultGasPrice = GasPrice.fromString("0.025ucosm"); -const defaultGasLimits: GasLimits = { +export const defaultGasLimits: GasLimits = { + ...defaultStargateGasLimits, upload: 1_500_000, init: 500_000, migrate: 200_000, exec: 200_000, - send: 80_000, changeAdmin: 80_000, }; From e913ed01e55475ad3d80f78ce4d4edd1e59407c9 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 25 Mar 2021 13:06:23 +0100 Subject: [PATCH 08/10] Update CHANGELOG for cosmwasm-stargate default gas limits export --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd222f78..d96c6ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to - @cosmjs/stargate: Add `delegateTokens`, `undelegateTokens` and `withdrawRewards` methods to `SigningStargateClient`. - @cosmjs/stargate: Export `defaultGasLimits` and `defaultGasPrice`. +- @cosmjs/cosmwasm-stargate: Export `defaultGasLimits`. ### Changed From 4d486a6307376abd037f64383f6ac137a7d04ef0 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 25 Mar 2021 13:27:50 +0100 Subject: [PATCH 09/10] stargate: Rename delegatorAddress param in staking methods --- packages/stargate/src/signingstargateclient.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index 6a05529d..b12e65d5 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -207,41 +207,41 @@ export class SigningStargateClient extends StargateClient { } public async delegateTokens( - senderAddress: string, + delegatorAddress: string, validatorAddress: string, amount: Coin, memo = "", ): Promise { const delegateMsg = { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", - value: MsgDelegate.fromPartial({ delegatorAddress: senderAddress, validatorAddress, amount }), + value: MsgDelegate.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress, amount }), }; - return this.signAndBroadcast(senderAddress, [delegateMsg], this.fees.delegate, memo); + return this.signAndBroadcast(delegatorAddress, [delegateMsg], this.fees.delegate, memo); } public async undelegateTokens( - senderAddress: string, + delegatorAddress: string, validatorAddress: string, amount: Coin, memo = "", ): Promise { const undelegateMsg = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", - value: MsgUndelegate.fromPartial({ delegatorAddress: senderAddress, validatorAddress, amount }), + value: MsgUndelegate.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress, amount }), }; - return this.signAndBroadcast(senderAddress, [undelegateMsg], this.fees.undelegate, memo); + return this.signAndBroadcast(delegatorAddress, [undelegateMsg], this.fees.undelegate, memo); } public async withdrawRewards( - senderAddress: string, + delegatorAddress: string, validatorAddress: string, memo = "", ): Promise { const withdrawMsg = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", - value: MsgWithdrawDelegatorReward.fromPartial({ delegatorAddress: senderAddress, validatorAddress }), + value: MsgWithdrawDelegatorReward.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress }), }; - return this.signAndBroadcast(senderAddress, [withdrawMsg], this.fees.withdraw, memo); + return this.signAndBroadcast(delegatorAddress, [withdrawMsg], this.fees.withdraw, memo); } public async signAndBroadcast( From c99dcfc50a356550e7342614f302b9daae201cc1 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 25 Mar 2021 13:44:01 +0100 Subject: [PATCH 10/10] cosmwasm-stargate: Add SigningCosmWasmClient staking methods --- .../src/signingcosmwasmclient.spec.ts | 36 +++++++++++++++++ .../src/signingcosmwasmclient.ts | 40 +++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts index 46ff1524..6cc493a1 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts @@ -91,6 +91,18 @@ describe("SigningCosmWasmClient", () => { amount: coins(251200, "utest"), gas: "80000", }, + delegate: { + amount: coins(502400, "utest"), + gas: "160000", + }, + undelegate: { + amount: coins(502400, "utest"), + gas: "160000", + }, + withdraw: { + amount: coins(502400, "utest"), + gas: "160000", + }, }); }); @@ -130,6 +142,18 @@ describe("SigningCosmWasmClient", () => { amount: coins(2000, "ucosm"), gas: "80000", }, + delegate: { + amount: coins(4000, "ucosm"), + gas: "160000", + }, + undelegate: { + amount: coins(4000, "ucosm"), + gas: "160000", + }, + withdraw: { + amount: coins(4000, "ucosm"), + gas: "160000", + }, }); }); @@ -170,6 +194,18 @@ describe("SigningCosmWasmClient", () => { amount: coins(251200, "utest"), gas: "80000", }, + delegate: { + amount: coins(502400, "utest"), + gas: "160000", + }, + undelegate: { + amount: coins(502400, "utest"), + gas: "160000", + }, + withdraw: { + amount: coins(502400, "utest"), + gas: "160000", + }, }); }); }); diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts index 26ea525c..02b0c765 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts @@ -38,6 +38,8 @@ import { logs, StdFee, } from "@cosmjs/stargate"; +import { MsgWithdrawDelegatorReward } from "@cosmjs/stargate/build/codec/cosmos/distribution/v1beta1/tx"; +import { MsgDelegate, MsgUndelegate } from "@cosmjs/stargate/build/codec/cosmos/staking/v1beta1/tx"; import { SignMode } from "@cosmjs/stargate/build/codec/cosmos/tx/signing/v1beta1/signing"; import { TxRaw } from "@cosmjs/stargate/build/codec/cosmos/tx/v1beta1/tx"; import { Tendermint34Client } from "@cosmjs/tendermint-rpc"; @@ -332,6 +334,44 @@ export class SigningCosmWasmClient extends CosmWasmClient { return this.signAndBroadcast(senderAddress, [sendMsg], this.fees.send, memo); } + public async delegateTokens( + delegatorAddress: string, + validatorAddress: string, + amount: Coin, + memo = "", + ): Promise { + const delegateMsg = { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress, amount }), + }; + return this.signAndBroadcast(delegatorAddress, [delegateMsg], this.fees.delegate, memo); + } + + public async undelegateTokens( + delegatorAddress: string, + validatorAddress: string, + amount: Coin, + memo = "", + ): Promise { + const undelegateMsg = { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress, amount }), + }; + return this.signAndBroadcast(delegatorAddress, [undelegateMsg], this.fees.undelegate, memo); + } + + public async withdrawRewards( + delegatorAddress: string, + validatorAddress: string, + memo = "", + ): Promise { + const withdrawMsg = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress }), + }; + return this.signAndBroadcast(delegatorAddress, [withdrawMsg], this.fees.withdraw, memo); + } + /** * Creates a transaction with the given messages, fee and memo. Then signs and broadcasts the transaction. *