diff options
author | obscuren <geffobscura@gmail.com> | 2014-01-11 05:44:53 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-01-11 05:44:53 +0800 |
commit | 8bbf879cb31e9cb28700773ed788421f9935ac36 (patch) | |
tree | ea2ab662a0577aa6238b084eda7ec9644ee35995 /dev_console.go | |
parent | f6fa4f88797030b8e83066cb262a68958953974e (diff) | |
download | go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.gz go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.bz2 go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.lz go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.xz go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.zst go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.zip |
Moving the ethgo to individual packages
Diffstat (limited to 'dev_console.go')
-rw-r--r-- | dev_console.go | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/dev_console.go b/dev_console.go index 65166c0c1..27fc2e65e 100644 --- a/dev_console.go +++ b/dev_console.go @@ -7,16 +7,18 @@ import ( "os" "errors" "encoding/hex" + "github.com/ethereum/ethdb-go" + "github.com/ethereum/ethutil-go" ) type Console struct { - db *MemDatabase - trie *Trie + db *ethdb.MemDatabase + trie *ethutil.Trie } func NewConsole() *Console { - db, _ := NewMemDatabase() - trie := NewTrie(db, "") + db, _ := ethdb.NewMemDatabase() + trie := ethutil.NewTrie(db, "") return &Console{db: db, trie: trie} } @@ -68,17 +70,19 @@ func (i *Console) ParseInput(input string) bool { case "update": i.trie.Update(tokens[1], tokens[2]) - fmt.Println(hex.EncodeToString([]byte(i.trie.root))) + fmt.Println(hex.EncodeToString([]byte(i.trie.Root))) case "get": fmt.Println(i.trie.Get(tokens[1])) case "root": - fmt.Println(hex.EncodeToString([]byte(i.trie.root))) + fmt.Println(hex.EncodeToString([]byte(i.trie.Root))) case "rawroot": - fmt.Println(i.trie.root) + fmt.Println(i.trie.Root) case "print": i.db.Print() case "dag": - fmt.Println(DaggerVerify(Big(tokens[1]), BigPow(2, 36), Big(tokens[2]))) + fmt.Println(DaggerVerify( ethutil.Big(tokens[1]), // hash + ethutil.BigPow(2, 36), // diff + ethutil.Big(tokens[2])))// nonce case "exit", "quit", "q": return false case "help": |