mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Use string gas price in simple calculateFee cases
This commit is contained in:
parent
1bc770327d
commit
fca794e92e
@ -16,7 +16,6 @@ import {
|
||||
import {
|
||||
assertIsBroadcastTxSuccess as assertIsBroadcastTxSuccessStargate,
|
||||
calculateFee,
|
||||
GasPrice,
|
||||
SigningStargateClient,
|
||||
} from "@cosmjs/stargate";
|
||||
import { sleep } from "@cosmjs/utils";
|
||||
@ -54,7 +53,7 @@ async function createTransport(): Promise<Transport> {
|
||||
|
||||
describe("LedgerSigner", () => {
|
||||
const defaultChainId = "testing";
|
||||
const defaultFee = calculateFee(80_000, GasPrice.fromString("0.025ucosm"));
|
||||
const defaultFee = calculateFee(80_000, "0.025ucosm");
|
||||
const defaultMemo = "Some memo";
|
||||
const defaultSequence = "0";
|
||||
const defaultAccountNumber = "42";
|
||||
|
@ -48,7 +48,8 @@ export function fromOneElementArray<T>(elements: ArrayLike<T>): T {
|
||||
return elements[0];
|
||||
}
|
||||
|
||||
export const defaultSendFee = calculateFee(80_000, GasPrice.fromString("0.025ucosm"));
|
||||
export const defaultGasPrice = GasPrice.fromString("0.025ucosm");
|
||||
export const defaultSendFee = calculateFee(80_000, defaultGasPrice);
|
||||
|
||||
export const simapp = {
|
||||
tendermintUrl: "localhost:26658",
|
||||
|
@ -25,7 +25,7 @@ async function main() {
|
||||
const client = await SigningStargateClient.connectWithSigner(rpcUrl, wallet, { prefix: prefix });
|
||||
const recipient = Bech32.encode(prefix, Random.getBytes(20));
|
||||
const amount = coins(226644, "ucosm");
|
||||
const fee = calculateFee(80_000, GasPrice.fromString("0.025ucosm"));
|
||||
const fee = calculateFee(80_000, "0.025ucosm");
|
||||
const memo = "Ensure chain has my pubkey";
|
||||
const sendResult = await client.sendTokens(faucet.address0, recipient, amount, fee, memo);
|
||||
assertIsBroadcastTxSuccess(sendResult);
|
||||
|
Loading…
x
Reference in New Issue
Block a user