Skip to content

Commit

Permalink
logs: don't log for ethcall (ethereum#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes authored Mar 4, 2021
1 parent 25552f7 commit 99fa66c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/vm/ovm_state_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ func getContractStorage(evm *EVM, contract *Contract, args map[string]interface{
}
key := toHash(_key)
val := evm.StateDB.GetState(address, key)
log.Debug("Got contract storage", "address", address.Hex(), "key", key.Hex(), "val", val.Hex())
if evm.Context.EthCallSender == nil {
log.Debug("Got contract storage", "address", address.Hex(), "key", key.Hex(), "val", val.Hex())
}
return []interface{}{val}, nil
}

Expand Down Expand Up @@ -146,12 +148,11 @@ func putContractStorage(evm *EVM, contract *Contract, args map[string]interface{
if err != nil {
log.Error("Cannot set diff key", "err", err)
}
log.Debug("Put contract storage", "address", address.Hex(), "key", key.Hex(), "val", val.Hex())
} else {
// otherwise just do the db update
evm.StateDB.SetState(address, key, val)
}

log.Debug("Put contract storage", "address", address.Hex(), "key", key.Hex(), "val", val.Hex())
return []interface{}{}, nil
}

Expand Down Expand Up @@ -204,9 +205,9 @@ func testAndSetContractStorage(evm *EVM, contract *Contract, args map[string]int
if err != nil {
log.Error("Cannot set diff key", "err", err)
}
log.Debug("Test and Set Contract Storage", "address", address.Hex(), "key", key.Hex(), "changed", changed)
}

log.Debug("Test and Set Contract Storage", "address", address.Hex(), "key", key.Hex(), "changed", changed)
return []interface{}{true}, nil
}

Expand Down

0 comments on commit 99fa66c

Please sign in to comment.