aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/vm_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-03-21 06:38:16 +0800
committerobscuren <geffobscura@gmail.com>2014-03-21 06:38:16 +0800
commitf567f89b994bf28f908410223084a6702d05d156 (patch)
tree1ec45639e8ec6787d1d97ec59c2bd78a7f90d9b0 /ethchain/vm_test.go
parent7705b23f248156878d00c301fbbadafedaf7e3d2 (diff)
downloadgo-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar
go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.gz
go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.bz2
go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.lz
go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.xz
go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.zst
go-tangerine-f567f89b994bf28f908410223084a6702d05d156.zip
Added address to account and contract
Contract and account now both have an address field or method for the sake of simplicity.
Diffstat (limited to 'ethchain/vm_test.go')
-rw-r--r--ethchain/vm_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/ethchain/vm_test.go b/ethchain/vm_test.go
index 30c8a110e..1dca5cfb7 100644
--- a/ethchain/vm_test.go
+++ b/ethchain/vm_test.go
@@ -130,7 +130,7 @@ func TestRun3(t *testing.T) {
addr := tx.Hash()[12:]
fmt.Printf("addr contract %x\n", addr)
contract := MakeContract(tx, state)
- state.UpdateContract(addr, contract)
+ state.UpdateContract(contract)
callerScript := Compile([]string{
"PUSH", "62", // ret size
@@ -143,21 +143,20 @@ func TestRun3(t *testing.T) {
"CALL",
})
callerTx := NewTransaction(ContractAddr, ethutil.Big("100000000000000000000000000000000000000000000000000"), callerScript)
- callerAddr := callerTx.Hash()[12:]
+ // Contract addr as test address
account := NewAccount(ContractAddr, big.NewInt(10000000))
callerClosure := NewClosure(account, MakeContract(callerTx, state), state, big.NewInt(1000000000), new(big.Int))
vm := NewVm(state, RuntimeVars{
- address: callerAddr,
+ origin: account.Address,
blockNumber: 1,
- sender: ethutil.FromHex("cd1722f3947def4cf144679da39c4c32bdc35681"),
prevHash: ethutil.FromHex("5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"),
coinbase: ethutil.FromHex("2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"),
time: 1,
diff: big.NewInt(256),
- txValue: big.NewInt(10000),
- txData: nil,
+ // XXX Tx data? Could be just an argument to the closure instead
+ txData: nil,
})
callerClosure.Call(vm, nil)
}