core: Added EVM configuration options

The EVM is now initialised with an additional configured object that
allows you to turn on debugging options.
This commit is contained in:
Jeffrey Wilcke
2016-02-03 23:46:27 +01:00
committed by Jeffrey Wilcke
parent 342ae7ce7d
commit 14013372ae
30 changed files with 408 additions and 230 deletions

View File

@ -137,6 +137,7 @@ func (self *StateTransition) from() (vm.Account, error) {
}
return self.state.GetAccount(f), nil
}
func (self *StateTransition) to() vm.Account {
if self.msg == nil {
return nil
@ -193,7 +194,6 @@ func (self *StateTransition) preCheck() (err error) {
}
// Make sure this transaction's nonce is correct
//if sender.Nonce() != msg.Nonce() {
if n := self.state.GetNonce(sender.Address()); n != msg.Nonce() {
return NonceError(msg.Nonce(), n)
}
@ -253,10 +253,6 @@ func (self *StateTransition) transitionDb() (ret []byte, usedGas *big.Int, err e
err = nil
}
if vm.Debug {
vm.StdErrFormat(vmenv.StructLogs())
}
self.refundGas()
self.state.AddBalance(self.env.Coinbase(), new(big.Int).Mul(self.gasUsed(), self.gasPrice))