x/evm: fix EndBlock consensus failure (#334)

* add test for sending tx w/ 21000 gas

* improve rpc transfer test

* use ctx in EndBlock

* UpdateAccounts and ClearStateObjects with passed in context

* log ethereum address on error

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
This commit is contained in:
noot
2020-06-22 12:07:35 -04:00
committed by GitHub
co-authored by Federico Kunze Federico Kunze
parent 0921c863e7
commit 28e28f2a7b
5 changed files with 62 additions and 10 deletions
+10
View File
@@ -228,6 +228,16 @@ func (k *Keeper) CreateAccount(ctx sdk.Context, addr ethcmn.Address) {
k.CommitStateDB.WithContext(ctx).CreateAccount(addr)
}
// UpdateAccounts calls CommitStateDB.UpdateAccounts using the passed in context
func (k *Keeper) UpdateAccounts(ctx sdk.Context) {
k.CommitStateDB.WithContext(ctx).UpdateAccounts()
}
// ClearStateObjects calls CommitStateDB.ClearStateObjects using the passed in context
func (k *Keeper) ClearStateObjects(ctx sdk.Context) {
k.CommitStateDB.WithContext(ctx).ClearStateObjects()
}
// Copy calls CommitStateDB.Copy using the passed in context
func (k *Keeper) Copy(ctx sdk.Context) ethvm.StateDB {
return k.CommitStateDB.WithContext(ctx).Copy()