Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Revert stray changes that were used in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Dec 13, 2021
1 parent 6631ebb commit e98d76f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
33 changes: 0 additions & 33 deletions x/evm/keeper/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,36 +180,3 @@ func BenchmarkDeepContextStack10(b *testing.B) {
func BenchmarkDeepContextStack13(b *testing.B) {
DoBenchmarkDeepContextStack(b, 13)
}

func before() *big.Int {
b2 := new(big.Int).SetUint64(2)
return new(big.Int).Mul(b2, new(big.Int).SetUint64(34))
}

func after() *big.Int {
b2 := new(big.Int).SetUint64(2)
return b2
return b2.Mul(b2, new(big.Int).SetUint64(34))
}

var sink interface{}

func BenchmarkMulBefore(b *testing.B) {
for i := 0; i < b.N; i++ {
sink = before()
}
if sink == nil {
b.Fatal("Benchmark did not run")
}
sink = (interface{})(nil)
}

func BenchmarkMulAfter(b *testing.B) {
for i := 0; i < b.N; i++ {
sink = after()
}
if sink == nil {
b.Fatal("Benchmark did not run")
}
sink = (interface{})(nil)
}
5 changes: 1 addition & 4 deletions x/evm/keeper/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,15 +623,12 @@ func (k *Keeper) Empty(addr common.Address) bool {

codeHash = common.HexToHash(ethAccount.CodeHash).Bytes()
}
if nonce == 0 {
return false
}

balance := k.GetBalance(addr)
hasZeroBalance := balance.Sign() == 0
hasEmptyCodeHash := bytes.Equal(codeHash, types.EmptyCodeHash)

return hasZeroBalance && hasEmptyCodeHash
return hasZeroBalance && nonce == 0 && hasEmptyCodeHash
}

// ----------------------------------------------------------------------------
Expand Down

0 comments on commit e98d76f

Please sign in to comment.