Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeBatchProof ¶
func EncodeBatchProof(bp *BatchProof) ([][]byte, int)
EncodeBatchProof encodes all the content of a batch proof into an array of byte arrays
Types ¶
type BatchProof ¶
type BatchProof struct {
Proofs []*Proof
}
BatchProof is a struct that holds the proofs for several keys
TODO (add key values to batch proof and make it self-included), so there is no need for two calls (read, proofs)
func DecodeBatchProof ¶
func DecodeBatchProof(proofs [][]byte) (*BatchProof, error)
DecodeBatchProof takes in an encodes array of byte arrays an converts them into a BatchProof
func NewBatchProof ¶
func NewBatchProof() *BatchProof
NewBatchProof creates a new instance of BatchProof
func NewBatchProofWithEmptyProofs ¶
func NewBatchProofWithEmptyProofs(numberOfProofs int) *BatchProof
NewBatchProofWithEmptyProofs creates an instance of Batchproof filled with n newly created proofs (empty)
func (*BatchProof) AppendProof ¶
func (bp *BatchProof) AppendProof(p *Proof)
AppendProof adds a proof to the batch proof
func (*BatchProof) MergeInto ¶
func (bp *BatchProof) MergeInto(dest *BatchProof)
MergeInto adds all of its proofs into the dest batch proof
func (*BatchProof) String ¶
func (bp *BatchProof) String() string
type Proof ¶
type Proof struct { Values [][]byte // the non-default intermediate nodes in the proof Inclusion bool // flag indicating if this is an inclusion or exclusion Flags []byte // The flags of the proofs (is set if an intermediate node has a non-default) Steps uint8 // number of steps for the proof (path len) // TODO: should this be a type allowing for larger values? }
Proof includes all the information needed to walk through a trie branch from an specific leaf node (key) up to the root of the trie.