Reduce SigningCosmWasmClient.upload multiplier to 1.1

This commit is contained in:
Simon Warta
2023-08-21 09:37:10 +02:00
parent 5bb01b8a68
commit 9a57785ead
2 changed files with 9 additions and 1 deletions
@@ -297,7 +297,11 @@ export class SigningCosmWasmClient extends CosmWasmClient {
}),
};
const result = await this.signAndBroadcast(senderAddress, [storeCodeMsg], fee, memo);
// When uploading a contract, the simulation is only 1-2% away from the actual gas usage.
// So we have a smaller default gas multiplier than signAndBroadcast.
const usedFee = fee == "auto" ? 1.1 : fee;
const result = await this.signAndBroadcast(senderAddress, [storeCodeMsg], usedFee, memo);
if (isDeliverTxFailure(result)) {
throw new Error(createDeliverTxResponseErrorMessage(result));
}