diff options
author | Felix Lange <fjl@twurst.com> | 2014-10-23 21:01:27 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2014-10-23 21:01:27 +0800 |
commit | 69baa465ea69ae60eed802445cf0132b9eb69934 (patch) | |
tree | b09da7582b5c4850d4db13aee808f2fef2f97de0 /pow/ar/pow_test.go | |
parent | 50fd46924900869e7210217c6a07979b544991c8 (diff) | |
parent | feef194829b07570e91873ed5d1e8cc51e8fa430 (diff) | |
download | dexon-69baa465ea69ae60eed802445cf0132b9eb69934.tar dexon-69baa465ea69ae60eed802445cf0132b9eb69934.tar.gz dexon-69baa465ea69ae60eed802445cf0132b9eb69934.tar.bz2 dexon-69baa465ea69ae60eed802445cf0132b9eb69934.tar.lz dexon-69baa465ea69ae60eed802445cf0132b9eb69934.tar.xz dexon-69baa465ea69ae60eed802445cf0132b9eb69934.tar.zst dexon-69baa465ea69ae60eed802445cf0132b9eb69934.zip |
Merge eth-go repository into go-ethereum
mist, etheruem have been moved to cmd/
Diffstat (limited to 'pow/ar/pow_test.go')
-rw-r--r-- | pow/ar/pow_test.go | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/pow/ar/pow_test.go b/pow/ar/pow_test.go new file mode 100644 index 000000000..3db9659e0 --- /dev/null +++ b/pow/ar/pow_test.go @@ -0,0 +1,47 @@ +package ar + +import ( + "fmt" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/ethtrie" +) + +type TestBlock struct { + trie *ethtrie.Trie +} + +func NewTestBlock() *TestBlock { + db, _ := ethdb.NewMemDatabase() + return &TestBlock{ + trie: ethtrie.New(db, ""), + } +} + +func (self *TestBlock) Diff() *big.Int { + return b(10) +} + +func (self *TestBlock) Trie() *ethtrie.Trie { + return self.trie +} + +func (self *TestBlock) Hash() []byte { + a := make([]byte, 32) + a[0] = 10 + a[1] = 2 + return a +} + +func TestPow(t *testing.T) { + entry := make([]byte, 32) + entry[0] = 255 + + block := NewTestBlock() + + pow := NewTape(block) + nonce := pow.Run(block.Hash()) + fmt.Println("Found nonce", nonce) +} |