trie: remove dependency on package crypto
Package crypto needs cgo, which is inconvenient for some build configurations.
This commit is contained in:
parent
4e8cec05ab
commit
ba8c4c6b1a
@ -22,7 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto/sha3"
|
||||||
"github.com/ethereum/go-ethereum/logger"
|
"github.com/ethereum/go-ethereum/logger"
|
||||||
"github.com/ethereum/go-ethereum/logger/glog"
|
"github.com/ethereum/go-ethereum/logger/glog"
|
||||||
)
|
)
|
||||||
@ -30,11 +30,14 @@ import (
|
|||||||
var (
|
var (
|
||||||
// This is the known root hash of an empty trie.
|
// This is the known root hash of an empty trie.
|
||||||
emptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
|
emptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
|
||||||
|
|
||||||
// This is the known hash of an empty state trie entry.
|
// This is the known hash of an empty state trie entry.
|
||||||
emptyState = crypto.Keccak256Hash(nil)
|
emptyState common.Hash
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
sha3.NewKeccak256().Sum(emptyState[:0])
|
||||||
|
}
|
||||||
|
|
||||||
// Database must be implemented by backing stores for the trie.
|
// Database must be implemented by backing stores for the trie.
|
||||||
type Database interface {
|
type Database interface {
|
||||||
DatabaseWriter
|
DatabaseWriter
|
||||||
|
Loading…
Reference in New Issue
Block a user