aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/vm_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-04-18 19:41:07 +0800
committerobscuren <geffobscura@gmail.com>2014-04-18 19:41:07 +0800
commita96c8c8af969665cc0c357eef81d43b5b7285dfe (patch)
tree6578941fc1b32f848e65ef763a0ce7315ec6d850 /ethchain/vm_test.go
parentc5729d7ecc564f8eff6df565173a4f5cc6c43cb0 (diff)
downloadgo-tangerine-a96c8c8af969665cc0c357eef81d43b5b7285dfe.tar
go-tangerine-a96c8c8af969665cc0c357eef81d43b5b7285dfe.tar.gz
go-tangerine-a96c8c8af969665cc0c357eef81d43b5b7285dfe.tar.bz2
go-tangerine-a96c8c8af969665cc0c357eef81d43b5b7285dfe.tar.lz
go-tangerine-a96c8c8af969665cc0c357eef81d43b5b7285dfe.tar.xz
go-tangerine-a96c8c8af969665cc0c357eef81d43b5b7285dfe.tar.zst
go-tangerine-a96c8c8af969665cc0c357eef81d43b5b7285dfe.zip
Added proper gas handling
Diffstat (limited to 'ethchain/vm_test.go')
-rw-r--r--ethchain/vm_test.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/ethchain/vm_test.go b/ethchain/vm_test.go
index a0add9532..f66f2a896 100644
--- a/ethchain/vm_test.go
+++ b/ethchain/vm_test.go
@@ -91,10 +91,10 @@ func TestRun4(t *testing.T) {
exit()
`), false)
script := ethutil.Assemble(asm...)
- tx := NewContractCreationTx(ethutil.Big("0"), ethutil.Big("1000"), script)
+ tx := NewContractCreationTx(ethutil.Big("0"), ethutil.Big("1000"), script, nil)
addr := tx.Hash()[12:]
contract := MakeContract(tx, state)
- state.UpdateContract(contract)
+ state.UpdateStateObject(contract)
fmt.Printf("%x\n", addr)
asm, err = mutan.Compile(strings.NewReader(`
@@ -122,12 +122,13 @@ func TestRun4(t *testing.T) {
fmt.Println(asm)
callerScript := ethutil.Assemble(asm...)
- callerTx := NewContractCreationTx(ethutil.Big("0"), ethutil.Big("1000"), callerScript)
+ callerTx := NewContractCreationTx(ethutil.Big("0"), ethutil.Big("1000"), callerScript, nil)
// Contract addr as test address
account := NewAccount(ContractAddr, big.NewInt(10000000))
+ fmt.Println(account)
c := MakeContract(callerTx, state)
- callerClosure := NewClosure(account, c, c.script, state, big.NewInt(1000000000), new(big.Int))
+ callerClosure := NewClosure(account, c, c.script, state, big.NewInt(1000000000), big.NewInt(10), big.NewInt(0))
vm := NewVm(state, RuntimeVars{
Origin: account.Address(),
@@ -136,10 +137,12 @@ func TestRun4(t *testing.T) {
Coinbase: ethutil.FromHex("2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"),
Time: 1,
Diff: big.NewInt(256),
- // XXX Tx data? Could be just an argument to the closure instead
- TxData: nil,
})
- callerClosure.Call(vm, nil, nil)
+ _, e := callerClosure.Call(vm, nil, nil)
+ if e != nil {
+ fmt.Println("error", e)
+ }
+ fmt.Println(account)
}
func TestRun5(t *testing.T) {