Blocktest fixed, Execution fixed

* Added new CreateAccount method which properly overwrites previous
  accounts (excluding balance)
* Fixed block tests (100% success)
This commit is contained in:
obscuren
2015-04-01 10:53:32 +02:00
parent d3e86f9208
commit 0a554a1f27
8 changed files with 77 additions and 43 deletions

View File

@ -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)
}