Skip to content

Commit 344aab8

Browse files
committed
make gasCost use int64 instead of float
1 parent 543cb7f commit 344aab8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

x/auth/ante.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const (
1616
ed25519VerifyCost = 59
1717
secp256k1VerifyCost = 100
1818
maxMemoCharacters = 100
19-
gasPrice = 0.001
19+
// how much gas = 1 atom
20+
gasPrice = 1000
2021
)
2122

2223
// NewAnteHandler returns an AnteHandler that checks
@@ -241,7 +242,7 @@ func consumeSignatureVerificationGas(meter sdk.GasMeter, pubkey crypto.PubKey) {
241242
}
242243

243244
func adjustFeesByGas(fees sdk.Coins, gas int64) sdk.Coins {
244-
gasCost := int64(float64(gas) * gasPrice)
245+
gasCost := gas / gasPrice
245246
gasFees := make(sdk.Coins, len(fees))
246247
// TODO: Make this not price all coins in the same way
247248
for i := 0; i < len(fees); i++ {

0 commit comments

Comments
 (0)