Wip VM. Created contracts
This commit is contained in:
@ -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))))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user