objs

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BClaimsEqual

func BClaimsEqual(a, b interface{}) (bool, error)

func ExtractHCID

func ExtractHCID(any interface{}) (uint32, uint32)

func ExtractHR

func ExtractHR(any interface{}) (uint32, uint32)

func GetProposerIdx

func GetProposerIdx(numv int, height uint32, round uint32) uint8

GetProposerIdx will return the index of the proposer of this round from the list of validators

func IsDeadBlockRound

func IsDeadBlockRound(any interface{}) bool

func MakeTxRoot

func MakeTxRoot(txHashes [][]byte) ([]byte, error)

MakeTxRoot creates a txRootHsh from a list of transaction hashes

func NextHeightSigDesignator

func NextHeightSigDesignator() []byte

func NextRoundSigDesignator

func NextRoundSigDesignator() []byte

func PreCommitNilSigDesignator

func PreCommitNilSigDesignator() []byte

func PreCommitSigDesignator

func PreCommitSigDesignator() []byte

func PreVoteNilSigDesignator

func PreVoteNilSigDesignator() []byte

func PreVoteSigDesignator

func PreVoteSigDesignator() []byte

func PrevBlockEqual

func PrevBlockEqual(a, b interface{}) bool

func ProposalSigDesignator

func ProposalSigDesignator() []byte

func RelateH

func RelateH(a, b interface{}) int

func RelateHR

func RelateHR(a, b interface{}) int

func SplitBlob

func SplitBlob(s []byte, blen int) ([][]byte, error)

SplitBlob separates a blob of fixed size data types into a slice of slices

func SplitHashes

func SplitHashes(s []byte) ([][]byte, error)

SplitHashes splits hashes by chopping up a blob of data into byte slices by length. return an error if the length is not correct. IE the total length is not a multiple of expected length for a single element of type.

func SplitSignatures

func SplitSignatures(s []byte) ([][]byte, error)

SplitSignatures splits signatures by chopping up a blob of data into byte slices by length. return an error if the length is not correct. IE the total length is not a multiple of expected length for a single element of type.

Types

type BClaims

type BClaims struct {
	ChainID    uint32
	Height     uint32
	TxCount    uint32
	PrevBlock  []byte
	TxRoot     []byte
	StateRoot  []byte
	HeaderRoot []byte
}

BClaims ...

func ExtractBClaims

func ExtractBClaims(any interface{}) *BClaims

func (*BClaims) BlockHash

func (b *BClaims) BlockHash() ([]byte, error)

BlockHash returns the BlockHash of BClaims

func (*BClaims) MarshalBinary

func (b *BClaims) MarshalBinary() ([]byte, error)

MarshalBinary takes the BClaims object and returns the canonical byte slice

func (*BClaims) MarshalCapn

func (b *BClaims) MarshalCapn(seg *capnp.Segment) (mdefs.BClaims, error)

MarshalCapn marshals the object into its capnproto definition

func (*BClaims) UnmarshalBinary

func (b *BClaims) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding BClaims object

func (*BClaims) UnmarshalCapn

func (b *BClaims) UnmarshalCapn(bc mdefs.BClaims) error

UnmarshalCapn unmarshals the capnproto definition of the object

type BlockHeader

type BlockHeader struct {
	BClaims  *BClaims
	SigGroup []byte
	TxHshLst [][]byte
	// Not Part of actual object below this line
	GroupKey []byte
}

BlockHeader ...

func (*BlockHeader) BlockHash

func (b *BlockHeader) BlockHash() ([]byte, error)

BlockHash returns the BlockHash of BlockHeader

func (*BlockHeader) GetRCert

func (b *BlockHeader) GetRCert() (*RCert, error)

GetRCert returns the RCert for BlockHeader

func (*BlockHeader) MakeDeadRoundProposal

func (b *BlockHeader) MakeDeadRoundProposal(rcert *RCert, headerRoot []byte) (*Proposal, error)

MakeDeadRoundProposal makes the proposal for the DeadBlockRound

func (*BlockHeader) MarshalBinary

func (b *BlockHeader) MarshalBinary() ([]byte, error)

MarshalBinary takes the BlockHeader object and returns the canonical byte slice

func (*BlockHeader) MarshalCapn

func (b *BlockHeader) MarshalCapn(seg *capnp.Segment) (mdefs.BlockHeader, error)

MarshalCapn marshals the object into its capnproto definition

func (*BlockHeader) UnmarshalBinary

func (b *BlockHeader) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding BlockHeader object

func (*BlockHeader) UnmarshalBinaryUnsafe

func (b *BlockHeader) UnmarshalBinaryUnsafe(data []byte) error

UnmarshalBinaryUnsafe unmarshals a BlockHeader in an unsafe manner; that is, we do not look at the TxHshLst. This is necessary during fast synchronization, as transactions are not synced.

func (*BlockHeader) UnmarshalCapn

func (b *BlockHeader) UnmarshalCapn(bh mdefs.BlockHeader) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*BlockHeader) ValidateSignatures

func (b *BlockHeader) ValidateSignatures(bnVal *crypto.BNGroupValidator) error

ValidateSignatures validates the TxRoot and group signature on the Blockheader

type BlockHeaderHashIndexKey

type BlockHeaderHashIndexKey struct {
	Prefix    []byte
	BlockHash []byte
}

BlockHeaderHashIndexKey ...

func (*BlockHeaderHashIndexKey) MarshalBinary

func (b *BlockHeaderHashIndexKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the BlockHeaderHashIndexKey object and returns the canonical byte slice

func (*BlockHeaderHashIndexKey) UnmarshalBinary

func (b *BlockHeaderHashIndexKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding BlockHeaderHashIndexKey object

type BlockHeaderHeightKey

type BlockHeaderHeightKey struct {
	Prefix []byte
	Height uint32
}

BlockHeaderHeightKey ...

func (*BlockHeaderHeightKey) MarshalBinary

func (b *BlockHeaderHeightKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the BlockHeaderHeightKey object and returns the canonical byte slice

func (*BlockHeaderHeightKey) UnmarshalBinary

func (b *BlockHeaderHeightKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding BlockHeaderHeightKey object

type EncryptedStore

type EncryptedStore struct {
	Kid  []byte
	Name []byte
	// Not Part of actual object below this line
	ClearText []byte
	// contains filtered or unexported fields
}

EncryptedStore ...

func (*EncryptedStore) Decrypt

func (b *EncryptedStore) Decrypt(resolver interfaces.KeyResolver) error

Decrypt decrypts b.cypherText and saves the result to b.ClearText

func (*EncryptedStore) Encrypt

func (b *EncryptedStore) Encrypt(resolver interfaces.KeyResolver) error

Encrypt encrypts b.ClearText and writes the result to b.cypherText; afterwards, it zeros b.ClearText and sets its pointer to nil

func (*EncryptedStore) MarshalBinary

func (b *EncryptedStore) MarshalBinary() ([]byte, error)

MarshalBinary takes the EncryptedStore object and returns the canonical byte slice

func (*EncryptedStore) MarshalCapn

func (b *EncryptedStore) MarshalCapn(seg *capnp.Segment) (mdefs.EncryptedStore, error)

MarshalCapn marshals the object into its capnproto definition

func (*EncryptedStore) UnmarshalBinary

func (b *EncryptedStore) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding EncryptedStore object

func (*EncryptedStore) UnmarshalCapn

func (b *EncryptedStore) UnmarshalCapn(bh mdefs.EncryptedStore) error

UnmarshalCapn unmarshals the capnproto definition of the object

type NHClaims

type NHClaims struct {
	Proposal *Proposal
	SigShare []byte
	// Not Part of actual object below this line
	GroupShare []byte
}

NHClaims ...

func (*NHClaims) MarshalBinary

func (b *NHClaims) MarshalBinary() ([]byte, error)

MarshalBinary takes the NHClaims object and returns the canonical byte slice

func (*NHClaims) MarshalCapn

func (b *NHClaims) MarshalCapn(seg *capnp.Segment) (mdefs.NHClaims, error)

MarshalCapn marshals the object into its capnproto definition

func (*NHClaims) UnmarshalBinary

func (b *NHClaims) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding NHClaims object

func (*NHClaims) UnmarshalCapn

func (b *NHClaims) UnmarshalCapn(bh mdefs.NHClaims) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*NHClaims) ValidateSignatures

func (b *NHClaims) ValidateSignatures(secpVal *crypto.Secp256k1Validator, bnVal *crypto.BNGroupValidator) error

type NRClaims

type NRClaims struct {
	RCert    *RCert
	RClaims  *RClaims
	SigShare []byte
	// Not Part of actual object below this line
	GroupShare []byte
}

NRClaims ...

func (*NRClaims) MarshalBinary

func (b *NRClaims) MarshalBinary() ([]byte, error)

MarshalBinary takes the NRClaims object and returns the canonical byte slice

func (*NRClaims) MarshalCapn

func (b *NRClaims) MarshalCapn(seg *capnp.Segment) (mdefs.NRClaims, error)

MarshalCapn marshals the object into its capnproto definition

func (*NRClaims) Sign

func (b *NRClaims) Sign(bnSigner *crypto.BNGroupSigner) error

func (*NRClaims) UnmarshalBinary

func (b *NRClaims) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding NRClaims object

func (*NRClaims) UnmarshalCapn

func (b *NRClaims) UnmarshalCapn(bh mdefs.NRClaims) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*NRClaims) ValidateSignatures

func (b *NRClaims) ValidateSignatures(bnVal *crypto.BNGroupValidator) error

type NextHeight

type NextHeight struct {
	NHClaims   *NHClaims
	Signature  []byte
	PreCommits [][]byte
	// Not Part of actual object below this line
	Voter      []byte
	GroupKey   []byte
	GroupShare []byte
	Signers    [][]byte
}

NextHeight ...

func (*NextHeight) MarshalBinary

func (b *NextHeight) MarshalBinary() ([]byte, error)

MarshalBinary takes the NextHeight object and returns the canonical byte slice

func (*NextHeight) MarshalCapn

func (b *NextHeight) MarshalCapn(seg *capnp.Segment) (mdefs.NextHeight, error)

MarshalCapn marshals the object into its capnproto definition

func (*NextHeight) Plagiarize

func (b *NextHeight) Plagiarize(secpSigner *crypto.Secp256k1Signer, bnSigner *crypto.BNGroupSigner) (*NextHeight, error)

func (*NextHeight) Sign

func (b *NextHeight) Sign(secpSigner *crypto.Secp256k1Signer, bnSigner *crypto.BNGroupSigner) error

func (*NextHeight) UnmarshalBinary

func (b *NextHeight) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding NextHeight object

func (*NextHeight) UnmarshalCapn

func (b *NextHeight) UnmarshalCapn(bh mdefs.NextHeight) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*NextHeight) ValidateSignatures

func (b *NextHeight) ValidateSignatures(secpVal *crypto.Secp256k1Validator, bnVal *crypto.BNGroupValidator) error

type NextHeightList

type NextHeightList []*NextHeight

NextHeightList ...

func (NextHeightList) MakeBlockHeader

func (nhl NextHeightList) MakeBlockHeader(bns *crypto.BNGroupSigner, groupShares [][]byte) (*BlockHeader, *RCert, error)

type NextRound

type NextRound struct {
	NRClaims  *NRClaims
	Signature []byte
	// Not Part of actual object below this line
	Voter      []byte
	GroupKey   []byte
	GroupShare []byte
}

NextRound ...

func (*NextRound) MarshalBinary

func (b *NextRound) MarshalBinary() ([]byte, error)

MarshalBinary takes the NextRound object and returns the canonical byte slice

func (*NextRound) MarshalCapn

func (b *NextRound) MarshalCapn(seg *capnp.Segment) (mdefs.NextRound, error)

MarshalCapn marshals the object into its capnproto definition

func (*NextRound) Sign

func (b *NextRound) Sign(secpSigner *crypto.Secp256k1Signer, bnSigner *crypto.BNGroupSigner) error

func (*NextRound) UnmarshalBinary

func (b *NextRound) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding NextRound object

func (*NextRound) UnmarshalCapn

func (b *NextRound) UnmarshalCapn(bh mdefs.NextRound) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*NextRound) ValidateSignatures

func (b *NextRound) ValidateSignatures(secpVal *crypto.Secp256k1Validator, bnVal *crypto.BNGroupValidator) error

type NextRoundList

type NextRoundList []*NextRound

NextRoundList ...

func (NextRoundList) MakeRoundCert

func (nrl NextRoundList) MakeRoundCert(bns *crypto.BNGroupSigner, groupShares [][]byte) (*RCert, error)

type OwnState

type OwnState struct {
	VAddr             []byte
	GroupKey          []byte
	SyncToBH          *BlockHeader
	MaxBHSeen         *BlockHeader
	CanonicalSnapShot *BlockHeader
	PendingSnapShot   *BlockHeader
}

OwnState ...

func (*OwnState) Copy

func (b *OwnState) Copy() (*OwnState, error)

Copy creates a copy of OwnState

func (*OwnState) IsSync

func (b *OwnState) IsSync() bool

IsSync returns true if we are synced to the current block height

func (*OwnState) MarshalBinary

func (b *OwnState) MarshalBinary() ([]byte, error)

MarshalBinary takes the OwnState object and returns the canonical byte slice

func (*OwnState) MarshalCapn

func (b *OwnState) MarshalCapn(seg *capnp.Segment) (mdefs.OwnState, error)

MarshalCapn marshals the object into its capnproto definition

func (*OwnState) UnmarshalBinary

func (b *OwnState) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding OwnState object

func (*OwnState) UnmarshalCapn

func (b *OwnState) UnmarshalCapn(bh mdefs.OwnState) error

UnmarshalCapn unmarshals the capnproto definition of the object

type OwnValidatingState

type OwnValidatingState struct {
	VAddr                []byte
	GroupKey             []byte
	RoundStarted         int64
	PreVoteStepStarted   int64
	PreCommitStepStarted int64
	ValidValue           *Proposal
	LockedValue          *Proposal
}

OwnValidatingState ...

func (*OwnValidatingState) DBRNRExpired

func (b *OwnValidatingState) DBRNRExpired() bool

func (*OwnValidatingState) MarshalBinary

func (b *OwnValidatingState) MarshalBinary() ([]byte, error)

MarshalBinary takes the OwnValidatingState object and returns the canonical byte slice

func (*OwnValidatingState) MarshalCapn

MarshalCapn marshals the object into its capnproto definition

func (*OwnValidatingState) PCTOExpired

func (b *OwnValidatingState) PCTOExpired() bool

func (*OwnValidatingState) PTOExpired

func (b *OwnValidatingState) PTOExpired() bool

func (*OwnValidatingState) PVTOExpired

func (b *OwnValidatingState) PVTOExpired() bool

func (*OwnValidatingState) SetPreCommitStepStarted

func (b *OwnValidatingState) SetPreCommitStepStarted()

func (*OwnValidatingState) SetPreVoteStepStarted

func (b *OwnValidatingState) SetPreVoteStepStarted()

func (*OwnValidatingState) SetRoundStarted

func (b *OwnValidatingState) SetRoundStarted()

func (*OwnValidatingState) UnmarshalBinary

func (b *OwnValidatingState) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding OwnValidatingState object

func (*OwnValidatingState) UnmarshalCapn

func (b *OwnValidatingState) UnmarshalCapn(bh mdefs.OwnValidatingState) error

UnmarshalCapn unmarshals the capnproto definition of the object

type PClaims

type PClaims struct {
	BClaims *BClaims
	RCert   *RCert
}

PClaims ...

func (*PClaims) MarshalBinary

func (b *PClaims) MarshalBinary() ([]byte, error)

MarshalBinary takes the PClaims object and returns the canonical byte slice

func (*PClaims) MarshalCapn

func (b *PClaims) MarshalCapn(seg *capnp.Segment) (mdefs.PClaims, error)

MarshalCapn marshals the object into its capnproto definition

func (*PClaims) UnmarshalBinary

func (b *PClaims) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding PClaims object

func (*PClaims) UnmarshalCapn

func (b *PClaims) UnmarshalCapn(bh mdefs.PClaims) error

UnmarshalCapn unmarshals the capnproto definition of the object

type PendingHdrLeafKey

type PendingHdrLeafKey struct {
	Prefix []byte
	Key    []byte
}

PendingHdrLeafKey ...

func (*PendingHdrLeafKey) MarshalBinary

func (b *PendingHdrLeafKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the PendingHdrLeafKey object and returns the canonical byte slice

func (*PendingHdrLeafKey) UnmarshalBinary

func (b *PendingHdrLeafKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding PendingHdrLeafKey object

type PendingLeafKey

type PendingLeafKey struct {
	Prefix []byte
	Key    []byte
}

PendingLeafKey ...

func (*PendingLeafKey) MarshalBinary

func (b *PendingLeafKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the PendingLeafKey object and returns the canonical byte slice

func (*PendingLeafKey) UnmarshalBinary

func (b *PendingLeafKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding PendingLeafKey object

type PendingNodeKey

type PendingNodeKey struct {
	Prefix []byte
	Key    []byte
}

PendingNodeKey ...

func (*PendingNodeKey) MarshalBinary

func (b *PendingNodeKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the PendingNodeKey object and returns the canonical byte slice

func (*PendingNodeKey) UnmarshalBinary

func (b *PendingNodeKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding PendingNodeKey object

type PreCommit

type PreCommit struct {
	Proposal  *Proposal
	Signature []byte
	PreVotes  [][]byte
	// Not Part of actual object below this line
	Voter    []byte
	Signers  [][]byte
	GroupKey []byte
	Proposer []byte
}

PreCommit ...

func (*PreCommit) MakeImplPreVotes

func (b *PreCommit) MakeImplPreVotes() (PreVoteList, error)

func (*PreCommit) MarshalBinary

func (b *PreCommit) MarshalBinary() ([]byte, error)

MarshalBinary takes the PreCommit object and returns the canonical byte slice

func (*PreCommit) MarshalCapn

func (b *PreCommit) MarshalCapn(seg *capnp.Segment) (mdefs.PreCommit, error)

MarshalCapn marshals the object into its capnproto definition

func (*PreCommit) Sign

func (b *PreCommit) Sign(secpSigner *crypto.Secp256k1Signer) error

func (*PreCommit) UnmarshalBinary

func (b *PreCommit) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding PreCommit object

func (*PreCommit) UnmarshalCapn

func (b *PreCommit) UnmarshalCapn(bh mdefs.PreCommit) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*PreCommit) ValidateSignatures

func (b *PreCommit) ValidateSignatures(secpVal *crypto.Secp256k1Validator, bnVal *crypto.BNGroupValidator) error

type PreCommitList

type PreCommitList []*PreCommit

func (PreCommitList) GetProposal

func (pcl PreCommitList) GetProposal() (*Proposal, error)

func (PreCommitList) MakeNextHeight

func (pcl PreCommitList) MakeNextHeight(secpSigner *crypto.Secp256k1Signer, bnSigner *crypto.BNGroupSigner) (*NextHeight, error)

type PreCommitNil

type PreCommitNil struct {
	RCert     *RCert
	Signature []byte
	// Not Part of actual object below this line
	Voter    []byte
	GroupKey []byte
}

PreCommitNil ...

func (*PreCommitNil) MarshalBinary

func (b *PreCommitNil) MarshalBinary() ([]byte, error)

MarshalBinary takes the PreCommitNil object and returns the canonical byte slice

func (*PreCommitNil) MarshalCapn

func (b *PreCommitNil) MarshalCapn(seg *capnp.Segment) (mdefs.PreCommitNil, error)

MarshalCapn marshals the object into its capnproto definition

func (*PreCommitNil) UnmarshalBinary

func (b *PreCommitNil) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding PreCommitNil object

func (*PreCommitNil) UnmarshalCapn

func (b *PreCommitNil) UnmarshalCapn(bh mdefs.PreCommitNil) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*PreCommitNil) ValidateSignatures

func (b *PreCommitNil) ValidateSignatures(secpVal *crypto.Secp256k1Validator, bnVal *crypto.BNGroupValidator) error

type PreCommitNilList

type PreCommitNilList []bool

type PreVote

type PreVote struct {
	Proposal  *Proposal
	Signature []byte
	// Not Part of actual object below this line
	Voter    []byte
	GroupKey []byte
}

PreVote ...

func (*PreVote) MarshalBinary

func (b *PreVote) MarshalBinary() ([]byte, error)

MarshalBinary takes the PreVote object and returns the canonical byte slice

func (*PreVote) MarshalCapn

func (b *PreVote) MarshalCapn(seg *capnp.Segment) (mdefs.PreVote, error)

MarshalCapn marshals the object into its capnproto definition

func (*PreVote) Sign

func (b *PreVote) Sign(secpSigner *crypto.Secp256k1Signer) error

func (*PreVote) UnmarshalBinary

func (b *PreVote) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding PreVote object

func (*PreVote) UnmarshalCapn

func (b *PreVote) UnmarshalCapn(bh mdefs.PreVote) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*PreVote) ValidateSignatures

func (b *PreVote) ValidateSignatures(secpVal *crypto.Secp256k1Validator, bnVal *crypto.BNGroupValidator) error

type PreVoteList

type PreVoteList []*PreVote

func (PreVoteList) GetProposal

func (pvl PreVoteList) GetProposal() (*Proposal, error)

func (PreVoteList) MakePreCommit

func (pvl PreVoteList) MakePreCommit(secpSigner *crypto.Secp256k1Signer) (*PreCommit, error)

type PreVoteNil

type PreVoteNil struct {
	RCert     *RCert
	Signature []byte
	// Not Part of actual object below this line
	Voter    []byte
	GroupKey []byte
}

PreVoteNil ...

func (*PreVoteNil) MarshalBinary

func (b *PreVoteNil) MarshalBinary() ([]byte, error)

MarshalBinary takes the PreVoteNil object and returns the canonical byte slice

func (*PreVoteNil) MarshalCapn

func (b *PreVoteNil) MarshalCapn(seg *capnp.Segment) (mdefs.PreVoteNil, error)

MarshalCapn marshals the object into its capnproto definition

func (*PreVoteNil) UnmarshalBinary

func (b *PreVoteNil) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding PreVoteNil object

func (*PreVoteNil) UnmarshalCapn

func (b *PreVoteNil) UnmarshalCapn(bh mdefs.PreVoteNil) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*PreVoteNil) ValidateSignatures

func (b *PreVoteNil) ValidateSignatures(secpVal *crypto.Secp256k1Validator, bnVal *crypto.BNGroupValidator) error

type PreVoteNilList

type PreVoteNilList []bool

type Proposal

type Proposal struct {
	PClaims   *PClaims
	Signature []byte
	TxHshLst  [][]byte
	// Not Part of actual object below this line
	Proposer []byte
	GroupKey []byte
}

Proposal ...

func (*Proposal) MarshalBinary

func (b *Proposal) MarshalBinary() ([]byte, error)

MarshalBinary takes the Proposal object and returns the canonical byte slice

func (*Proposal) MarshalCapn

func (b *Proposal) MarshalCapn(seg *capnp.Segment) (mdefs.Proposal, error)

MarshalCapn marshals the object into its capnproto definition

func (*Proposal) PreVote

func (b *Proposal) PreVote(secpSigner *crypto.Secp256k1Signer) (*PreVote, error)

func (*Proposal) RePropose

func (b *Proposal) RePropose(secpSigner *crypto.Secp256k1Signer, rc *RCert) (*Proposal, error)

func (*Proposal) Sign

func (b *Proposal) Sign(secpSigner *crypto.Secp256k1Signer) error

func (*Proposal) UnmarshalBinary

func (b *Proposal) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding Proposal object

func (*Proposal) UnmarshalCapn

func (b *Proposal) UnmarshalCapn(bh mdefs.Proposal) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*Proposal) ValidateSignatures

func (b *Proposal) ValidateSignatures(val *crypto.Secp256k1Validator, bnVal *crypto.BNGroupValidator) error

type RCert

type RCert struct {
	RClaims  *RClaims
	SigGroup []byte
	// Not Part of actual object below this line
	GroupKey []byte
}

RCert ...

func ExtractRCert

func ExtractRCert(any interface{}) *RCert

func ExtractRCertAny

func ExtractRCertAny(any interface{}) (*RCert, error)

func (*RCert) MarshalBinary

func (b *RCert) MarshalBinary() ([]byte, error)

MarshalBinary takes the RCert object and returns the canonical byte slice

func (*RCert) MarshalCapn

func (b *RCert) MarshalCapn(seg *capnp.Segment) (mdefs.RCert, error)

MarshalCapn marshals the object into its capnproto definition

func (*RCert) NextRound

func (b *RCert) NextRound(secpSigner *crypto.Secp256k1Signer, bnSigner *crypto.BNGroupSigner) (*NextRound, error)

NextRound constructs a NextRound object from RCert

func (*RCert) PreCommitNil

func (b *RCert) PreCommitNil(secpSigner *crypto.Secp256k1Signer) (*PreCommitNil, error)

PreCommitNil constructs a PreCommitNil object from RCert

func (*RCert) PreVoteNil

func (b *RCert) PreVoteNil(secpSigner *crypto.Secp256k1Signer) (*PreVoteNil, error)

PreVoteNil constructs a PreVoteNil object from RCert

func (*RCert) UnmarshalBinary

func (b *RCert) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding RCert object

func (*RCert) UnmarshalCapn

func (b *RCert) UnmarshalCapn(bh mdefs.RCert) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*RCert) ValidateSignature

func (b *RCert) ValidateSignature(bnVal *crypto.BNGroupValidator) error

ValidateSignature validates the group signature on the RCert

type RClaims

type RClaims struct {
	ChainID   uint32
	Height    uint32
	Round     uint32
	PrevBlock []byte
}

RClaims ...

func (*RClaims) MarshalBinary

func (b *RClaims) MarshalBinary() ([]byte, error)

MarshalBinary takes the RClaims object and returns the canonical byte slice

func (*RClaims) MarshalCapn

func (b *RClaims) MarshalCapn(seg *capnp.Segment) (mdefs.RClaims, error)

MarshalCapn marshals the object into its capnproto definition

func (*RClaims) UnmarshalBinary

func (b *RClaims) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding RClaims object

func (*RClaims) UnmarshalCapn

func (b *RClaims) UnmarshalCapn(bh mdefs.RClaims) error

UnmarshalCapn unmarshals the capnproto definition of the object

type RoundState

type RoundState struct {
	VAddr                 []byte
	GroupKey              []byte
	GroupShare            []byte
	GroupIdx              uint8
	RCert                 *RCert
	ConflictingRCert      *RCert
	Proposal              *Proposal
	ConflictingProposal   *Proposal
	PreVote               *PreVote
	ConflictingPreVote    *PreVote
	PreVoteNil            *PreVoteNil
	ImplicitPVN           bool
	PreCommit             *PreCommit
	ConflictingPreCommit  *PreCommit
	PreCommitNil          *PreCommitNil
	ImplicitPCN           bool
	NextRound             *NextRound
	NextHeight            *NextHeight
	ConflictingNextHeight *NextHeight
}

RoundState ...

func (*RoundState) CurrentH

func (b *RoundState) CurrentH(a *RCert) bool

func (*RoundState) CurrentHR

func (b *RoundState) CurrentHR(a *RCert) bool

func (*RoundState) FutureH

func (b *RoundState) FutureH(a *RCert) bool

func (*RoundState) FutureHR

func (b *RoundState) FutureHR(a *RCert) bool

func (*RoundState) MarshalBinary

func (b *RoundState) MarshalBinary() ([]byte, error)

MarshalBinary takes the RoundState object and returns the canonical byte slice

func (*RoundState) MarshalCapn

func (b *RoundState) MarshalCapn(seg *capnp.Segment) (mdefs.RoundState, error)

MarshalCapn marshals the object into its capnproto definition

func (*RoundState) NHCurrent

func (b *RoundState) NHCurrent(a *RCert) bool

func (*RoundState) NRCurrent

func (b *RoundState) NRCurrent(a *RCert) bool

func (*RoundState) PCCurrent

func (b *RoundState) PCCurrent(a *RCert) bool

func (*RoundState) PCNCurrent

func (b *RoundState) PCNCurrent(a *RCert) bool

func (*RoundState) PCurrent

func (b *RoundState) PCurrent(a *RCert) bool

func (*RoundState) PVCurrent

func (b *RoundState) PVCurrent(a *RCert) bool

func (*RoundState) PVNCurrent

func (b *RoundState) PVNCurrent(a *RCert) bool

func (*RoundState) Reset

func (b *RoundState) Reset()

func (*RoundState) SetNextHeight

func (b *RoundState) SetNextHeight(v *NextHeight) (bool, error)

func (*RoundState) SetNextRound

func (b *RoundState) SetNextRound(v *NextRound) (bool, error)

func (*RoundState) SetPreCommit

func (b *RoundState) SetPreCommit(v *PreCommit) (bool, error)

func (*RoundState) SetPreCommitNil

func (b *RoundState) SetPreCommitNil(v *PreCommitNil) (bool, error)

func (*RoundState) SetPreVote

func (b *RoundState) SetPreVote(v *PreVote) (bool, error)

func (*RoundState) SetPreVoteNil

func (b *RoundState) SetPreVoteNil(v *PreVoteNil) (bool, error)

func (*RoundState) SetProposal

func (b *RoundState) SetProposal(v *Proposal) (bool, error)

func (*RoundState) SetRCert

func (b *RoundState) SetRCert(rc *RCert) error

func (*RoundState) TrackExternalConflicts

func (b *RoundState) TrackExternalConflicts(v *Proposal)

func (*RoundState) UnmarshalBinary

func (b *RoundState) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding RoundState object

func (*RoundState) UnmarshalCapn

func (b *RoundState) UnmarshalCapn(bh mdefs.RoundState) error

UnmarshalCapn unmarshals the capnproto definition of the object

type RoundStateCurrentKey

type RoundStateCurrentKey struct {
	Prefix   []byte
	GroupKey []byte
	VAddr    []byte
}

RoundStateCurrentKey ...

func (*RoundStateCurrentKey) MarshalBinary

func (b *RoundStateCurrentKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the RoundStateCurrentKey object and returns the canonical byte slice

func (*RoundStateCurrentKey) UnmarshalBinary

func (b *RoundStateCurrentKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding RoundStateCurrentKey object

type RoundStateHistoricKey

type RoundStateHistoricKey struct {
	Prefix []byte
	Height uint32
	Round  uint32
	VAddr  []byte
}

RoundStateHistoricKey ...

func (*RoundStateHistoricKey) MakeIterKey

func (b *RoundStateHistoricKey) MakeIterKey() ([]byte, error)

MakeIterKey ...

func (*RoundStateHistoricKey) MarshalBinary

func (b *RoundStateHistoricKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the RoundStateHistoricKey object and returns the canonical byte slice

func (*RoundStateHistoricKey) UnmarshalBinary

func (b *RoundStateHistoricKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding RoundStateHistoricKey object

type SafeToProceedKey

type SafeToProceedKey struct {
	Prefix []byte
	Height uint32
}

SafeToProceedKey ...

func (*SafeToProceedKey) MarshalBinary

func (b *SafeToProceedKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the SafeToProceedKey object and returns the canonical byte slice

func (*SafeToProceedKey) UnmarshalBinary

func (b *SafeToProceedKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding SafeToProceedKey object

type StagedBlockHeaderKey

type StagedBlockHeaderKey struct {
	Prefix []byte
	Key    []byte
}

StagedBlockHeaderKey ...

func (*StagedBlockHeaderKey) MarshalBinary

func (b *StagedBlockHeaderKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the StagedBlockHeaderKey object and returns the canonical byte slice

func (*StagedBlockHeaderKey) UnmarshalBinary

func (b *StagedBlockHeaderKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding StagedBlockHeaderKey object

type TxCacheKey

type TxCacheKey struct {
	Prefix []byte
	Height uint32
	TxHash []byte
}

TxCacheKey ...

func (*TxCacheKey) MakeIterKey

func (b *TxCacheKey) MakeIterKey() ([]byte, error)

MakeIterKey ...

func (*TxCacheKey) MarshalBinary

func (b *TxCacheKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the TxCacheKey object and returns the canonical byte slice

func (*TxCacheKey) UnmarshalBinary

func (b *TxCacheKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding TxCacheKey object

type Validator

type Validator struct {
	VAddr      []byte
	GroupShare []byte
}

Validator ...

func (*Validator) MarshalBinary

func (b *Validator) MarshalBinary() ([]byte, error)

MarshalBinary takes the Validator object and returns the canonical byte slice

func (*Validator) MarshalCapn

func (b *Validator) MarshalCapn(seg *capnp.Segment) (mdefs.Validator, error)

MarshalCapn marshals the object into its capnproto definition

func (*Validator) UnmarshalBinary

func (b *Validator) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding Validator object

func (*Validator) UnmarshalCapn

func (b *Validator) UnmarshalCapn(bh mdefs.Validator) error

UnmarshalCapn unmarshals the capnproto definition of the object

type ValidatorSet

type ValidatorSet struct {
	Validators []*Validator
	GroupKey   []byte
	NotBefore  uint32
	// Not Part of actual object below this line
	ValidatorVAddrMap      map[string]int
	ValidatorGroupShareMap map[string]int
	ValidatorVAddrSet      map[string]bool
	ValidatorGroupShareSet map[string]bool
}

ValidatorSet ...

func (*ValidatorSet) GroupShareIdx

func (b *ValidatorSet) GroupShareIdx(groupShare []byte) (bool, int)

func (*ValidatorSet) IsGroupShareValidator

func (b *ValidatorSet) IsGroupShareValidator(groupShare []byte) bool

func (*ValidatorSet) IsVAddrValidator

func (b *ValidatorSet) IsVAddrValidator(addr []byte) bool

func (*ValidatorSet) IsValidTriplet

func (b *ValidatorSet) IsValidTriplet(vAddr []byte, groupShare []byte, groupKey []byte) bool

func (*ValidatorSet) IsValidTuple

func (b *ValidatorSet) IsValidTuple(vAddr []byte, groupKey []byte) bool

func (*ValidatorSet) MarshalBinary

func (b *ValidatorSet) MarshalBinary() ([]byte, error)

MarshalBinary takes the ValidatorSet object and returns the canonical byte slice

func (*ValidatorSet) MarshalCapn

func (b *ValidatorSet) MarshalCapn(seg *capnp.Segment) (mdefs.ValidatorSet, error)

MarshalCapn marshals the object into its capnproto definition

func (*ValidatorSet) UnmarshalBinary

func (b *ValidatorSet) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding ValidatorSet object

func (*ValidatorSet) UnmarshalCapn

func (b *ValidatorSet) UnmarshalCapn(bh mdefs.ValidatorSet) error

UnmarshalCapn unmarshals the capnproto definition of the object

func (*ValidatorSet) VAddrIdx

func (b *ValidatorSet) VAddrIdx(vAddr []byte) (bool, int)

type ValidatorSetKey

type ValidatorSetKey struct {
	Prefix    []byte
	NotBefore uint32
}

ValidatorSetKey ...

func (*ValidatorSetKey) MarshalBinary

func (b *ValidatorSetKey) MarshalBinary() ([]byte, error)

MarshalBinary takes the ValidatorSetKey object and returns the canonical byte slice

func (*ValidatorSetKey) UnmarshalBinary

func (b *ValidatorSetKey) UnmarshalBinary(data []byte) error

UnmarshalBinary takes a byte slice and returns the corresponding ValidatorSetKey object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL