diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-29 17:34:40 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-29 17:34:40 +0800 |
commit | fb4113dab4df8480c77bdcb707fa6b5408755b79 (patch) | |
tree | b369bb26e7b96826120fb08ff61739326add0e92 /ethtrie/trie.go | |
parent | 665a44646e9453e37c8a73bdd2c94ba7dc1e7c0a (diff) | |
download | go-tangerine-fb4113dab4df8480c77bdcb707fa6b5408755b79.tar.gz go-tangerine-fb4113dab4df8480c77bdcb707fa6b5408755b79.tar.zst go-tangerine-fb4113dab4df8480c77bdcb707fa6b5408755b79.zip |
PoC 7 updates
* Bloom
* Block restructure
* Receipts
Diffstat (limited to 'ethtrie/trie.go')
-rw-r--r-- | ethtrie/trie.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ethtrie/trie.go b/ethtrie/trie.go index 686971985..9bbe111d2 100644 --- a/ethtrie/trie.go +++ b/ethtrie/trie.go @@ -219,6 +219,17 @@ func (t *Trie) Delete(key string) { } } +func (self *Trie) GetRoot() []byte { + switch self.Root.(type) { + case string: + return []byte(self.Root.(string)) + case []byte: + return self.Root.([]byte) + default: + panic(fmt.Sprintf("invalid root type %T", self.Root)) + } +} + // Simple compare function which creates a rlp value out of the evaluated objects func (t *Trie) Cmp(trie *Trie) bool { return ethutil.NewValue(t.Root).Cmp(ethutil.NewValue(trie.Root)) |