From fb4113dab4df8480c77bdcb707fa6b5408755b79 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 29 Oct 2014 10:34:40 +0100 Subject: PoC 7 updates * Bloom * Block restructure * Receipts --- ethtrie/trie.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ethtrie') 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)) -- cgit v1.2.3