aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-19 07:02:55 +0800
committerobscuren <geffobscura@gmail.com>2014-12-19 07:02:55 +0800
commit22d29a6d52ade3ebcd4ecb341e3f5eafddb8e17b (patch)
treea64a8336516fd28de2c019e8c787c90950267331
parent0dc566124aee24cf3f01b4e586bde7752da89824 (diff)
parenta7f4ade7114ee962110cb7c140e7ce7bd3f6664f (diff)
downloadgo-tangerine-22d29a6d52ade3ebcd4ecb341e3f5eafddb8e17b.tar
go-tangerine-22d29a6d52ade3ebcd4ecb341e3f5eafddb8e17b.tar.gz
go-tangerine-22d29a6d52ade3ebcd4ecb341e3f5eafddb8e17b.tar.bz2
go-tangerine-22d29a6d52ade3ebcd4ecb341e3f5eafddb8e17b.tar.lz
go-tangerine-22d29a6d52ade3ebcd4ecb341e3f5eafddb8e17b.tar.xz
go-tangerine-22d29a6d52ade3ebcd4ecb341e3f5eafddb8e17b.tar.zst
go-tangerine-22d29a6d52ade3ebcd4ecb341e3f5eafddb8e17b.zip
merge
-rw-r--r--cmd/mist/gui.go20
-rw-r--r--core/block_manager.go6
-rw-r--r--core/state_transition.go145
-rw-r--r--core/transaction_pool.go21
-rw-r--r--core/types/transaction.go94
-rw-r--r--core/vm_env.go10
-rw-r--r--miner/miner.go6
-rw-r--r--state/state.go35
-rw-r--r--tests/files/StateTests/stInitCodeTest.json870
-rw-r--r--tests/files/StateTests/stRefundTest.json523
-rw-r--r--tests/files/StateTests/stSystemOperationsTest.json2
-rw-r--r--tests/files/StateTests/stTransactionTest.json277
-rw-r--r--tests/files/VMTests/vmArithmeticTest.json294
-rw-r--r--tests/files/index.js7
-rw-r--r--tests/helper/vm.go37
-rw-r--r--tests/vm/gh_test.go22
-rw-r--r--vm/common.go2
-rw-r--r--vm/vm_debug.go27
-rw-r--r--xeth/hexface.go4
-rw-r--r--xeth/js_types.go14
-rw-r--r--xeth/pipe.go8
21 files changed, 2082 insertions, 342 deletions
diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go
index 0339f601e..3ab307174 100644
--- a/cmd/mist/gui.go
+++ b/cmd/mist/gui.go
@@ -309,13 +309,13 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
var (
ptx = xeth.NewJSTx(tx, pipe.World().State())
- send = nameReg.Storage(tx.Sender())
- rec = nameReg.Storage(tx.Recipient)
+ send = nameReg.Storage(tx.From())
+ rec = nameReg.Storage(tx.To())
s, r string
)
- if tx.CreatesContract() {
- rec = nameReg.Storage(tx.CreationAddress(pipe.World().State()))
+ if core.MessageCreatesContract(tx) {
+ rec = nameReg.Storage(core.AddressFromMessage(tx))
}
if send.Len() != 0 {
@@ -326,10 +326,10 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
if rec.Len() != 0 {
r = strings.Trim(rec.Str(), "\x00")
} else {
- if tx.CreatesContract() {
- r = ethutil.Bytes2Hex(tx.CreationAddress(pipe.World().State()))
+ if core.MessageCreatesContract(tx) {
+ r = ethutil.Bytes2Hex(core.AddressFromMessage(tx))
} else {
- r = ethutil.Bytes2Hex(tx.Recipient)
+ r = ethutil.Bytes2Hex(tx.To())
}
}
ptx.Sender = s
@@ -454,11 +454,11 @@ func (gui *Gui) update() {
object := state.GetAccount(gui.address())
if bytes.Compare(tx.Sender(), gui.address()) == 0 {
- object.SubAmount(tx.Value)
+ object.SubAmount(tx.Value())
gui.txDb.Put(tx.Hash(), tx.RlpEncode())
- } else if bytes.Compare(tx.Recipient, gui.address()) == 0 {
- object.AddAmount(tx.Value)
+ } else if bytes.Compare(tx.To(), gui.address()) == 0 {
+ object.AddAmount(tx.Value())
gui.txDb.Put(tx.Hash(), tx.RlpEncode())
}
diff --git a/core/block_manager.go b/core/block_manager.go
index 7cb9c4208..85b4891a5 100644
--- a/core/block_manager.go
+++ b/core/block_manager.go
@@ -109,11 +109,11 @@ done:
// If we are mining this block and validating we want to set the logs back to 0
state.EmptyLogs()
- txGas := new(big.Int).Set(tx.Gas)
+ txGas := new(big.Int).Set(tx.Gas())
cb := state.GetStateObject(coinbase.Address())
st := NewStateTransition(cb, tx, state, block)
- err = st.TransitionState()
+ _, err = st.TransitionState()
if err != nil {
switch {
case IsNonceErr(err):
@@ -132,7 +132,7 @@ done:
}
txGas.Sub(txGas, st.gas)
- cumulativeSum.Add(cumulativeSum, new(big.Int).Mul(txGas, tx.GasPrice))
+ cumulativeSum.Add(cumulativeSum, new(big.Int).Mul(txGas, tx.GasPrice()))
// Update the state with pending changes
state.Update(txGas)
diff --git a/core/state_transition.go b/core/state_transition.go
index 820ba66e6..9e81ddf28 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -5,6 +5,8 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/crypto"
+ "github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
@@ -27,48 +29,69 @@ import (
*/
type StateTransition struct {
coinbase, receiver []byte
- tx *types.Transaction
+ msg Message
gas, gasPrice *big.Int
+ initialGas *big.Int
value *big.Int
data []byte
state *state.StateDB
block *types.Block
cb, rec, sen *state.StateObject
+
+ Env vm.Environment
}
-func NewStateTransition(coinbase *state.StateObject, tx *types.Transaction, state *state.StateDB, block *types.Block) *StateTransition {
- return &StateTransition{coinbase.Address(), tx.Recipient, tx, new(big.Int), new(big.Int).Set(tx.GasPrice), tx.Value, tx.Data, state, block, coinbase, nil, nil}
+type Message interface {
+ Hash() []byte
+
+ From() []byte
+ To() []byte
+
+ GasPrice() *big.Int
+ Gas() *big.Int
+ Value() *big.Int
+
+ Nonce() uint64
+ Data() []byte
}
-func (self *StateTransition) Coinbase() *state.StateObject {
- if self.cb != nil {
- return self.cb
- }
+func AddressFromMessage(msg Message) []byte {
+ // Generate a new address
+ return crypto.Sha3(ethutil.NewValue([]interface{}{msg.From(), msg.Nonce()}).Encode())[12:]
+}
- self.cb = self.state.GetOrNewStateObject(self.coinbase)
- return self.cb
+func MessageCreatesContract(msg Message) bool {
+ return len(msg.To()) == 0
}
-func (self *StateTransition) Sender() *state.StateObject {
- if self.sen != nil {
- return self.sen
- }
- self.sen = self.state.GetOrNewStateObject(self.tx.Sender())
+func MessageGasValue(msg Message) *big.Int {
+ return new(big.Int).Mul(msg.Gas(), msg.GasPrice())
+}
- return self.sen
+func NewStateTransition(coinbase *state.StateObject, msg Message, state *state.StateDB, block *types.Block) *StateTransition {
+ return &StateTransition{coinbase.Address(), msg.To(), msg, new(big.Int), new(big.Int).Set(msg.GasPrice()), new(big.Int), msg.Value(), msg.Data(), state, block, coinbase, nil, nil, nil}
}
-func (self *StateTransition) Receiver() *state.StateObject {
- if self.tx != nil && self.tx.CreatesContract() {
- return nil
- }
- if self.rec != nil {
- return self.rec
+func (self *StateTransition) VmEnv() vm.Environment {
+ if self.Env == nil {
+ self.Env = NewEnv(self.state, self.msg, self.block)
}
- self.rec = self.state.GetOrNewStateObject(self.tx.Recipient)
- return self.rec
+ return self.Env
+}
+
+func (self *StateTransition) Coinbase() *state.StateObject {
+ return self.state.GetOrNewStateObject(self.coinbase)
+}
+func (self *StateTransition) From() *state.StateObject {
+ return self.state.GetOrNewStateObject(self.msg.From())
+}
+func (self *StateTransition) To() *state.StateObject {
+ if self.msg != nil && MessageCreatesContract(self.msg) {
+ return nil
+ }
+ return self.state.GetOrNewStateObject(self.msg.To())
}
func (self *StateTransition) UseGas(amount *big.Int) error {
@@ -87,41 +110,33 @@ func (self *StateTransition) AddGas(amount *big.Int) {
func (self *StateTransition) BuyGas() error {
var err error
- sender := self.Sender()
- if sender.Balance().Cmp(self.tx.GasValue()) < 0 {
- return fmt.Errorf("Insufficient funds to pre-pay gas. Req %v, has %v", self.tx.GasValue(), sender.Balance())
+ sender := self.From()
+ if sender.Balance().Cmp(MessageGasValue(self.msg)) < 0 {
+ return fmt.Errorf("Insufficient funds to pre-pay gas. Req %v, has %v", MessageGasValue(self.msg), sender.Balance())
}
coinbase := self.Coinbase()
- err = coinbase.BuyGas(self.tx.Gas, self.tx.GasPrice)
+ err = coinbase.BuyGas(self.msg.Gas(), self.msg.GasPrice())
if err != nil {
return err
}
- self.AddGas(self.tx.Gas)
- sender.SubAmount(self.tx.GasValue())
+ self.AddGas(self.msg.Gas())
+ self.initialGas.Set(self.msg.Gas())
+ sender.SubAmount(MessageGasValue(self.msg))
return nil
}
-func (self *StateTransition) RefundGas() {
- coinbase, sender := self.Coinbase(), self.Sender()
- coinbase.RefundGas(self.gas, self.tx.GasPrice)
-
- // Return remaining gas
- remaining := new(big.Int).Mul(self.gas, self.tx.GasPrice)
- sender.AddAmount(remaining)
-}
-
func (self *StateTransition) preCheck() (err error) {
var (
- tx = self.tx
- sender = self.Sender()
+ msg = self.msg
+ sender = self.From()
)
// Make sure this transaction's nonce is correct
- if sender.Nonce != tx.Nonce {
- return NonceError(tx.Nonce, sender.Nonce)
+ if sender.Nonce != msg.Nonce() {
+ return NonceError(msg.Nonce(), sender.Nonce)
}
// Pre-pay gas / Buy gas of the coinbase account
@@ -132,8 +147,8 @@ func (self *StateTransition) preCheck() (err error) {
return nil
}
-func (self *StateTransition) TransitionState() (err error) {
- statelogger.Debugf("(~) %x\n", self.tx.Hash())
+func (self *StateTransition) TransitionState() (ret []byte, err error) {
+ statelogger.Debugf("(~) %x\n", self.msg.Hash())
// XXX Transactions after this point are considered valid.
if err = self.preCheck(); err != nil {
@@ -141,8 +156,8 @@ func (self *StateTransition) TransitionState() (err error) {
}
var (
- tx = self.tx
- sender = self.Sender()
+ msg = self.msg
+ sender = self.From()
)
defer self.RefundGas()
@@ -168,16 +183,15 @@ func (self *StateTransition) TransitionState() (err error) {
return
}
- var ret []byte
- vmenv := NewEnv(self.state, self.tx, self.block)
+ vmenv := self.VmEnv()
var ref vm.ClosureRef
- if tx.CreatesContract() {
- self.rec = MakeContract(tx, self.state)
+ if MessageCreatesContract(msg) {
+ self.rec = MakeContract(msg, self.state)
- ret, err, ref = vmenv.Create(sender, self.rec.Address(), self.tx.Data, self.gas, self.gasPrice, self.value)
+ ret, err, ref = vmenv.Create(sender, self.rec.Address(), self.msg.Data(), self.gas, self.gasPrice, self.value)
ref.SetCode(ret)
} else {
- ret, err = vmenv.Call(self.Sender(), self.Receiver().Address(), self.tx.Data, self.gas, self.gasPrice, self.value)
+ ret, err = vmenv.Call(self.From(), self.To().Address(), self.msg.Data(), self.gas, self.gasPrice, self.value)
}
if err != nil {
statelogger.Debugln(err)
@@ -187,11 +201,32 @@ func (self *StateTransition) TransitionState() (err error) {
}
// Converts an transaction in to a state object
-func MakeContract(tx *types.Transaction, state *state.StateDB) *state.StateObject {
- addr := tx.CreationAddress(state)
+func MakeContract(msg Message, state *state.StateDB) *state.StateObject {
+ addr := AddressFromMessage(msg)
contract := state.GetOrNewStateObject(addr)
- contract.InitCode = tx.Data
+ contract.InitCode = msg.Data()
return contract
}
+
+func (self *StateTransition) RefundGas() {
+ coinbaseSub := new(big.Int).Set(self.gas)
+ uhalf := new(big.Int).Div(self.GasUsed(), ethutil.Big2)
+ for addr, ref := range self.state.Refunds() {
+ refund := ethutil.BigMin(uhalf, ref)
+ coinbaseSub.Add(self.gas, refund)
+ self.state.AddBalance([]byte(addr), refund.Mul(refund, self.msg.GasPrice()))
+ }
+
+ coinbase, sender := self.Coinbase(), self.From()
+ coinbase.RefundGas(coinbaseSub, self.msg.GasPrice())
+
+ // Return remaining gas
+ remaining := new(big.Int).Mul(self.gas, self.msg.GasPrice())
+ sender.AddAmount(remaining)
+}
+
+func (self *StateTransition) GasUsed() *big.Int {
+ return new(big.Int).Sub(self.initialGas, self.gas)
+}
diff --git a/core/transaction_pool.go b/core/transaction_pool.go
index 2bbda7d90..17fcdb86a 100644
--- a/core/transaction_pool.go
+++ b/core/transaction_pool.go
@@ -106,8 +106,8 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error {
return fmt.Errorf("No last block on the block chain")
}
- if len(tx.Recipient) != 0 && len(tx.Recipient) != 20 {
- return fmt.Errorf("Invalid recipient. len = %d", len(tx.Recipient))
+ if len(tx.To()) != 0 && len(tx.To()) != 20 {
+ return fmt.Errorf("Invalid recipient. len = %d", len(tx.To()))
}
v, _, _ := tx.Curve()
@@ -118,17 +118,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error {
// Get the sender
sender := pool.chainManager.State().GetAccount(tx.Sender())
- totAmount := new(big.Int).Set(tx.Value)
+ totAmount := new(big.Int).Set(tx.Value())
// Make sure there's enough in the sender's account. Having insufficient
// funds won't invalidate this transaction but simple ignores it.
if sender.Balance().Cmp(totAmount) < 0 {
- return fmt.Errorf("Insufficient amount in sender's (%x) account", tx.Sender())
- }
-
- if tx.IsContract() {
- if tx.GasPrice.Cmp(big.NewInt(minGasPrice)) < 0 {
- return fmt.Errorf("Gasprice too low, %s given should be at least %d.", tx.GasPrice, minGasPrice)
- }
+ return fmt.Errorf("Insufficient amount in sender's (%x) account", tx.From())
}
// Increment the nonce making each tx valid only once to prevent replay
@@ -154,10 +148,7 @@ func (self *TxPool) Add(tx *types.Transaction) error {
self.addTransaction(tx)
- tmp := make([]byte, 4)
- copy(tmp, tx.Recipient)
-
- txplogger.Debugf("(t) %x => %x (%v) %x\n", tx.Sender()[:4], tmp, tx.Value, tx.Hash())
+ txplogger.Debugf("(t) %x => %x (%v) %x\n", tx.From()[:4], tx.To()[:4], tx.Value, tx.Hash())
// Notify the subscribers
go self.eventMux.Post(TxPreEvent{tx})
@@ -204,7 +195,7 @@ func (pool *TxPool) RemoveInvalid(state *state.StateDB) {
tx := e.Value.(*types.Transaction)
sender := state.GetAccount(tx.Sender())
err := pool.ValidateTransaction(tx)
- if err != nil || sender.Nonce >= tx.Nonce {
+ if err != nil || sender.Nonce >= tx.Nonce() {
pool.pool.Remove(e)
}
}
diff --git a/core/types/transaction.go b/core/types/transaction.go
index 63edef756..c64fb69f0 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -6,37 +6,30 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
- "github.com/ethereum/go-ethereum/state"
"github.com/obscuren/secp256k1-go"
)
-var ContractAddr = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
-
func IsContractAddr(addr []byte) bool {
return len(addr) == 0
- //return bytes.Compare(addr, ContractAddr) == 0
}
type Transaction struct {
- Nonce uint64
- Recipient []byte
- Value *big.Int
- Gas *big.Int
- GasPrice *big.Int
- Data []byte
+ nonce uint64
+ recipient []byte
+ value *big.Int
+ gas *big.Int
+ gasPrice *big.Int
+ data []byte
v byte
r, s []byte
-
- // Indicates whether this tx is a contract creation transaction
- contractCreation bool
}
func NewContractCreationTx(value, gas, gasPrice *big.Int, script []byte) *Transaction {
- return &Transaction{Recipient: nil, Value: value, Gas: gas, GasPrice: gasPrice, Data: script, contractCreation: true}
+ return &Transaction{recipient: nil, value: value, gas: gas, gasPrice: gasPrice, data: script}
}
func NewTransactionMessage(to []byte, value, gas, gasPrice *big.Int, data []byte) *Transaction {
- return &Transaction{Recipient: to, Value: value, GasPrice: gasPrice, Gas: gas, Data: data, contractCreation: IsContractAddr(to)}
+ return &Transaction{recipient: to, value: value, gasPrice: gasPrice, gas: gas, data: data}
}
func NewTransactionFromBytes(data []byte) *Transaction {
@@ -53,33 +46,42 @@ func NewTransactionFromValue(val *ethutil.Value) *Transaction {
return tx
}
-func (self *Transaction) GasValue() *big.Int {
- return new(big.Int).Mul(self.Gas, self.GasPrice)
+func (tx *Transaction) Hash() []byte {
+ data := []interface{}{tx.Nonce, tx.gasPrice, tx.gas, tx.recipient, tx.Value, tx.Data}
+
+ return crypto.Sha3(ethutil.NewValue(data).Encode())
}
-func (self *Transaction) TotalValue() *big.Int {
- v := self.GasValue()
- return v.Add(v, self.Value)
+func (self *Transaction) Data() []byte {
+ return self.data
}
-func (tx *Transaction) Hash() []byte {
- data := []interface{}{tx.Nonce, tx.GasPrice, tx.Gas, tx.Recipient, tx.Value, tx.Data}
+func (self *Transaction) Gas() *big.Int {
+ return self.gas
+}
- return crypto.Sha3(ethutil.NewValue(data).Encode())
+func (self *Transaction) GasPrice() *big.Int {
+ return self.gasPrice
+}
+
+func (self *Transaction) Value() *big.Int {
+ return self.value
}
-func (tx *Transaction) CreatesContract() bool {
- return tx.contractCreation
+func (self *Transaction) Nonce() uint64 {
+ return self.nonce
}
-/* Deprecated */
-func (tx *Transaction) IsContract() bool {
- return tx.CreatesContract()
+func (self *Transaction) SetNonce(nonce uint64) {
+ self.nonce = nonce
}
-func (tx *Transaction) CreationAddress(state *state.StateDB) []byte {
- // Generate a new address
- return crypto.Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:]
+func (self *Transaction) From() []byte {
+ return self.Sender()
+}
+
+func (self *Transaction) To() []byte {
+ return self.recipient
}
func (tx *Transaction) Curve() (v byte, r []byte, s []byte) {
@@ -136,7 +138,7 @@ func (tx *Transaction) Sign(privk []byte) error {
}
func (tx *Transaction) RlpData() interface{} {
- data := []interface{}{tx.Nonce, tx.GasPrice, tx.Gas, tx.Recipient, tx.Value, tx.Data}
+ data := []interface{}{tx.Nonce, tx.GasPrice, tx.Gas, tx.recipient, tx.Value, tx.Data}
// TODO Remove prefixing zero's
@@ -156,20 +158,16 @@ func (tx *Transaction) RlpDecode(data []byte) {
}
func (tx *Transaction) RlpValueDecode(decoder *ethutil.Value) {
- tx.Nonce = decoder.Get(0).Uint()
- tx.GasPrice = decoder.Get(1).BigInt()
- tx.Gas = decoder.Get(2).BigInt()
- tx.Recipient = decoder.Get(3).Bytes()
- tx.Value = decoder.Get(4).BigInt()
- tx.Data = decoder.Get(5).Bytes()
+ tx.nonce = decoder.Get(0).Uint()
+ tx.gasPrice = decoder.Get(1).BigInt()
+ tx.gas = decoder.Get(2).BigInt()
+ tx.recipient = decoder.Get(3).Bytes()
+ tx.value = decoder.Get(4).BigInt()
+ tx.data = decoder.Get(5).Bytes()
tx.v = byte(decoder.Get(6).Uint())
tx.r = decoder.Get(7).Bytes()
tx.s = decoder.Get(8).Bytes()
-
- if IsContractAddr(tx.Recipient) {
- tx.contractCreation = true
- }
}
func (tx *Transaction) String() string {
@@ -188,12 +186,12 @@ func (tx *Transaction) String() string {
S: 0x%x
`,
tx.Hash(),
- len(tx.Recipient) == 0,
+ len(tx.recipient) == 0,
tx.Sender(),
- tx.Recipient,
- tx.Nonce,
- tx.GasPrice,
- tx.Gas,
+ tx.recipient,
+ tx.nonce,
+ tx.gasPrice,
+ tx.gas,
tx.Value,
tx.Data,
tx.v,
@@ -221,5 +219,5 @@ func (s Transactions) GetRlp(i int) []byte { return ethutil.Rlp(s[i]) }
type TxByNonce struct{ Transactions }
func (s TxByNonce) Less(i, j int) bool {
- return s.Transactions[i].Nonce < s.Transactions[j].Nonce
+ return s.Transactions[i].nonce < s.Transactions[j].nonce
}
diff --git a/core/vm_env.go b/core/vm_env.go
index 9e1815188..0b6744972 100644
--- a/core/vm_env.go
+++ b/core/vm_env.go
@@ -11,26 +11,26 @@ import (
type VMEnv struct {
state *state.StateDB
block *types.Block
- tx *types.Transaction
+ msg Message
depth int
}
-func NewEnv(state *state.StateDB, tx *types.Transaction, block *types.Block) *VMEnv {
+func NewEnv(state *state.StateDB, msg Message, block *types.Block) *VMEnv {
return &VMEnv{
state: state,
block: block,
- tx: tx,
+ msg: msg,
}
}
-func (self *VMEnv) Origin() []byte { return self.tx.Sender() }
+func (self *VMEnv) Origin() []byte { return self.msg.From() }
func (self *VMEnv) BlockNumber() *big.Int { return self.block.Number }
func (self *VMEnv) PrevHash() []byte { return self.block.PrevHash }
func (self *VMEnv) Coinbase() []byte { return self.block.Coinbase }
func (self *VMEnv) Time() int64 { return self.block.Time }
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) Value() *big.Int { return self.msg.Value() }
func (self *VMEnv) State() *state.StateDB { return self.state }
func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit }
func (self *VMEnv) Depth() int { return self.depth }
diff --git a/miner/miner.go b/miner/miner.go
index 6ba3b1eba..d909c228b 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -236,8 +236,8 @@ func (self *Miner) finiliseTxs() types.Transactions {
key := self.eth.KeyManager()
for i, ltx := range self.localTxs {
tx := types.NewTransactionMessage(ltx.To, ethutil.Big(ltx.Value), ethutil.Big(ltx.Gas), ethutil.Big(ltx.GasPrice), ltx.Data)
- tx.Nonce = state.GetNonce(self.Coinbase)
- state.SetNonce(self.Coinbase, tx.Nonce+1)
+ tx.SetNonce(state.GetNonce(self.Coinbase))
+ state.SetNonce(self.Coinbase, tx.Nonce()+1)
tx.Sign(key.PrivateKey())
@@ -246,7 +246,7 @@ func (self *Miner) finiliseTxs() types.Transactions {
// Faster than append
for _, tx := range self.eth.TxPool().GetTransactions() {
- if tx.GasPrice.Cmp(self.MinAcceptedGasPrice) >= 0 {
+ if tx.GasPrice().Cmp(self.MinAcceptedGasPrice) >= 0 {
txs[actualSize] = tx
actualSize++
}
diff --git a/state/state.go b/state/state.go
index ca3f2af9c..a8d611668 100644
--- a/state/state.go
+++ b/state/state.go
@@ -23,14 +23,14 @@ type StateDB struct {
manifest *Manifest
- refund map[string][]refund
+ refund map[string]*big.Int
logs Logs
}
// Create a new state from a given trie
func New(trie *trie.Trie) *StateDB {
- return &StateDB{Trie: trie, stateObjects: make(map[string]*StateObject), manifest: NewManifest(), refund: make(map[string][]refund)}
+ return &StateDB{Trie: trie, stateObjects: make(map[string]*StateObject), manifest: NewManifest(), refund: make(map[string]*big.Int)}
}
func (self *StateDB) EmptyLogs() {
@@ -55,12 +55,11 @@ func (self *StateDB) GetBalance(addr []byte) *big.Int {
return ethutil.Big0
}
-type refund struct {
- gas, price *big.Int
-}
-
-func (self *StateDB) Refund(addr []byte, gas, price *big.Int) {
- self.refund[string(addr)] = append(self.refund[string(addr)], refund{gas, price})
+func (self *StateDB) Refund(addr []byte, gas *big.Int) {
+ if self.refund[string(addr)] == nil {
+ self.refund[string(addr)] = new(big.Int)
+ }
+ self.refund[string(addr)].Add(self.refund[string(addr)], gas)
}
func (self *StateDB) AddBalance(addr []byte, amount *big.Int) {
@@ -211,7 +210,7 @@ func (self *StateDB) Copy() *StateDB {
}
for addr, refund := range self.refund {
- state.refund[addr] = refund
+ state.refund[addr] = new(big.Int).Set(refund)
}
logs := make(Logs, len(self.logs))
@@ -273,23 +272,17 @@ func (s *StateDB) Sync() {
func (self *StateDB) Empty() {
self.stateObjects = make(map[string]*StateObject)
- self.refund = make(map[string][]refund)
+ self.refund = make(map[string]*big.Int)
+}
+
+func (self *StateDB) Refunds() map[string]*big.Int {
+ return self.refund
}
func (self *StateDB) Update(gasUsed *big.Int) {
var deleted bool
- // Refund any gas that's left
- // XXX THIS WILL CHANGE IN POC8
- uhalf := new(big.Int).Div(gasUsed, ethutil.Big2)
- for addr, refs := range self.refund {
- for _, ref := range refs {
- refund := ethutil.BigMin(uhalf, ref.gas)
-
- self.GetStateObject([]byte(addr)).AddBalance(refund.Mul(refund, ref.price))
- }
- }
- self.refund = make(map[string][]refund)
+ self.refund = make(map[string]*big.Int)
for _, stateObject := range self.stateObjects {
if stateObject.remove {
diff --git a/tests/files/StateTests/stInitCodeTest.json b/tests/files/StateTests/stInitCodeTest.json
new file mode 100644
index 000000000..67aa42853
--- /dev/null
+++ b/tests/files/StateTests/stInitCodeTest.json
@@ -0,0 +1,870 @@
+{
+ "CallRecursiveContract" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "04110d816c380812a427968ece99b1c963dfbce6" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x04110d816c380812a427968ece99b1c963dfbce6"
+ }
+ },
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1",
+ "code" : "0x3060025560206000600039602060006000f0",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87"
+ }
+ },
+ "0a517d755cebbf66312b30fff713666a9cb917e0" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x0a517d755cebbf66312b30fff713666a9cb917e0"
+ }
+ },
+ "24dd378f51adc67a50e339e8031fe9bd4aafab36" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x24dd378f51adc67a50e339e8031fe9bd4aafab36"
+ }
+ },
+ "293f982d000532a7861ab122bdc4bbfd26bf9030" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x293f982d000532a7861ab122bdc4bbfd26bf9030"
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "2cf5732f017b0cf1b1f13a1478e10239716bf6b5" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x2cf5732f017b0cf1b1f13a1478e10239716bf6b5"
+ }
+ },
+ "31c640b92c21a1f1465c91070b4b3b4d6854195f" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "37f998764813b136ddf5a754f34063fd03065e36" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x37f998764813b136ddf5a754f34063fd03065e36"
+ }
+ },
+ "37fa399a749c121f8a15ce77e3d9f9bec8020d7a" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x37fa399a749c121f8a15ce77e3d9f9bec8020d7a"
+ }
+ },
+ "4f36659fa632310b6ec438dea4085b522a2dd077" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x4f36659fa632310b6ec438dea4085b522a2dd077"
+ }
+ },
+ "62c01474f089b07dae603491675dc5b5748f7049" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x62c01474f089b07dae603491675dc5b5748f7049"
+ }
+ },
+ "729af7294be595a0efd7d891c9e51f89c07950c7" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x729af7294be595a0efd7d891c9e51f89c07950c7"
+ }
+ },
+ "83e3e5a16d3b696a0314b30b2534804dd5e11197" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x83e3e5a16d3b696a0314b30b2534804dd5e11197"
+ }
+ },
+ "8703df2417e0d7c59d063caa9583cb10a4d20532" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x8703df2417e0d7c59d063caa9583cb10a4d20532"
+ }
+ },
+ "8dffcd74e5b5923512916c6a64b502689cfa65e1" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x8dffcd74e5b5923512916c6a64b502689cfa65e1"
+ }
+ },
+ "95a4d7cccb5204733874fa87285a176fe1e9e240" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x95a4d7cccb5204733874fa87285a176fe1e9e240"
+ }
+ },
+ "99b2fcba8120bedd048fe79f5262a6690ed38c39" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x99b2fcba8120bedd048fe79f5262a6690ed38c39"
+ }
+ },
+ "a4202b8b8afd5354e3e40a219bdc17f6001bf2cf" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xa4202b8b8afd5354e3e40a219bdc17f6001bf2cf"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "89999",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ },
+ "a9647f4a0a14042d91dc33c0328030a7157c93ae" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xa9647f4a0a14042d91dc33c0328030a7157c93ae"
+ }
+ },
+ "aa6cffe5185732689c18f37a7f86170cb7304c2a" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xaa6cffe5185732689c18f37a7f86170cb7304c2a"
+ }
+ },
+ "aae4a2e3c51c04606dcb3723456e58f3ed214f45" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xaae4a2e3c51c04606dcb3723456e58f3ed214f45"
+ }
+ },
+ "c37a43e940dfb5baf581a0b82b351d48305fc885" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xc37a43e940dfb5baf581a0b82b351d48305fc885"
+ }
+ },
+ "d2571607e241ecf590ed94b12d87c94babe36db6" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
+ }
+ },
+ "f735071cbee190d76b704ce68384fc21e389fbe7" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xf735071cbee190d76b704ce68384fc21e389fbe7"
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "0",
+ "code" : "0x3060025560206000600039602060006000f0",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x00",
+ "gasLimit" : "10000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "1"
+ }
+ },
+ "CallTheContractToCreateContractWithInitCode" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "04110d816c380812a427968ece99b1c963dfbce6" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x04110d816c380812a427968ece99b1c963dfbce6"
+ }
+ },
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "10001",
+ "code" : "0x3060025560206000600039602060006000f0",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87"
+ }
+ },
+ "0a517d755cebbf66312b30fff713666a9cb917e0" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x0a517d755cebbf66312b30fff713666a9cb917e0"
+ }
+ },
+ "24dd378f51adc67a50e339e8031fe9bd4aafab36" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x24dd378f51adc67a50e339e8031fe9bd4aafab36"
+ }
+ },
+ "293f982d000532a7861ab122bdc4bbfd26bf9030" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x293f982d000532a7861ab122bdc4bbfd26bf9030"
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "2cf5732f017b0cf1b1f13a1478e10239716bf6b5" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x2cf5732f017b0cf1b1f13a1478e10239716bf6b5"
+ }
+ },
+ "31c640b92c21a1f1465c91070b4b3b4d6854195f" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "37f998764813b136ddf5a754f34063fd03065e36" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x37f998764813b136ddf5a754f34063fd03065e36"
+ }
+ },
+ "37fa399a749c121f8a15ce77e3d9f9bec8020d7a" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x37fa399a749c121f8a15ce77e3d9f9bec8020d7a"
+ }
+ },
+ "4f36659fa632310b6ec438dea4085b522a2dd077" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x4f36659fa632310b6ec438dea4085b522a2dd077"
+ }
+ },
+ "62c01474f089b07dae603491675dc5b5748f7049" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x62c01474f089b07dae603491675dc5b5748f7049"
+ }
+ },
+ "729af7294be595a0efd7d891c9e51f89c07950c7" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x729af7294be595a0efd7d891c9e51f89c07950c7"
+ }
+ },
+ "83e3e5a16d3b696a0314b30b2534804dd5e11197" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x83e3e5a16d3b696a0314b30b2534804dd5e11197"
+ }
+ },
+ "8703df2417e0d7c59d063caa9583cb10a4d20532" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x8703df2417e0d7c59d063caa9583cb10a4d20532"
+ }
+ },
+ "8dffcd74e5b5923512916c6a64b502689cfa65e1" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x8dffcd74e5b5923512916c6a64b502689cfa65e1"
+ }
+ },
+ "95a4d7cccb5204733874fa87285a176fe1e9e240" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x95a4d7cccb5204733874fa87285a176fe1e9e240"
+ }
+ },
+ "99b2fcba8120bedd048fe79f5262a6690ed38c39" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0x99b2fcba8120bedd048fe79f5262a6690ed38c39"
+ }
+ },
+ "a4202b8b8afd5354e3e40a219bdc17f6001bf2cf" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xa4202b8b8afd5354e3e40a219bdc17f6001bf2cf"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "89999",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ },
+ "a9647f4a0a14042d91dc33c0328030a7157c93ae" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xa9647f4a0a14042d91dc33c0328030a7157c93ae"
+ }
+ },
+ "aa6cffe5185732689c18f37a7f86170cb7304c2a" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xaa6cffe5185732689c18f37a7f86170cb7304c2a"
+ }
+ },
+ "aae4a2e3c51c04606dcb3723456e58f3ed214f45" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xaae4a2e3c51c04606dcb3723456e58f3ed214f45"
+ }
+ },
+ "c37a43e940dfb5baf581a0b82b351d48305fc885" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xc37a43e940dfb5baf581a0b82b351d48305fc885"
+ }
+ },
+ "d2571607e241ecf590ed94b12d87c94babe36db6" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
+ }
+ },
+ "f735071cbee190d76b704ce68384fc21e389fbe7" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ "0x02" : "0xf735071cbee190d76b704ce68384fc21e389fbe7"
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "10000",
+ "code" : "0x3060025560206000600039602060006000f0",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x00",
+ "gasLimit" : "10000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "1"
+ }
+ },
+ "CallTheContractToCreateEmptyContract" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1",
+ "code" : "0x602060006000f0",
+ "nonce" : "1",
+ "storage" : {
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "605",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "99394",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ },
+ "d2571607e241ecf590ed94b12d87c94babe36db6" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "0",
+ "code" : "0x602060006000f0",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x00",
+ "gasLimit" : "10000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "1"
+ }
+ },
+ "NotEnoughCashContractCreation" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "2",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "2",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x600a80600c6000396000f200600160008035811a8100",
+ "gasLimit" : "599",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : "1"
+ }
+ },
+ "OutOfGasContractCreation" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "1770",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "balance" : "1",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "8229",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x600a80600c6000396000f200600160008035811a8100",
+ "gasLimit" : "590",
+ "gasPrice" : "3",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : "1"
+ }
+ },
+ "TransactionContractCreation" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "599",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "balance" : "1",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "99400",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x600a80600c6000396000f200600160008035811a8100",
+ "gasLimit" : "599",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : "1"
+ }
+ },
+ "TransactionCreateSuicideContract" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "1000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "balance" : "1",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "8999",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x600a80600c6000396000f200ff600160008035811a81",
+ "gasLimit" : "1000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : "1"
+ }
+ },
+ "TransactionStopInitCode" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "599",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "balance" : "1",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "9400",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x600a80600c600039600000f20000600160008035811a81",
+ "gasLimit" : "1000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : "1"
+ }
+ },
+ "TransactionSuicideInitCode" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "0000000000000000000000000000000000000000" : {
+ "balance" : "1",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "611",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "9388",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "0x600a80600c6000396000fff2ffff600160008035811a81",
+ "gasLimit" : "1000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : "1"
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/files/StateTests/stRefundTest.json b/tests/files/StateTests/stRefundTest.json
new file mode 100644
index 000000000..08ae1fac8
--- /dev/null
+++ b/tests/files/StateTests/stRefundTest.json
@@ -0,0 +1,523 @@
+{
+ "refund500" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x600154506002545060ff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+ "nonce" : "0",
+ "storage" : {
+ "0x0a" : "0x8000000000000000000000000000000000000000000000000000000000000000",
+ "0x0b" : "0x0de0b6b3a7640000"
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "592",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "9408",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x600154506002545060ff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01",
+ "0x02" : "0x01",
+ "0x03" : "0x01",
+ "0x04" : "0x01",
+ "0x05" : "0x01",
+ "0x06" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "10000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "0"
+ }
+ },
+ "refund50_1" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x60006001556000600255600060035560006004556000600555",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "255",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "9745",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x60006001556000600255600060035560006004556000600555",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01",
+ "0x02" : "0x01",
+ "0x03" : "0x01",
+ "0x04" : "0x01",
+ "0x05" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "10000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "0"
+ }
+ },
+ "refund50_2" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x6001600a556001600b5560006001556000600255600060035560006004556000600555",
+ "nonce" : "0",
+ "storage" : {
+ "0x0a" : "0x01",
+ "0x0b" : "0x01"
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "614",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "9386",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x6001600a556001600b5560006001556000600255600060035560006004556000600555",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01",
+ "0x02" : "0x01",
+ "0x03" : "0x01",
+ "0x04" : "0x01",
+ "0x05" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "10000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "0"
+ }
+ },
+ "refund600" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x600154506002545061ffff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+ "nonce" : "0",
+ "storage" : {
+ "0x0b" : "0x0de0b6b3a7640000"
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "492",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "9508",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x600154506002545061ffff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01",
+ "0x02" : "0x01",
+ "0x03" : "0x01",
+ "0x04" : "0x01",
+ "0x05" : "0x01",
+ "0x06" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "10000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "0"
+ }
+ },
+ "refund_NoOOG_1" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x6000600155",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "402",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x6000600155",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "502",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "502",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "0"
+ }
+ },
+ "refund_OOG" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x6000600155",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "500",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x6000600155",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "500",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "500",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "0"
+ }
+ },
+ "refund_changeNonZeroStorage" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000010",
+ "code" : "0x6017600155",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x17"
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "602",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "388",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x6017600155",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "850",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "10"
+ }
+ },
+ "refund_getEtherBack" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000010",
+ "code" : "0x6000600155",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "402",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "588",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "code" : "0x6000600155",
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "850",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "10"
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/files/StateTests/stSystemOperationsTest.json b/tests/files/StateTests/stSystemOperationsTest.json
index a74d32ae5..612331ae3 100644
--- a/tests/files/StateTests/stSystemOperationsTest.json
+++ b/tests/files/StateTests/stSystemOperationsTest.json
@@ -5827,4 +5827,4 @@
"value" : "100000"
}
}
-}
+} \ No newline at end of file
diff --git a/tests/files/StateTests/stTransactionTest.json b/tests/files/StateTests/stTransactionTest.json
new file mode 100644
index 000000000..0de850797
--- /dev/null
+++ b/tests/files/StateTests/stTransactionTest.json
@@ -0,0 +1,277 @@
+{
+ "EmptyTransaction" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "",
+ "gasPrice" : "",
+ "nonce" : "",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : ""
+ }
+ },
+ "TransactionFromCoinbaseNotEnoughFounds" : {
+ "env" : {
+ "currentCoinbase" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1100",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "600",
+ "gasPrice" : "1",
+ "nonce" : "",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : "502"
+ }
+ },
+ "TransactionSendingToEmpty" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "500",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "balance" : "0",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "99500",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "500",
+ "gasPrice" : "1",
+ "nonce" : "",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : ""
+ }
+ },
+ "TransactionSendingToZero" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "0000000000000000000000000000000000000000" : {
+ "balance" : "1",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "500",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "99499",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "5000",
+ "gasPrice" : "1",
+ "nonce" : "",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "0000000000000000000000000000000000000000",
+ "value" : "1"
+ }
+ },
+ "TransactionToItself" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+ "balance" : "500",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "99500",
+ "code" : "0x",
+ "nonce" : "1",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "5000",
+ "gasPrice" : "1",
+ "nonce" : "",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : "1"
+ }
+ },
+ "TransactionToItselfNotEnoughFounds" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "1000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "logs" : [
+ ],
+ "out" : "0x",
+ "post" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1101",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "pre" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1101",
+ "code" : "0x",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : "",
+ "gasLimit" : "600",
+ "gasPrice" : "1",
+ "nonce" : "",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : "502"
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/files/VMTests/vmArithmeticTest.json b/tests/files/VMTests/vmArithmeticTest.json
index 2cc165f5d..88d209dfa 100644
--- a/tests/files/VMTests/vmArithmeticTest.json
+++ b/tests/files/VMTests/vmArithmeticTest.json
@@ -12,12 +12,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -57,12 +57,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60047fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -102,12 +102,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "10000",
@@ -146,12 +146,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6000600001600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -190,12 +190,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600101600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -234,12 +234,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60026002600108600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9695",
@@ -279,12 +279,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60026002600003600160000308600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9691",
@@ -324,12 +324,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036001600660000308600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9693",
@@ -369,12 +369,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036001600660000308600360056000030714600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9887",
@@ -413,12 +413,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036001600660000308600360056000030614600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9687",
@@ -458,12 +458,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036000036001600408600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9693",
@@ -503,12 +503,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60026003600003600160040814600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9891",
@@ -547,12 +547,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6002600504600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -592,12 +592,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6018601704600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -636,12 +636,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6018600004600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -680,12 +680,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6001600104600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -725,12 +725,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6000600204600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -769,12 +769,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x600260020a600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9695",
@@ -814,12 +814,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0a600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9664",
@@ -859,12 +859,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x637fffffff637fffffff0a600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9692",
@@ -904,12 +904,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x637fffffff60000a600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9892",
@@ -948,12 +948,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6000637fffffff0a600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -993,12 +993,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60016101010a600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9695",
@@ -1038,12 +1038,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x61010160010a600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9694",
@@ -1083,12 +1083,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x61010160020a600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9894",
@@ -1127,12 +1127,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6003600206600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -1172,12 +1172,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff06600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -1217,12 +1217,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600006600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -1261,12 +1261,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6000600306600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -1305,12 +1305,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6003600260000306600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9694",
@@ -1350,12 +1350,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6003600202600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -1395,12 +1395,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -1440,12 +1440,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6017600002600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -1484,12 +1484,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6001601702600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -1529,12 +1529,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f800000000000000000000000000000000000000000000000000000000000000002600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -1574,12 +1574,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7f80000000000000000000000000000000000000000000000000000000000000007f800000000000000000000000000000000000000000000000000000000000000002600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -1618,12 +1618,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -1663,12 +1663,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60026002600109600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9895",
@@ -1707,12 +1707,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036002600003600160000309600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9891",
@@ -1751,12 +1751,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036001600560000309600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9693",
@@ -1796,12 +1796,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036001600560000309600360056000030714600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9887",
@@ -1840,12 +1840,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036001600560000309600360056000030614600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9687",
@@ -1885,12 +1885,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60036000036001600509600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9693",
@@ -1930,12 +1930,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60026003600003600160050914600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9891",
@@ -1974,12 +1974,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60000305600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9694",
@@ -2019,12 +2019,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff05600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9694",
@@ -2064,12 +2064,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6004600003600260000305600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9892",
@@ -2108,12 +2108,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6002600003600405600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9694",
@@ -2153,12 +2153,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6000600003600360000305600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9892",
@@ -2197,12 +2197,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60000305600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9894",
@@ -2241,12 +2241,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x62126af460500b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2286,12 +2286,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x600060000b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -2330,12 +2330,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60000b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2375,12 +2375,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2420,12 +2420,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2465,12 +2465,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60ff68f000000000000000010b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2510,12 +2510,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
@@ -2554,12 +2554,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x62122f6a60000b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2599,12 +2599,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x62126af460010b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2644,12 +2644,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6212faf460010b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2689,12 +2689,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x66f000000000000161ffff0b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2734,12 +2734,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x62122ff460000b600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -2779,12 +2779,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6003600003600560000307600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9692",
@@ -2824,12 +2824,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6003600003600507600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9694",
@@ -2869,12 +2869,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6003600560000307600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9694",
@@ -2914,12 +2914,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260000307600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9894",
@@ -2958,12 +2958,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6000600260000307600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9894",
@@ -3002,12 +3002,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x00",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "10000",
@@ -3046,12 +3046,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6001601703600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -3091,12 +3091,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6003600203600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -3136,12 +3136,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x6017600003600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -3181,12 +3181,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600003600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -3226,12 +3226,12 @@
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03600055",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
- "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9696",
@@ -3258,4 +3258,4 @@
}
}
}
-} \ No newline at end of file
+}
diff --git a/tests/files/index.js b/tests/files/index.js
index 730107a27..34a03d8b2 100644
--- a/tests/files/index.js
+++ b/tests/files/index.js
@@ -8,12 +8,17 @@ module.exports = {
trietestnextprev: require('./TrieTests/trietestnextprev'),
txtest: require('./BasicTests/txtest'),
StateTests: {
+ stExample: require('./StateTests/stExample.json'),
+ stInitCodeTest: require('./StateTests/stInitCodeTest.json'),
+ stLogTests: require('./StateTests/stLogTests.json'),
stPreCompiledContracts: require('./StateTests/stPreCompiledContracts'),
stRecursiveCreate: require('./StateTests/stRecursiveCreate'),
stSpecial: require('./StateTests/stSpecialTest'),
stSystemOperationsTest: require('./StateTests/stSystemOperationsTest'),
+ stTransactionTest: require('./StateTests/stTransactionTest')
},
VMTests: {
+ vmRandom: require('./VMTests/RandomTests/randomTest'),
vmArithmeticTest: require('./VMTests/vmArithmeticTest'),
vmBitwiseLogicOperationTest: require('./VMTests/vmBitwiseLogicOperationTest'),
vmBlockInfoTest: require('./VMTests/vmBlockInfoTest'),
@@ -22,6 +27,6 @@ module.exports = {
vmLogTest: require('./VMTests/vmLogTest'),
vmPushDupSwapTest: require('./VMTests/vmPushDupSwapTest'),
vmSha3Test: require('./VMTests/vmSha3Test'),
- vmtests: require('./VMTests/vmtests'),
+ vmtests: require('./VMTests/vmtests')
}
};
diff --git a/tests/helper/vm.go b/tests/helper/vm.go
index 0c77e87fb..11bcedc49 100644
--- a/tests/helper/vm.go
+++ b/tests/helper/vm.go
@@ -44,6 +44,7 @@ func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues
env.time = ethutil.Big(envValues["currentTimestamp"]).Int64()
env.difficulty = ethutil.Big(envValues["currentDifficulty"])
env.gasLimit = ethutil.Big(envValues["currentGasLimit"])
+ env.Gas = new(big.Int)
return env
}
@@ -110,7 +111,7 @@ func RunVm(state *state.StateDB, env, exec map[string]string) ([]byte, state.Log
return ret, vmenv.logs, vmenv.Gas, err
}
-func RunState(state *state.StateDB, env, tx map[string]string) ([]byte, state.Logs, *big.Int, error) {
+func RunState(statedb *state.StateDB, env, tx map[string]string) ([]byte, state.Logs, *big.Int, error) {
var (
keyPair, _ = crypto.NewKeyPairFromSec([]byte(ethutil.Hex2Bytes(tx["secretKey"])))
to = FromHex(tx["to"])
@@ -118,13 +119,39 @@ func RunState(state *state.StateDB, env, tx map[string]string) ([]byte, state.Lo
gas = ethutil.Big(tx["gasLimit"])
price = ethutil.Big(tx["gasPrice"])
value = ethutil.Big(tx["value"])
+ caddr = FromHex(env["currentCoinbase"])
)
- caller := state.GetOrNewStateObject(keyPair.Address())
+ coinbase := statedb.GetOrNewStateObject(caddr)
+ coinbase.SetGasPool(ethutil.Big(env["currentGasLimit"]))
- vmenv := NewEnvFromMap(state, env, tx)
- vmenv.origin = caller.Address()
- ret, err := vmenv.Call(caller, to, data, gas, price, value)
+ message := NewMessage(keyPair.Address(), to, data, value, gas, price)
+ Log.DebugDetailf("message{ to: %x, from %x, value: %v, gas: %v, price: %v }\n", message.to[:4], message.from[:4], message.value, message.gas, message.price)
+ st := core.NewStateTransition(coinbase, message, statedb, nil)
+ vmenv := NewEnvFromMap(statedb, env, tx)
+ vmenv.origin = keyPair.Address()
+ st.Env = vmenv
+ ret, err := st.TransitionState()
+ statedb.Update(vmenv.Gas)
return ret, vmenv.logs, vmenv.Gas, err
}
+
+type Message struct {
+ from, to []byte
+ value, gas, price *big.Int
+ data []byte
+}
+
+func NewMessage(from, to, data []byte, value, gas, price *big.Int) Message {
+ return Message{from, to, value, gas, price, data}
+}
+
+func (self Message) Hash() []byte { return nil }
+func (self Message) From() []byte { return self.from }
+func (self Message) To() []byte { return self.to }
+func (self Message) GasPrice() *big.Int { return self.price }
+func (self Message) Gas() *big.Int { return self.gas }
+func (self Message) Value() *big.Int { return self.value }
+func (self Message) Nonce() uint64 { return 0 }
+func (self Message) Data() []byte { return self.data }
diff --git a/tests/vm/gh_test.go b/tests/vm/gh_test.go
index da5a41251..1efda7fe0 100644
--- a/tests/vm/gh_test.go
+++ b/tests/vm/gh_test.go
@@ -8,6 +8,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/tests/helper"
)
@@ -81,6 +82,9 @@ func RunVmTest(p string, t *testing.T) {
for addr, account := range test.Pre {
obj := StateObjectFromAccount(addr, account)
statedb.SetStateObject(obj)
+ for a, v := range account.Storage {
+ obj.SetState(helper.FromHex(a), ethutil.NewValue(helper.FromHex(v)))
+ }
}
// XXX Yeah, yeah...
@@ -129,6 +133,16 @@ func RunVmTest(p string, t *testing.T) {
for addr, account := range test.Post {
obj := statedb.GetStateObject(helper.FromHex(addr))
+ if obj == nil {
+ continue
+ }
+
+ if len(test.Exec) == 0 {
+ if obj.Balance().Cmp(ethutil.Big(account.Balance)) != 0 {
+ t.Errorf("%s's : (%x) balance failed. Expected %v, got %v => %v\n", name, obj.Address()[:4], account.Balance, obj.Balance(), new(big.Int).Sub(ethutil.Big(account.Balance), obj.Balance()))
+ }
+ }
+
for addr, value := range account.Storage {
v := obj.GetState(helper.FromHex(addr)).Bytes()
vexp := helper.FromHex(value)
@@ -149,6 +163,7 @@ func RunVmTest(p string, t *testing.T) {
}
}
}
+ logger.Flush()
}
// I've created a new function for each tests so it's easier to identify where the problem lies if any of them fail.
@@ -212,7 +227,12 @@ func TestStateRecursiveCreate(t *testing.T) {
RunVmTest(fn, t)
}
-func TestStateSpecialTest(t *testing.T) {
+func TestStateSpecial(t *testing.T) {
const fn = "../files/StateTests/stSpecialTest.json"
RunVmTest(fn, t)
}
+
+func TestStateRefund(t *testing.T) {
+ const fn = "../files/StateTests/stRefundTest.json"
+ RunVmTest(fn, t)
+}
diff --git a/vm/common.go b/vm/common.go
index 3d6d377ca..529bbdeb1 100644
--- a/vm/common.go
+++ b/vm/common.go
@@ -37,7 +37,7 @@ var (
GasLog = big.NewInt(32)
GasSha256 = big.NewInt(50)
GasRipemd = big.NewInt(50)
- GasEcrecover = big.NewInt(100)
+ GasEcrecover = big.NewInt(500)
Pow256 = ethutil.BigPow(2, 256)
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index 9da832a79..708aada5b 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -2,6 +2,7 @@ package vm
import (
"fmt"
+ "math"
"math/big"
"github.com/ethereum/go-ethereum/crypto"
@@ -112,7 +113,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
return closure.Return(nil), nil
}
- vmlogger.Debugf("(%d) %x gas: %v (d) %x\n", self.env.Depth(), closure.Address(), closure.Gas, callData)
+ vmlogger.Debugf("(%d) (%x) %x gas: %v (d) %x\n", self.env.Depth(), caller.Address()[:4], closure.Address(), closure.Gas, callData)
for {
prevStep = step
@@ -180,16 +181,17 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
var mult *big.Int
y, x := stack.Peekn()
- val := closure.GetStorage(x)
- if val.BigInt().Cmp(ethutil.Big0) == 0 && len(y.Bytes()) > 0 {
+ //val := closure.GetStorage(x)
+ val := statedb.GetState(closure.Address(), x.Bytes())
+ if len(val) == 0 && len(y.Bytes()) > 0 {
// 0 => non 0
mult = ethutil.Big3
- } else if val.BigInt().Cmp(ethutil.Big0) != 0 && len(y.Bytes()) == 0 {
- statedb.Refund(closure.caller.Address(), GasSStoreRefund, closure.Price)
+ } else if len(val) > 0 && len(y.Bytes()) == 0 {
+ statedb.Refund(caller.Address(), GasSStoreRefund)
mult = ethutil.Big0
} else {
- // non 0 => non 0
+ // non 0 => non 0 (or 0 => 0)
mult = ethutil.Big1
}
gas.Set(new(big.Int).Mul(mult, GasSStore))
@@ -660,7 +662,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
cOff = 0
l = 0
} else if cOff+l > size {
- l = 0
+ l = uint64(math.Min(float64(cOff+l), float64(size)))
}
codeCopy := code[cOff : cOff+l]
@@ -776,10 +778,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
val, loc := stack.Popn()
statedb.SetState(closure.Address(), loc.Bytes(), val)
- // Debug sessions are allowed to run without message
- if closure.message != nil {
- closure.message.AddStorageChange(loc.Bytes())
- }
+ closure.message.AddStorageChange(loc.Bytes())
self.Printf(" {0x%x : 0x%x}", loc.Bytes(), val.Bytes())
case JUMP:
@@ -898,10 +897,12 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
return closure.Return(ret), nil
case SUICIDE:
-
receiver := statedb.GetOrNewStateObject(stack.Pop().Bytes())
+ balance := statedb.GetBalance(closure.Address())
+
+ self.Printf(" => (%x) %v", receiver.Address()[:4], balance)
- receiver.AddAmount(statedb.GetBalance(closure.Address()))
+ receiver.AddAmount(balance)
statedb.Delete(closure.Address())
fallthrough
diff --git a/xeth/hexface.go b/xeth/hexface.go
index dfb0a9fd8..6c084f947 100644
--- a/xeth/hexface.go
+++ b/xeth/hexface.go
@@ -211,7 +211,7 @@ func (self *JSXEth) Transact(key, toStr, valueStr, gasStr, gasPriceStr, codeStr
return "", err
}
if types.IsContractAddr(to) {
- return ethutil.Bytes2Hex(tx.CreationAddress(nil)), nil
+ return ethutil.Bytes2Hex(core.AddressFromMessage(tx)), nil
}
return ethutil.Bytes2Hex(tx.Hash()), nil
@@ -224,7 +224,7 @@ func (self *JSXEth) PushTx(txStr string) (*JSReceipt, error) {
return nil, err
}
- return NewJSReciept(tx.CreatesContract(), tx.CreationAddress(self.World().State()), tx.Hash(), tx.Sender()), nil
+ return NewJSReciept(core.MessageCreatesContract(tx), core.AddressFromMessage(tx), tx.Hash(), tx.From()), nil
}
func (self *JSXEth) CompileMutan(code string) string {
diff --git a/xeth/js_types.go b/xeth/js_types.go
index 1d9faa190..987edce37 100644
--- a/xeth/js_types.go
+++ b/xeth/js_types.go
@@ -96,21 +96,21 @@ type JSTransaction struct {
func NewJSTx(tx *types.Transaction, state *state.StateDB) *JSTransaction {
hash := ethutil.Bytes2Hex(tx.Hash())
- receiver := ethutil.Bytes2Hex(tx.Recipient)
+ receiver := ethutil.Bytes2Hex(tx.To())
if receiver == "0000000000000000000000000000000000000000" {
- receiver = ethutil.Bytes2Hex(tx.CreationAddress(state))
+ receiver = ethutil.Bytes2Hex(core.AddressFromMessage(tx))
}
sender := ethutil.Bytes2Hex(tx.Sender())
- createsContract := tx.CreatesContract()
+ createsContract := core.MessageCreatesContract(tx)
var data string
- if tx.CreatesContract() {
- data = strings.Join(core.Disassemble(tx.Data), "\n")
+ if createsContract {
+ data = strings.Join(core.Disassemble(tx.Data()), "\n")
} else {
- data = ethutil.Bytes2Hex(tx.Data)
+ data = ethutil.Bytes2Hex(tx.Data())
}
- return &JSTransaction{ref: tx, Hash: hash, Value: ethutil.CurrencyToString(tx.Value), Address: receiver, Contract: tx.CreatesContract(), Gas: tx.Gas.String(), GasPrice: tx.GasPrice.String(), Data: data, Sender: sender, CreatesContract: createsContract, RawData: ethutil.Bytes2Hex(tx.Data)}
+ return &JSTransaction{ref: tx, Hash: hash, Value: ethutil.CurrencyToString(tx.Value()), Address: receiver, Contract: createsContract, Gas: tx.Gas().String(), GasPrice: tx.GasPrice().String(), Data: data, Sender: sender, CreatesContract: createsContract, RawData: ethutil.Bytes2Hex(tx.Data())}
}
func (self *JSTransaction) ToString() string {
diff --git a/xeth/pipe.go b/xeth/pipe.go
index 1e4d0ec60..06820cc86 100644
--- a/xeth/pipe.go
+++ b/xeth/pipe.go
@@ -134,7 +134,7 @@ func (self *XEth) Transact(key *crypto.KeyPair, to []byte, value, gas, price *et
state := self.chainManager.TransState()
nonce := state.GetNonce(key.Address())
- tx.Nonce = nonce
+ tx.SetNonce(nonce)
tx.Sign(key.PrivateKey)
// Do some pre processing for our "pre" events and hooks
@@ -150,7 +150,7 @@ func (self *XEth) Transact(key *crypto.KeyPair, to []byte, value, gas, price *et
state.SetNonce(key.Address(), nonce+1)
if contractCreation {
- addr := tx.CreationAddress(self.World().State())
+ addr := core.AddressFromMessage(tx)
pipelogger.Infof("Contract addr %x\n", addr)
}
@@ -163,8 +163,8 @@ func (self *XEth) PushTx(tx *types.Transaction) ([]byte, error) {
return nil, err
}
- if tx.Recipient == nil {
- addr := tx.CreationAddress(self.World().State())
+ if tx.To() == nil {
+ addr := core.AddressFromMessage(tx)
pipelogger.Infof("Contract addr %x\n", addr)
return addr, nil
}