Roy Crihfield
ebc2eb37e7
* refactor packages, flags, subscriptions * DRY refactor builder tests * use mockgen to generate mocks * update README * MODE=statediff no longer needed for unit tests * simplify func names, clean up metrics * move write params to service field * sql indexer: confirm quit after ipld cache reset prevents negative waitgroup panic * don't let TotalDifficulty become nil * use forked plugeth, plugeth-utils for now
29 lines
627 B
Go
29 lines
627 B
Go
package utils
|
|
|
|
import (
|
|
"github.com/openrelayxyz/plugeth-utils/core"
|
|
plugeth_types "github.com/openrelayxyz/plugeth-utils/restricted/types"
|
|
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
)
|
|
|
|
type adaptTrieHasher struct {
|
|
types.TrieHasher
|
|
}
|
|
|
|
func AdaptTrieHasher(th types.TrieHasher) plugeth_types.TrieHasher {
|
|
return &adaptTrieHasher{th}
|
|
}
|
|
|
|
// TrieHasher is the tool used to calculate the hash of derivable list.
|
|
// This is internal, do not use.
|
|
type TrieHasher interface {
|
|
Reset()
|
|
Update([]byte, []byte) error
|
|
Hash() core.Hash
|
|
}
|
|
|
|
func (ath *adaptTrieHasher) Hash() core.Hash {
|
|
return core.Hash(ath.TrieHasher.Hash())
|
|
}
|