diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-04 21:32:10 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-04 21:32:10 +0800 |
commit | 90eb4f1939f7b0389d5784b889cc0e5d2b3451f7 (patch) | |
tree | c812cf882cb5a22ea7ffd4a061be2ac286dcfa58 /ethchain/state_transition.go | |
parent | 23b5b5fa36530eb82543d7d877f8e9e1900232cf (diff) | |
download | go-tangerine-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.tar go-tangerine-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.tar.gz go-tangerine-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.tar.bz2 go-tangerine-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.tar.lz go-tangerine-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.tar.xz go-tangerine-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.tar.zst go-tangerine-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.zip |
Debug output, minor fixes and tweaks
* Script compile length fix
* Transition fix
Diffstat (limited to 'ethchain/state_transition.go')
-rw-r--r-- | ethchain/state_transition.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ethchain/state_transition.go b/ethchain/state_transition.go index 16e1f124b..6ea9a837d 100644 --- a/ethchain/state_transition.go +++ b/ethchain/state_transition.go @@ -201,8 +201,7 @@ func (self *StateTransition) TransitionState() (err error) { // script section for the state object. self.data = nil - statelogger.Debugln("~> init") - code, err := self.Eval(receiver.Init(), receiver) + code, err := self.Eval(receiver.Init(), receiver, "init") if err != nil { //self.state.Set(snapshot) self.state.ResetStateObject(receiver) @@ -213,8 +212,7 @@ func (self *StateTransition) TransitionState() (err error) { receiver.script = code } else { if len(receiver.Script()) > 0 { - statelogger.Debugln("~> code") - _, err = self.Eval(receiver.Script(), receiver) + _, err = self.Eval(receiver.Script(), receiver, "code") if err != nil { //self.state.Set(snapshot) self.state.ResetStateObject(receiver) @@ -240,7 +238,7 @@ func (self *StateTransition) transferValue(sender, receiver *StateObject) error return nil } -func (self *StateTransition) Eval(script []byte, context *StateObject) (ret []byte, err error) { +func (self *StateTransition) Eval(script []byte, context *StateObject, typ string) (ret []byte, err error) { var ( block = self.block initiator = self.Sender() @@ -259,6 +257,7 @@ func (self *StateTransition) Eval(script []byte, context *StateObject) (ret []by Value: self.value, }) vm.Verbose = true + vm.Fn = typ ret, err = Call(vm, closure, self.data) @@ -279,7 +278,7 @@ func Call(vm *Vm, closure *Closure, data []byte) (ret []byte, err error) { // TODO FIXME ASAP context.state.trie = t2 - statelogger.Debugln("Warn: PARANOIA: Different state object roots during copy") + statelogger.Infoln("Warn: PARANOIA: Different state object roots during copy") } } |