Skip to content

Commit

Permalink
add logs when getting and putting storage (ethereum#110)
Browse files Browse the repository at this point in the history
* add logs when getting and putting storage

* fix log
  • Loading branch information
K-Ho authored Nov 29, 2020
1 parent 819b407 commit 7bbdd71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/vm/ovm_state_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"reflect"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)

type stateManagerFunction func(*EVM, *Contract, map[string]interface{}) ([]interface{}, error)
Expand Down Expand Up @@ -111,6 +112,7 @@ 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())
return []interface{}{val}, nil
}

Expand All @@ -130,6 +132,7 @@ func putContractStorage(evm *EVM, contract *Contract, args map[string]interface{
}
val := toHash(_value)
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

0 comments on commit 7bbdd71

Please sign in to comment.