diff options
author | Felix Lange <fjl@twurst.com> | 2015-03-18 20:24:34 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-03-18 20:24:34 +0800 |
commit | c298148a7f0890cd5ed62d2a91cc81431b2731f1 (patch) | |
tree | 030a2507b92ef01a285ebec082cf57e0ce95775a /core/types/derive_sha.go | |
parent | b94a6a0193884ba2edb8eb38670e51b033893387 (diff) | |
download | go-tangerine-c298148a7f0890cd5ed62d2a91cc81431b2731f1.tar go-tangerine-c298148a7f0890cd5ed62d2a91cc81431b2731f1.tar.gz go-tangerine-c298148a7f0890cd5ed62d2a91cc81431b2731f1.tar.bz2 go-tangerine-c298148a7f0890cd5ed62d2a91cc81431b2731f1.tar.lz go-tangerine-c298148a7f0890cd5ed62d2a91cc81431b2731f1.tar.xz go-tangerine-c298148a7f0890cd5ed62d2a91cc81431b2731f1.tar.zst go-tangerine-c298148a7f0890cd5ed62d2a91cc81431b2731f1.zip |
core/types: use package rlp instead of common.Decode
Diffstat (limited to 'core/types/derive_sha.go')
-rw-r--r-- | core/types/derive_sha.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/types/derive_sha.go b/core/types/derive_sha.go index 0fc45a508..10e3d7446 100644 --- a/core/types/derive_sha.go +++ b/core/types/derive_sha.go @@ -3,6 +3,7 @@ package types import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" ) @@ -15,7 +16,8 @@ func DeriveSha(list DerivableList) common.Hash { db, _ := ethdb.NewMemDatabase() trie := trie.New(nil, db) for i := 0; i < list.Len(); i++ { - trie.Update(common.Encode(i), list.GetRlp(i)) + key, _ := rlp.EncodeToBytes(i) + trie.Update(key, list.GetRlp(i)) } return common.BytesToHash(trie.Root()) |