aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-03-21 22:27:18 +0800
committerobscuren <geffobscura@gmail.com>2014-03-21 22:27:18 +0800
commit9a9e252cabdc6283d7f4e523860f0e4addf62152 (patch)
tree7bdbcab1d066d40861250af0c72446d88f946368 /ethchain
parent2ea4c632d1673b762c1af11582364d9faa08c413 (diff)
downloadgo-tangerine-9a9e252cabdc6283d7f4e523860f0e4addf62152.tar
go-tangerine-9a9e252cabdc6283d7f4e523860f0e4addf62152.tar.gz
go-tangerine-9a9e252cabdc6283d7f4e523860f0e4addf62152.tar.bz2
go-tangerine-9a9e252cabdc6283d7f4e523860f0e4addf62152.tar.lz
go-tangerine-9a9e252cabdc6283d7f4e523860f0e4addf62152.tar.xz
go-tangerine-9a9e252cabdc6283d7f4e523860f0e4addf62152.tar.zst
go-tangerine-9a9e252cabdc6283d7f4e523860f0e4addf62152.zip
Changes 'compiler' to work with any type
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/vm_test.go30
1 files changed, 14 insertions, 16 deletions
diff --git a/ethchain/vm_test.go b/ethchain/vm_test.go
index 16cbf51b7..047531e09 100644
--- a/ethchain/vm_test.go
+++ b/ethchain/vm_test.go
@@ -2,7 +2,6 @@ package ethchain
import (
"bytes"
- "fmt"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethutil"
"math/big"
@@ -130,27 +129,26 @@ func TestRun3(t *testing.T) {
})
tx := NewTransaction(ContractAddr, ethutil.Big("100000000000000000000000000000000000000000000000000"), script)
addr := tx.Hash()[12:]
- fmt.Printf("addr contract %x\n", addr)
contract := MakeContract(tx, state)
state.UpdateContract(contract)
- callerScript := Compile([]string{
- "PUSH", "1337", // Argument
- "PUSH", "65", // argument mem offset
+ callerScript := ethutil.Compile(
+ "PUSH", 1337, // Argument
+ "PUSH", 65, // argument mem offset
"MSTORE",
- "PUSH", "64", // ret size
- "PUSH", "0", // ret offset
-
- "PUSH", "32", // arg size
- "PUSH", "65", // arg offset
- "PUSH", "1000", /// Gas
- "PUSH", "0", /// value
- "PUSH", string(addr), // Sender
+ "PUSH", 64, // ret size
+ "PUSH", 0, // ret offset
+
+ "PUSH", 32, // arg size
+ "PUSH", 65, // arg offset
+ "PUSH", 1000, /// Gas
+ "PUSH", 0, /// value
+ "PUSH", addr, // Sender
"CALL",
- "PUSH", "64",
- "PUSH", "0",
+ "PUSH", 64,
+ "PUSH", 0,
"RETURN",
- })
+ )
callerTx := NewTransaction(ContractAddr, ethutil.Big("100000000000000000000000000000000000000000000000000"), callerScript)
// Contract addr as test address