From 613d4ca4e17de31fce483378192e8e9fbf28be59 Mon Sep 17 00:00:00 2001 From: Sonic Date: Wed, 8 May 2019 18:28:10 +0800 Subject: fixup! light: implement GetGovStateByNumber and InsertDexonHeaderChain (Stub) --- core/headerchain.go | 4 ++-- core/types.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'core') 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 -- cgit v1.2.3