diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-18 19:48:42 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-18 19:48:42 +0800 |
commit | f911087eab6b31fcdbc22a9a74c0be410e8f0177 (patch) | |
tree | 3055f5891eb77117ad2574825d40cece20867f91 /ethchain/state_transition.go | |
parent | c4af1340fac12397b6cc5c9f32a1bea4aa6400f5 (diff) | |
download | dexon-f911087eab6b31fcdbc22a9a74c0be410e8f0177.tar.gz dexon-f911087eab6b31fcdbc22a9a74c0be410e8f0177.tar.zst dexon-f911087eab6b31fcdbc22a9a74c0be410e8f0177.zip |
Logging
Diffstat (limited to 'ethchain/state_transition.go')
-rw-r--r-- | ethchain/state_transition.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ethchain/state_transition.go b/ethchain/state_transition.go index c70dc54b4..8a6565e56 100644 --- a/ethchain/state_transition.go +++ b/ethchain/state_transition.go @@ -89,7 +89,7 @@ func (self *StateTransition) BuyGas() error { sender := self.Sender() if sender.Amount.Cmp(self.tx.GasValue()) < 0 { - return fmt.Errorf("Insufficient funds to pre-pay gas. Req %v, has %v", self.tx.GasValue(), self.tx.Value) + return fmt.Errorf("Insufficient funds to pre-pay gas. Req %v, has %v", self.tx.GasValue(), sender.Amount) } coinbase := self.Coinbase() @@ -181,7 +181,8 @@ func (self *StateTransition) TransitionState() (err error) { // Evaluate the initialization script // and use the return value as the // script section for the state object. - //script, gas, err = sm.Eval(state, contract.Init(), contract, tx, block) + ethutil.Config.Log.Println(ethutil.LogLevelSystem, receiver.Init()) + code, err := self.Eval(receiver.Init(), receiver) if err != nil { return fmt.Errorf("Error during init script run %v", err) @@ -190,7 +191,8 @@ func (self *StateTransition) TransitionState() (err error) { receiver.script = code } else { if len(receiver.Script()) > 0 { - fmt.Println(receiver.Script()) + ethutil.Config.Log.Println(ethutil.LogLevelSystem, receiver.Script()) + _, err := self.Eval(receiver.Script(), receiver) if err != nil { return fmt.Errorf("Error during code execution %v", err) |