diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.searchtx.spec.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.searchtx.spec.ts index 506ddd44..18a8211d 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.searchtx.spec.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.searchtx.spec.ts @@ -79,8 +79,8 @@ async function sendTokens( }, ]; const gasLimit = 200000; - const feeGranter = ""; - const feePayer = ""; + const feeGranter = undefined; + const feePayer = undefined; const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], feeAmount, gasLimit, feeGranter, feePayer); const chainId = await client.getChainId(); diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts index ecc25adf..25fec479 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts @@ -203,8 +203,8 @@ describe("CosmWasmClient", () => { }; const txBodyBytes = registry.encode(txBody); const gasLimit = Int53.fromString(fee.gas).toNumber(); - const feeGranter = ""; - const feePayer = ""; + const feeGranter = undefined; + const feePayer = undefined; const authInfoBytes = makeAuthInfoBytes( [{ pubkey, sequence }], fee.amount, diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts index 5c8eac4a..9fe64565 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts @@ -582,14 +582,12 @@ export class SigningCosmWasmClient extends CosmWasmClient { const signedTxBodyBytes = this.registry.encode(signedTxBody); const signedGasLimit = Int53.fromString(signed.fee.gas).toNumber(); const signedSequence = Int53.fromString(signed.sequence).toNumber(); - const signedFeeGranter = signed.fee.granter == undefined ? "" : signed.fee.granter; - const signedFeePayer = signed.fee.payer == undefined ? "" : signed.fee.payer; const signedAuthInfoBytes = makeAuthInfoBytes( [{ pubkey, sequence: signedSequence }], signed.fee.amount, signedGasLimit, - signedFeeGranter, - signedFeePayer, + signed.fee.granter, + signed.fee.payer, signMode, ); return TxRaw.fromPartial({ @@ -623,14 +621,12 @@ export class SigningCosmWasmClient extends CosmWasmClient { }; const txBodyBytes = this.registry.encode(txBody); const gasLimit = Int53.fromString(fee.gas).toNumber(); - const feePayer = fee.payer == undefined ? "" : fee.payer; - const feeGranter = fee.granter == undefined ? "" : fee.granter; const authInfoBytes = makeAuthInfoBytes( [{ pubkey, sequence }], fee.amount, gasLimit, - feeGranter, - feePayer, + fee.granter, + fee.payer, ); const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber); const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc); diff --git a/packages/cosmwasm-stargate/src/testutils.spec.ts b/packages/cosmwasm-stargate/src/testutils.spec.ts index b2e4a4e4..e40b8b5b 100644 --- a/packages/cosmwasm-stargate/src/testutils.spec.ts +++ b/packages/cosmwasm-stargate/src/testutils.spec.ts @@ -225,8 +225,8 @@ export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet { })); const modifiedFeeAmount = coins(3000, "ucosm"); const modifiedGasLimit = 333333; - const modifiedFeeGranter = ""; - const modifiedFeePayer = ""; + const modifiedFeeGranter = undefined; + const modifiedFeePayer = undefined; const modifiedSignDoc = { ...signDoc, bodyBytes: Uint8Array.from(TxBody.encode(modifiedTxBody).finish()), diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index b1ebf67f..23641688 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -362,14 +362,12 @@ export class SigningStargateClient extends StargateClient { const signedTxBodyBytes = this.registry.encode(signedTxBodyEncodeObject); const signedGasLimit = Int53.fromString(signed.fee.gas).toNumber(); const signedSequence = Int53.fromString(signed.sequence).toNumber(); - const signedFeeGranter = signed.fee.granter == undefined ? "" : signed.fee.granter; - const signedFeePayer = signed.fee.payer == undefined ? "" : signed.fee.payer; const signedAuthInfoBytes = makeAuthInfoBytes( [{ pubkey, sequence: signedSequence }], signed.fee.amount, signedGasLimit, - signedFeeGranter, - signedFeePayer, + signed.fee.granter, + signed.fee.payer, signMode, ); return TxRaw.fromPartial({ @@ -403,14 +401,12 @@ export class SigningStargateClient extends StargateClient { }; const txBodyBytes = this.registry.encode(txBodyEncodeObject); const gasLimit = Int53.fromString(fee.gas).toNumber(); - const feeGranter = fee.granter == undefined ? "" : fee.granter; - const feePayer = fee.payer == undefined ? "" : fee.payer; const authInfoBytes = makeAuthInfoBytes( [{ pubkey, sequence }], fee.amount, gasLimit, - feeGranter, - feePayer, + fee.granter, + fee.payer, ); const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber); const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc); diff --git a/packages/stargate/src/stargateclient.searchtx.spec.ts b/packages/stargate/src/stargateclient.searchtx.spec.ts index a4c8bd64..01d0e27a 100644 --- a/packages/stargate/src/stargateclient.searchtx.spec.ts +++ b/packages/stargate/src/stargateclient.searchtx.spec.ts @@ -74,8 +74,8 @@ async function sendTokens( }, ]; const gasLimit = 200000; - const feeGranter = ""; - const feePayer = ""; + const feeGranter = undefined; + const feePayer = undefined; const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], feeAmount, gasLimit, feeGranter, feePayer); const chainId = await client.getChainId(); diff --git a/packages/stargate/src/stargateclient.spec.ts b/packages/stargate/src/stargateclient.spec.ts index 7227927a..df4823e8 100644 --- a/packages/stargate/src/stargateclient.spec.ts +++ b/packages/stargate/src/stargateclient.spec.ts @@ -364,8 +364,8 @@ describe("StargateClient", () => { const { accountNumber, sequence } = (await client.getSequence(address))!; const feeAmount = coins(2000, "ucosm"); const gasLimit = 200000; - const feeGranter = ""; - const feePayer = ""; + const feeGranter = undefined; + const feePayer = undefined; const authInfoBytes = makeAuthInfoBytes( [{ pubkey, sequence }], feeAmount, @@ -429,8 +429,8 @@ describe("StargateClient", () => { const { accountNumber, sequence } = (await client.getSequence(address))!; const feeAmount = coins(2000, "ucosm"); const gasLimit = 200000; - const feeGranter = ""; - const feePayer = ""; + const feeGranter = undefined; + const feePayer = undefined; const authInfoBytes = makeAuthInfoBytes( [{ pubkey, sequence }], feeAmount, diff --git a/packages/stargate/src/testutils.spec.ts b/packages/stargate/src/testutils.spec.ts index 50710267..fb59b743 100644 --- a/packages/stargate/src/testutils.spec.ts +++ b/packages/stargate/src/testutils.spec.ts @@ -234,8 +234,8 @@ export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet { })); const modifiedFeeAmount = coins(3000, "ucosm"); const modifiedGasLimit = 333333; - const modifiedFeeGranter = ""; - const modifiedFeePayer = ""; + const modifiedFeeGranter = undefined; + const modifiedFeePayer = undefined; const modifiedSignDoc = { ...signDoc, bodyBytes: Uint8Array.from(TxBody.encode(modifiedTxBody).finish()),