diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-01 16:53:32 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-01 16:53:32 +0800 |
commit | 0a554a1f27ece4235d180373643482ceb57d90ca (patch) | |
tree | 6ab7d4cd70f7c49f64822d8e626f422158c70e78 /core/state_transition.go | |
parent | d3e86f9208d775ee8020d5583d0aac8f3cfb52b2 (diff) | |
download | dexon-0a554a1f27ece4235d180373643482ceb57d90ca.tar dexon-0a554a1f27ece4235d180373643482ceb57d90ca.tar.gz dexon-0a554a1f27ece4235d180373643482ceb57d90ca.tar.bz2 dexon-0a554a1f27ece4235d180373643482ceb57d90ca.tar.lz dexon-0a554a1f27ece4235d180373643482ceb57d90ca.tar.xz dexon-0a554a1f27ece4235d180373643482ceb57d90ca.tar.zst dexon-0a554a1f27ece4235d180373643482ceb57d90ca.zip |
Blocktest fixed, Execution fixed
* Added new CreateAccount method which properly overwrites previous
accounts (excluding balance)
* Fixed block tests (100% success)
Diffstat (limited to 'core/state_transition.go')
-rw-r--r-- | core/state_transition.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/state_transition.go b/core/state_transition.go index 10a49f829..7616686db 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -183,15 +183,16 @@ func (self *StateTransition) transitionState() (ret []byte, usedGas *big.Int, er } // Pay data gas - var dgas int64 + dgas := new(big.Int) for _, byt := range self.data { if byt != 0 { - dgas += vm.GasTxDataNonzeroByte.Int64() + dgas.Add(dgas, vm.GasTxDataNonzeroByte) } else { - dgas += vm.GasTxDataZeroByte.Int64() + dgas.Add(dgas, vm.GasTxDataZeroByte) } } - if err = self.UseGas(big.NewInt(dgas)); err != nil { + + if err = self.UseGas(dgas); err != nil { return nil, nil, InvalidTxError(err) } |