faucet: Update for removed default fees

This commit is contained in:
willclarktech 2021-06-15 15:15:53 +02:00
parent c2384cc0ce
commit c06dd0c0ce
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
2 changed files with 4 additions and 5 deletions

View File

@ -5,6 +5,7 @@ import {
} from "@cosmjs/launchpad";
import {
assertIsBroadcastTxSuccess as assertIsBroadcastTxSuccessStargate,
calculateFee,
SigningStargateClient,
StargateClient,
} from "@cosmjs/stargate";
@ -88,7 +89,8 @@ export class Faucet {
const result = await client.sendTokens(job.recipient, [job.amount], constants.memo);
return assertIsBroadcastTxSuccessLaunchpad(result);
}
const result = await client.sendTokens(job.sender, job.recipient, [job.amount], constants.memo);
const fee = calculateFee(constants.gasLimits.send, constants.gasPrice);
const result = await client.sendTokens(job.sender, job.recipient, [job.amount], fee, constants.memo);
assertIsBroadcastTxSuccessStargate(result);
}

View File

@ -43,10 +43,7 @@ export async function createClients(
> => [
senderAddress,
isOfflineDirectSigner(wallet)
? await SigningStargateClient.connectWithSigner(apiUrl, wallet, {
gasLimits: constants.gasLimits,
gasPrice: constants.gasPrice,
})
? await SigningStargateClient.connectWithSigner(apiUrl, wallet)
: new SigningCosmosClient(apiUrl, senderAddress, wallet, constants.gasPrice, constants.gasLimits),
],
),