aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-17 00:27:05 +0800
committerobscuren <geffobscura@gmail.com>2014-10-17 00:27:05 +0800
commit93fcabd25189b447cc5c52523134cca2fa1d794e (patch)
tree152b24831fbb2d547bc2189b0b92a2b18c8f64b7 /ethchain
parentbb5038699ef7e08054ef154107e359dce2e3b106 (diff)
downloaddexon-93fcabd25189b447cc5c52523134cca2fa1d794e.tar
dexon-93fcabd25189b447cc5c52523134cca2fa1d794e.tar.gz
dexon-93fcabd25189b447cc5c52523134cca2fa1d794e.tar.bz2
dexon-93fcabd25189b447cc5c52523134cca2fa1d794e.tar.lz
dexon-93fcabd25189b447cc5c52523134cca2fa1d794e.tar.xz
dexon-93fcabd25189b447cc5c52523134cca2fa1d794e.tar.zst
dexon-93fcabd25189b447cc5c52523134cca2fa1d794e.zip
Fixed most of the tests
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/state_transition.go8
-rw-r--r--ethchain/vm_env.go1
2 files changed, 2 insertions, 7 deletions
diff --git a/ethchain/state_transition.go b/ethchain/state_transition.go
index 93b991c45..5bb084ae4 100644
--- a/ethchain/state_transition.go
+++ b/ethchain/state_transition.go
@@ -72,12 +72,6 @@ func (self *StateTransition) Receiver() *ethstate.StateObject {
return self.rec
}
-func (self *StateTransition) MakeStateObject(state *ethstate.State, tx *Transaction) *ethstate.StateObject {
- contract := MakeContract(tx, state)
-
- return contract
-}
-
func (self *StateTransition) UseGas(amount *big.Int) error {
if self.gas.Cmp(amount) < 0 {
return OutOfGasError()
@@ -190,7 +184,7 @@ func (self *StateTransition) TransitionState() (err error) {
snapshot = self.state.Copy()
// Create a new state object for the contract
- receiver = self.MakeStateObject(self.state, tx)
+ receiver := MakeContract(tx, self.state)
self.rec = receiver
if receiver == nil {
return fmt.Errorf("Unable to create contract")
diff --git a/ethchain/vm_env.go b/ethchain/vm_env.go
index 30f9497fa..4600878d1 100644
--- a/ethchain/vm_env.go
+++ b/ethchain/vm_env.go
@@ -29,3 +29,4 @@ func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty }
func (self *VMEnv) BlockHash() []byte { return self.block.Hash() }
func (self *VMEnv) Value() *big.Int { return self.tx.Value }
func (self *VMEnv) State() *ethstate.State { return self.state }
+func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit }