mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
lint fix
This commit is contained in:
parent
45ee5fe15a
commit
4e7490ee5f
@ -203,7 +203,7 @@ describe("CosmWasmClient", () => {
|
|||||||
};
|
};
|
||||||
const txBodyBytes = registry.encode(txBody);
|
const txBodyBytes = registry.encode(txBody);
|
||||||
const gasLimit = Int53.fromString(fee.gas).toNumber();
|
const gasLimit = Int53.fromString(fee.gas).toNumber();
|
||||||
const feePayer = ""
|
const feePayer = "";
|
||||||
const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit, feePayer);
|
const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit, feePayer);
|
||||||
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
||||||
const { signed, signature } = await wallet.signDirect(alice.address0, signDoc);
|
const { signed, signature } = await wallet.signDirect(alice.address0, signDoc);
|
||||||
|
@ -582,7 +582,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
|||||||
const signedTxBodyBytes = this.registry.encode(signedTxBody);
|
const signedTxBodyBytes = this.registry.encode(signedTxBody);
|
||||||
const signedGasLimit = Int53.fromString(signed.fee.gas).toNumber();
|
const signedGasLimit = Int53.fromString(signed.fee.gas).toNumber();
|
||||||
const signedSequence = Int53.fromString(signed.sequence).toNumber();
|
const signedSequence = Int53.fromString(signed.sequence).toNumber();
|
||||||
const signedFeePayer = ""
|
const signedFeePayer = "";
|
||||||
const signedAuthInfoBytes = makeAuthInfoBytes(
|
const signedAuthInfoBytes = makeAuthInfoBytes(
|
||||||
[{ pubkey, sequence: signedSequence }],
|
[{ pubkey, sequence: signedSequence }],
|
||||||
signed.fee.amount,
|
signed.fee.amount,
|
||||||
@ -621,7 +621,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
|||||||
};
|
};
|
||||||
const txBodyBytes = this.registry.encode(txBody);
|
const txBodyBytes = this.registry.encode(txBody);
|
||||||
const gasLimit = Int53.fromString(fee.gas).toNumber();
|
const gasLimit = Int53.fromString(fee.gas).toNumber();
|
||||||
const feePayer = fee.granter == undefined ? "" : fee.granter
|
const feePayer = fee.granter == undefined ? "" : fee.granter;
|
||||||
const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit, feePayer);
|
const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit, feePayer);
|
||||||
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
||||||
const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc);
|
const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc);
|
||||||
|
@ -261,7 +261,7 @@ describe("DirectSecp256k1HdWallet", () => {
|
|||||||
};
|
};
|
||||||
const fee = coins(2000, "ucosm");
|
const fee = coins(2000, "ucosm");
|
||||||
const gasLimit = 200000;
|
const gasLimit = 200000;
|
||||||
const feePayer = ""
|
const feePayer = "";
|
||||||
const chainId = "simd-testing";
|
const chainId = "simd-testing";
|
||||||
const signDoc = makeSignDoc(
|
const signDoc = makeSignDoc(
|
||||||
fromHex(bodyBytes),
|
fromHex(bodyBytes),
|
||||||
|
@ -42,8 +42,8 @@ export function makeAuthInfoBytes(
|
|||||||
fee: {
|
fee: {
|
||||||
amount: [...feeAmount],
|
amount: [...feeAmount],
|
||||||
gasLimit: Long.fromNumber(gasLimit),
|
gasLimit: Long.fromNumber(gasLimit),
|
||||||
granter: feePayer
|
granter: feePayer,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
return AuthInfo.encode(AuthInfo.fromPartial(authInfo)).finish();
|
return AuthInfo.encode(AuthInfo.fromPartial(authInfo)).finish();
|
||||||
}
|
}
|
||||||
|
@ -362,7 +362,7 @@ export class SigningStargateClient extends StargateClient {
|
|||||||
const signedTxBodyBytes = this.registry.encode(signedTxBodyEncodeObject);
|
const signedTxBodyBytes = this.registry.encode(signedTxBodyEncodeObject);
|
||||||
const signedGasLimit = Int53.fromString(signed.fee.gas).toNumber();
|
const signedGasLimit = Int53.fromString(signed.fee.gas).toNumber();
|
||||||
const signedSequence = Int53.fromString(signed.sequence).toNumber();
|
const signedSequence = Int53.fromString(signed.sequence).toNumber();
|
||||||
const signedFeePayer = signed.fee.granter == undefined ? "" : signed.fee.granter
|
const signedFeePayer = signed.fee.granter == undefined ? "" : signed.fee.granter;
|
||||||
const signedAuthInfoBytes = makeAuthInfoBytes(
|
const signedAuthInfoBytes = makeAuthInfoBytes(
|
||||||
[{ pubkey, sequence: signedSequence }],
|
[{ pubkey, sequence: signedSequence }],
|
||||||
signed.fee.amount,
|
signed.fee.amount,
|
||||||
@ -401,7 +401,7 @@ export class SigningStargateClient extends StargateClient {
|
|||||||
};
|
};
|
||||||
const txBodyBytes = this.registry.encode(txBodyEncodeObject);
|
const txBodyBytes = this.registry.encode(txBodyEncodeObject);
|
||||||
const gasLimit = Int53.fromString(fee.gas).toNumber();
|
const gasLimit = Int53.fromString(fee.gas).toNumber();
|
||||||
const feePayer = fee.granter == undefined ? "" : fee.granter
|
const feePayer = fee.granter == undefined ? "" : fee.granter;
|
||||||
const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit, feePayer);
|
const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit, feePayer);
|
||||||
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
||||||
const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc);
|
const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc);
|
||||||
|
@ -423,7 +423,13 @@ describe("StargateClient", () => {
|
|||||||
const feeAmount = coins(2000, "ucosm");
|
const feeAmount = coins(2000, "ucosm");
|
||||||
const gasLimit = 200000;
|
const gasLimit = 200000;
|
||||||
const feePayer = "";
|
const feePayer = "";
|
||||||
const authInfoBytes = makeAuthInfoBytes([{ pubkey, sequence }], feeAmount, gasLimit, feePayer, sequence);
|
const authInfoBytes = makeAuthInfoBytes(
|
||||||
|
[{ pubkey, sequence }],
|
||||||
|
feeAmount,
|
||||||
|
gasLimit,
|
||||||
|
feePayer,
|
||||||
|
sequence,
|
||||||
|
);
|
||||||
|
|
||||||
const chainId = await client.getChainId();
|
const chainId = await client.getChainId();
|
||||||
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
||||||
@ -487,7 +493,12 @@ describe("StargateClient", () => {
|
|||||||
const feePayer = "";
|
const feePayer = "";
|
||||||
|
|
||||||
const { accountNumber: accountNumber1, sequence: sequence1 } = (await client.getSequence(address))!;
|
const { accountNumber: accountNumber1, sequence: sequence1 } = (await client.getSequence(address))!;
|
||||||
const authInfoBytes1 = makeAuthInfoBytes([{ pubkey, sequence: sequence1 }], feeAmount, gasLimit, feePayer);
|
const authInfoBytes1 = makeAuthInfoBytes(
|
||||||
|
[{ pubkey, sequence: sequence1 }],
|
||||||
|
feeAmount,
|
||||||
|
gasLimit,
|
||||||
|
feePayer,
|
||||||
|
);
|
||||||
const signDoc1 = makeSignDoc(txBodyBytes, authInfoBytes1, chainId, accountNumber1);
|
const signDoc1 = makeSignDoc(txBodyBytes, authInfoBytes1, chainId, accountNumber1);
|
||||||
const { signature: signature1 } = await wallet.signDirect(address, signDoc1);
|
const { signature: signature1 } = await wallet.signDirect(address, signDoc1);
|
||||||
const txRaw1 = TxRaw.fromPartial({
|
const txRaw1 = TxRaw.fromPartial({
|
||||||
@ -501,7 +512,12 @@ describe("StargateClient", () => {
|
|||||||
assertIsDeliverTxSuccess(txResult);
|
assertIsDeliverTxSuccess(txResult);
|
||||||
|
|
||||||
const { accountNumber: accountNumber2, sequence: sequence2 } = (await client.getSequence(address))!;
|
const { accountNumber: accountNumber2, sequence: sequence2 } = (await client.getSequence(address))!;
|
||||||
const authInfoBytes2 = makeAuthInfoBytes([{ pubkey, sequence: sequence2 }], feeAmount, gasLimit, feePayer);
|
const authInfoBytes2 = makeAuthInfoBytes(
|
||||||
|
[{ pubkey, sequence: sequence2 }],
|
||||||
|
feeAmount,
|
||||||
|
gasLimit,
|
||||||
|
feePayer,
|
||||||
|
);
|
||||||
const signDoc2 = makeSignDoc(txBodyBytes, authInfoBytes2, chainId, accountNumber2);
|
const signDoc2 = makeSignDoc(txBodyBytes, authInfoBytes2, chainId, accountNumber2);
|
||||||
const { signature: signature2 } = await wallet.signDirect(address, signDoc2);
|
const { signature: signature2 } = await wallet.signDirect(address, signDoc2);
|
||||||
const txRaw2 = TxRaw.fromPartial({
|
const txRaw2 = TxRaw.fromPartial({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user