aboutsummaryrefslogtreecommitdiffstats
path: root/vm_test.go
blob: d0bcda2cab1b0a1316c427eb62f10d69a2facc0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main

import (
  "fmt"
  "testing"
  _"encoding/hex"
)


func TestVm(t *testing.T) {
  db, _ := NewMemDatabase()
  Db = db

  tx := NewTransaction("\x00", 20, []string{
    "PSH 10",
  })

  block := CreateBlock("", 0, "", "", 0, 0, "", []*Transaction{tx})
  db.Put(block.Hash(), block.MarshalRlp())

  bm := NewBlockManager()
  bm.ProcessBlock( block )
  tx1 := &Transaction{}
  tx1.UnmarshalRlp([]byte(block.state.Get(tx.recipient)))
  fmt.Println(tx1)
}