aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/block_manager_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-19 18:35:17 +0800
committerobscuren <geffobscura@gmail.com>2014-02-19 18:35:17 +0800
commit24f2b2afc3a848190822c382e6aa31c8ab120f07 (patch)
tree827603f276bbcba1240f7f6760df48a0349f0286 /ethchain/block_manager_test.go
parentc866fcc5b37b53e0d11c1fd7e6cb971859537f2c (diff)
downloaddexon-24f2b2afc3a848190822c382e6aa31c8ab120f07.tar
dexon-24f2b2afc3a848190822c382e6aa31c8ab120f07.tar.gz
dexon-24f2b2afc3a848190822c382e6aa31c8ab120f07.tar.bz2
dexon-24f2b2afc3a848190822c382e6aa31c8ab120f07.tar.lz
dexon-24f2b2afc3a848190822c382e6aa31c8ab120f07.tar.xz
dexon-24f2b2afc3a848190822c382e6aa31c8ab120f07.tar.zst
dexon-24f2b2afc3a848190822c382e6aa31c8ab120f07.zip
Running contracts fixed
Diffstat (limited to 'ethchain/block_manager_test.go')
-rw-r--r--ethchain/block_manager_test.go74
1 files changed, 14 insertions, 60 deletions
diff --git a/ethchain/block_manager_test.go b/ethchain/block_manager_test.go
index 502c50b97..ae29e2e25 100644
--- a/ethchain/block_manager_test.go
+++ b/ethchain/block_manager_test.go
@@ -1,75 +1,29 @@
package ethchain
-/*
import (
_ "fmt"
+ "github.com/ethereum/eth-go/ethdb"
+ "github.com/ethereum/eth-go/ethutil"
+ "math/big"
"testing"
)
func TestVm(t *testing.T) {
InitFees()
+ ethutil.ReadConfig("")
- db, _ := NewMemDatabase()
- Db = db
+ db, _ := ethdb.NewMemDatabase()
+ ethutil.Config.Db = db
+ bm := NewBlockManager(nil)
- ctrct := NewTransaction("", 200000000, []string{
- "PUSH", "1a2f2e",
- "PUSH", "hallo",
- "POP", // POP hallo
- "PUSH", "3",
- "LOAD", // Load hallo back on the stack
-
- "PUSH", "1",
- "PUSH", "2",
- "ADD",
-
- "PUSH", "2",
- "PUSH", "1",
- "SUB",
-
- "PUSH", "100000000000000000000000",
- "PUSH", "10000000000000",
- "SDIV",
-
- "PUSH", "105",
- "PUSH", "200",
- "MOD",
-
- "PUSH", "100000000000000000000000",
- "PUSH", "10000000000000",
- "SMOD",
-
- "PUSH", "5",
- "PUSH", "10",
- "LT",
-
- "PUSH", "5",
- "PUSH", "5",
- "LE",
-
- "PUSH", "50",
- "PUSH", "5",
- "GT",
-
- "PUSH", "5",
- "PUSH", "5",
- "GE",
-
- "PUSH", "10",
- "PUSH", "10",
- "NOT",
-
- "MYADDRESS",
- "TXSENDER",
+ block := bm.bc.genesisBlock
+ ctrct := NewTransaction(ContractAddr, big.NewInt(200000000), []string{
+ "PUSH",
+ "1",
+ "PUSH",
+ "2",
"STOP",
})
- tx := NewTransaction("1e8a42ea8cce13", 100, []string{})
-
- block := CreateBlock("", 0, "", "c014ba53", 0, 0, "", []*Transaction{ctrct, tx})
- db.Put(block.Hash(), block.RlpEncode())
-
- bm := NewBlockManager()
- bm.ProcessBlock(block)
+ bm.ApplyTransactions(block, []*Transaction{ctrct})
}
-*/