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:
Austin Abell
2019-11-12 16:07:34 -05:00
committed by GitHub
parent 1f51b73d71
commit 327abc4edf
3 changed files with 20 additions and 7 deletions
+3 -2
View File
@@ -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
View File
@@ -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.