forked from cerc-io/laconicd-deprecated
Coin balance fix (#151)
* Fix setting account balances from assuming single denom * Set order for end blocker to not override account balances * Panic instead of ignoring error (case should never be hit)
This commit is contained in:
+3
-2
@@ -139,10 +139,11 @@ func ethAnteHandler(
|
||||
// Cost calculates the fees paid to validators based on gas limit and price
|
||||
cost := new(big.Int).Mul(ethTxMsg.Data.Price, new(big.Int).SetUint64(ethTxMsg.Data.GasLimit))
|
||||
|
||||
err = auth.DeductFees(sk, ctx, senderAcc, sdk.Coins{
|
||||
feeAmt := sdk.Coins{
|
||||
sdk.NewCoin(emint.DenomDefault, sdk.NewIntFromBigInt(cost)),
|
||||
})
|
||||
}
|
||||
|
||||
err = auth.DeductFees(sk, ctx, senderAcc, feeAmt)
|
||||
if err != nil {
|
||||
return ctx, err
|
||||
}
|
||||
|
||||
+2
-2
@@ -197,9 +197,9 @@ func NewEthermintApp(
|
||||
// During begin block slashing happens after distr.BeginBlocker so that
|
||||
// there is nothing left over in the validator fee pool, so as to keep the
|
||||
// CanWithdrawInvariant invariant.
|
||||
app.mm.SetOrderBeginBlockers(mint.ModuleName, distr.ModuleName, slashing.ModuleName, evmtypes.ModuleName)
|
||||
app.mm.SetOrderBeginBlockers(evmtypes.ModuleName, mint.ModuleName, distr.ModuleName, slashing.ModuleName)
|
||||
|
||||
app.mm.SetOrderEndBlockers(crisis.ModuleName, gov.ModuleName, staking.ModuleName, evmtypes.ModuleName)
|
||||
app.mm.SetOrderEndBlockers(evmtypes.ModuleName, crisis.ModuleName, gov.ModuleName, staking.ModuleName)
|
||||
|
||||
// NOTE: The genutils module must occur after staking so that pools are
|
||||
// properly initialized with tokens from genesis accounts.
|
||||
|
||||
Reference in New Issue
Block a user