File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package tx
33import (
44 "context"
55 "fmt"
6+ "math"
67 "strconv"
78
89 "github.com/LumeraProtocol/supernode/v2/pkg/logtrace"
@@ -225,14 +226,14 @@ func (m *module) CalculateFee(gasAmount uint64, config *TxConfig) string {
225226 denom = DefaultFeeDenom
226227 }
227228
228- feeAmount := gasPriceF * float64 (gasAmount )
229+ // Calculate fee and always round up to meet chain minimums
230+ feeFloat := gasPriceF * float64 (gasAmount )
231+ feeInt := uint64 (math .Ceil (feeFloat ))
229232
230233 // Ensure we have at least 1 unit of fee to meet minimal requirements
231- if feeAmount < 1 {
232- feeAmount = 1
233- }
234+ feeInt = max (feeInt , 1 )
234235
235- return fmt .Sprintf ("%.0f %s" , feeAmount , denom )
236+ return fmt .Sprintf ("%d %s" , feeInt , denom )
236237}
237238
238239// ProcessTransaction handles the complete flow: simulate, build, sign, and broadcast
You can’t perform that action at this time.
0 commit comments