diff --git a/store/types/gas.go b/store/types/gas.go index 730b03941c29..26b7fb6beed2 100644 --- a/store/types/gas.go +++ b/store/types/gas.go @@ -89,9 +89,9 @@ func addUint64Overflow(a, b uint64) (uint64, bool) { func (g *basicGasMeter) ConsumeGas(amount Gas, descriptor string) { var overflow bool - // TODO: Should we set the consumed field after overflow checking? g.consumed, overflow = addUint64Overflow(g.consumed, amount) if overflow { + g.consumed = math.MaxUint64 panic(ErrorGasOverflow{descriptor}) } diff --git a/x/auth/ante/fee.go b/x/auth/ante/fee.go index 5da4dbbaf5d5..4d812f737d13 100644 --- a/x/auth/ante/fee.go +++ b/x/auth/ante/fee.go @@ -77,7 +77,7 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bo } if addr := dfd.ak.GetModuleAddress(types.FeeCollectorName); addr == nil { - panic(fmt.Sprintf("%s module account has not been set", types.FeeCollectorName)) + return ctx, fmt.Errorf("Fee collector module account (%s) has not been set", types.FeeCollectorName) } feePayer := feeTx.FeePayer()