Wip VM. Created contracts

This commit is contained in:
obscuren
2014-01-03 00:43:49 +01:00
parent 9df4c74511
commit 7cd41ac45a
6 changed files with 80 additions and 18 deletions

View File

@ -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))))
}