diff options
author | obscuren <obscuren@obscura.com> | 2014-01-03 06:02:24 +0800 |
---|---|---|
committer | obscuren <obscuren@obscura.com> | 2014-01-03 06:02:24 +0800 |
commit | 9df4c745119b3ed10a7ad17887e8dd9cac249af7 (patch) | |
tree | 8ae82afaf78a225d685a146a4cc67a77d3ca773d /testing.go | |
parent | 5b3d4fae6e03e5471a10c653fc0b016cc5e5dcfa (diff) | |
download | go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.gz go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.bz2 go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.lz go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.xz go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.zst go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.zip |
WIP rewrite vm
Diffstat (limited to 'testing.go')
-rw-r--r-- | testing.go | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/testing.go b/testing.go index 5d0b818a9..07e8c362f 100644 --- a/testing.go +++ b/testing.go @@ -4,22 +4,17 @@ import ( "fmt" ) +// This will eventually go away +var Db *MemDatabase + func Testing() { + db, _ := NewMemDatabase() + Db = db + bm := NewBlockManager() tx := NewTransaction("\x00", 20, []string{ - "SET 10 6", - "LD 10 10", - "LT 10 1 20", - "SET 255 7", - "JMPI 20 255", - "STOP", - "SET 30 200", - "LD 30 31", - "SET 255 22", - "JMPI 31 255", - "SET 255 15", - "JMP 255", + "PSH 10", }) txData := tx.MarshalRlp() @@ -28,9 +23,9 @@ func Testing() { tx2 := NewTransaction("\x00", 20, []string{"SET 10 6", "LD 10 10"}) - blck := CreateBlock([]*Transaction{tx2, tx}) + blck := CreateTestBlock([]*Transaction{tx2, tx}) bm.ProcessBlock( blck ) - fmt.Println("GenesisBlock:", GenisisBlock, "hashed", GenisisBlock.Hash()) + fmt.Println("GenesisBlock:", GenisisBlock, "hash", string(GenisisBlock.Hash())) } |