github.com/annchain/OG@v0.0.9/og/verifier/consensus_verifier.go (about)

     1  package verifier
     2  
     3  import (
     4  	"github.com/annchain/OG/consensus/campaign"
     5  	"github.com/annchain/OG/og/types"
     6  )
     7  
     8  //consensus related verification
     9  type ConsensusVerifier struct {
    10  	VerifyCampaign   func(cp *campaign.Campaign) bool
    11  	VerifyTermChange func(cp *campaign.TermChange) bool
    12  	VerifySequencer  func(cp *types.Sequencer) bool
    13  }
    14  
    15  func (c *ConsensusVerifier) Verify(t types.Txi) bool {
    16  	// TODO: verify consensus
    17  	//switch tx := t.(type) {
    18  	//case *types.Tx:
    19  	//	return true
    20  	//case *types.Archive:
    21  	//	return true
    22  	//case *types.ActionTx:
    23  	//	return true
    24  	//case *types.Sequencer:
    25  	//	return c.VerifySequencer(tx)
    26  	//case *campaign.Campaign:
    27  	//	return c.VerifyCampaign(tx)
    28  	//case *campaign.TermChange:
    29  	//	return c.VerifyTermChange(tx)
    30  	//default:
    31  	//	return false
    32  	//}
    33  	//return false
    34  	return true
    35  
    36  }
    37  
    38  func (c *ConsensusVerifier) Name() string {
    39  	return "ConsensusVerifier"
    40  }
    41  
    42  func (v *ConsensusVerifier) Independent() bool {
    43  	return false
    44  }
    45  
    46  func (c *ConsensusVerifier) String() string {
    47  	return c.Name()
    48  }