diff options
author | Sonic <sonic@dexon.org> | 2019-05-08 18:28:10 +0800 |
---|---|---|
committer | Sonic <sonic@dexon.org> | 2019-05-08 18:28:10 +0800 |
commit | 613d4ca4e17de31fce483378192e8e9fbf28be59 (patch) | |
tree | 2ecd8d714bb4cb506bcfce277c54066fee881ff9 /core | |
parent | 53db7e5a2ae7eb85fa5a2fc412d5746ef6f0f583 (diff) | |
download | dexon-613d4ca4e17de31fce483378192e8e9fbf28be59.tar dexon-613d4ca4e17de31fce483378192e8e9fbf28be59.tar.gz dexon-613d4ca4e17de31fce483378192e8e9fbf28be59.tar.bz2 dexon-613d4ca4e17de31fce483378192e8e9fbf28be59.tar.lz dexon-613d4ca4e17de31fce483378192e8e9fbf28be59.tar.xz dexon-613d4ca4e17de31fce483378192e8e9fbf28be59.tar.zst dexon-613d4ca4e17de31fce483378192e8e9fbf28be59.zip |
fixup! light: implement GetGovStateByNumber and InsertDexonHeaderChain (Stub)
Diffstat (limited to 'core')
-rw-r--r-- | core/headerchain.go | 4 | ||||
-rw-r--r-- | core/types.go | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/core/headerchain.go b/core/headerchain.go index ef77aa28a..62a2bf805 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -465,7 +465,7 @@ func (c *headerVerifierCache) configuration(round uint64) *params.DexconConfig { func (hc *HeaderChain) ValidateDexonHeaderChain(chain []*types.HeaderWithGovState, gov dexcon.GovernanceStateFetcher, - verifierCache *dexCore.TSigVerifierCache, validator Validator) (int, error) { + verifierCache *dexCore.TSigVerifierCache, validator HeaderValidator) (int, error) { // Do a sanity check that the provided chain is actually ordered and linked for i := 1; i < len(chain); i++ { if chain[i].Number.Uint64() != chain[i-1].Number.Uint64()+1 || chain[i].ParentHash != chain[i-1].Hash() { @@ -534,7 +534,7 @@ func (hc *HeaderChain) ValidateDexonHeaderChain(chain []*types.HeaderWithGovStat func (hc *HeaderChain) VerifyDexonHeader(header *types.Header, gov dexcon.GovernanceStateFetcher, - verifierCache *dexCore.TSigVerifierCache, validator Validator) error { + verifierCache *dexCore.TSigVerifierCache, validator HeaderValidator) error { if parent := hc.GetHeader(header.ParentHash, header.Number.Uint64()-1); parent == nil { return consensus.ErrUnknownAncestor diff --git a/core/types.go b/core/types.go index 04a787b1e..8369f2328 100644 --- a/core/types.go +++ b/core/types.go @@ -39,6 +39,10 @@ type Validator interface { ValidateWitnessData(height uint64, data common.Hash) error } +type HeaderValidator interface { + ValidateWitnessData(height uint64, data common.Hash) error +} + // Processor is an interface for processing blocks using a given initial state. // // Process takes the block to be processed and the statedb upon which the |