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:
@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user