Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RandomBeaconTag is used for threshold signatures in the random beacon RandomBeaconTag = tag("Random-Beacon") // ConsensusVoteTag is used for Consensus Hotstuff votes ConsensusVoteTag = tag("Consensus-Vote") // CollectorVoteTag is used for Collection Hotstuff votes CollectorVoteTag = tag("Collector-Vote") // ExecutionReceiptTag is used for execution receipts ExecutionReceiptTag = tag("Execution-Receipt") // ResultApprovalTag is used for result approvals ResultApprovalTag = tag("Result-Approval") // SPOCKTag is used to generate SPoCK proofs SPOCKTag = tag("SPoCK") )
Functions ¶
This section is empty.
Types ¶
type Encodable ¶
type Encodable interface {
Encode() []byte
}
Encodable is a type that defines a canonical encoding.
type Encoder ¶
type Encoder interface {
// Encode encodes a value as bytes.
//
// This function returns an error if the value type is not supported by this encoder.
Encode(interface{}) ([]byte, error)
// Decode decodes bytes into a value.
//
// This functions returns an error if the bytes do not fit the provided value type.
Decode([]byte, interface{}) error
// MustEncode encodes a value as bytes.
//
// This functions panic if encoding fails.
MustEncode(interface{}) []byte
// MustDecode decodes bytes into a value.
//
// This functions panic if decoding fails.
MustDecode([]byte, interface{})
}
Encoder encodes and decodes values to and from bytes.
var DefaultEncoder Encoder = json.NewEncoder()
DefaultEncoder is the default encoder used by Flow.
Click to show internal directories.
Click to hide internal directories.