Documentation ¶
Index ¶
- Variables
- type Config
- func (c *Config) GetNetwork() specqbft.Network
- func (c *Config) GetProposerF() specqbft.ProposerF
- func (c *Config) GetSignatureDomainType() spectypes.DomainType
- func (c *Config) GetSigner() spectypes.SSVSigner
- func (c *Config) GetSigningPubKey() []byte
- func (c *Config) GetStorage() qbftstorage.QBFTStore
- func (c *Config) GetTimer() specqbft.Timer
- func (c *Config) GetValueCheckF() specqbft.ProposedValueCheckF
- type IConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var SignMsg = func(sk *bls.SecretKey, id types.OperatorID, msg *specqbft.Message) *specqbft.SignedMessage { domain := types.PrimusTestnet sigType := types.QBFTSignatureType r, _ := types.ComputeSigningRoot(msg, types.ComputeSignatureDomain(domain, sigType)) sig := sk.SignByte(r) return &specqbft.SignedMessage{ Message: msg, Signers: []types.OperatorID{id}, Signature: sig.Serialize(), } }
View Source
var TestingControllerStruct = &specqbft.Controller{ Identifier: []byte{1, 2, 3, 4}, Height: specqbft.Height(1), Share: testingShare, StoredInstances: specqbft.InstanceContainer{TestingInstanceStruct}, }
View Source
var TestingInstanceStruct = &specqbft.Instance{ State: &specqbft.State{ Share: testingShare, ID: []byte{1, 2, 3, 4}, Round: 1, Height: 1, LastPreparedRound: 1, LastPreparedValue: []byte{1, 2, 3, 4}, ProposalAcceptedForCurrentRound: TestingSignedMsg, Decided: false, DecidedValue: []byte{1, 2, 3, 4}, ProposeContainer: &specqbft.MsgContainer{ Msgs: map[specqbft.Round][]*specqbft.SignedMessage{ 1: { TestingSignedMsg, }, }, }, PrepareContainer: &specqbft.MsgContainer{ Msgs: map[specqbft.Round][]*specqbft.SignedMessage{ 1: { TestingSignedMsg, }, }, }, CommitContainer: &specqbft.MsgContainer{ Msgs: map[specqbft.Round][]*specqbft.SignedMessage{ 1: { TestingSignedMsg, }, }, }, RoundChangeContainer: &specqbft.MsgContainer{ Msgs: map[specqbft.Round][]*specqbft.SignedMessage{ 1: { TestingSignedMsg, }, }, }, }, }
View Source
var TestingMessage = &specqbft.Message{ MsgType: specqbft.ProposalMsgType, Height: specqbft.FirstHeight, Round: specqbft.FirstRound, Identifier: []byte{1, 2, 3, 4}, Data: []byte{1, 2, 3, 4}, }
View Source
var TestingSK = func() *bls.SecretKey { types.InitBLS() ret := &bls.SecretKey{} ret.SetByCSPRNG() return ret }()
View Source
var TestingSignedMsg = func() *specqbft.SignedMessage { return SignMsg(TestingSK, 1, TestingMessage) }()
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Signer spectypes.SSVSigner SigningPK []byte Domain spectypes.DomainType ValueCheckF specqbft.ProposedValueCheckF ProposerF specqbft.ProposerF Storage qbftstorage.QBFTStore Network specqbft.Network Timer specqbft.Timer }
func (*Config) GetNetwork ¶
GetNetwork returns a p2p Network instance
func (*Config) GetProposerF ¶
GetProposerF returns func used to calculate proposer
func (*Config) GetSignatureDomainType ¶
func (c *Config) GetSignatureDomainType() spectypes.DomainType
GetSignatureDomainType returns the Domain type used for signatures
func (*Config) GetSigningPubKey ¶
GetSigningPubKey returns the public key used to sign all QBFT messages
func (*Config) GetStorage ¶
func (c *Config) GetStorage() qbftstorage.QBFTStore
GetStorage returns a storage instance
func (*Config) GetValueCheckF ¶
func (c *Config) GetValueCheckF() specqbft.ProposedValueCheckF
GetValueCheckF returns value check instance
type IConfig ¶
type IConfig interface { // GetValueCheckF returns value check function GetValueCheckF() specqbft.ProposedValueCheckF // GetProposerF returns func used to calculate proposer GetProposerF() specqbft.ProposerF // GetNetwork returns a p2p Network instance GetNetwork() specqbft.Network // GetStorage returns a storage instance GetStorage() qbftstorage.QBFTStore // GetTimer returns round timer GetTimer() specqbft.Timer // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.