From 7cd41ac45aed7ee22ef02f8abedf83a2914c4807 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 3 Jan 2014 00:43:49 +0100 Subject: Wip VM. Created contracts --- vm_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'vm_test.go') diff --git a/vm_test.go b/vm_test.go index d0bcda2ca..00b8809a1 100644 --- a/vm_test.go +++ b/vm_test.go @@ -3,7 +3,6 @@ package main import ( "fmt" "testing" - _"encoding/hex" ) @@ -11,7 +10,7 @@ func TestVm(t *testing.T) { db, _ := NewMemDatabase() Db = db - tx := NewTransaction("\x00", 20, []string{ + tx := NewTransaction("", 20, []string{ "PSH 10", }) @@ -20,8 +19,8 @@ func TestVm(t *testing.T) { bm := NewBlockManager() bm.ProcessBlock( block ) - tx1 := &Transaction{} - tx1.UnmarshalRlp([]byte(block.state.Get(tx.recipient))) - fmt.Println(tx1) + contract := block.GetContract(tx.Hash()) + fmt.Println(contract) + fmt.Println("it is", contract.state.Get(string(Encode(0)))) } -- cgit v1.2.3