Documentation ¶
Index ¶
- Constants
- func ParseHexKey(str string) ([]byte, error)
- func ValidateBlock(meta *types.Block, check lc.Checkpoint) error
- func ValidateBlockMeta(meta *types.BlockMeta, check lc.Checkpoint) error
- func ValidateHeader(head *types.Header, check lc.Checkpoint) error
- type AppProof
- type AppProver
- type KeyMaker
- type Presenter
- type Presenters
- type RawPresenter
- type TxProof
- type TxProver
Constants ¶
const Raw = "raw"
Variables ¶
This section is empty.
Functions ¶
func ParseHexKey ¶ added in v0.10.1
func ValidateBlock ¶ added in v0.10.0
func ValidateBlock(meta *types.Block, check lc.Checkpoint) error
func ValidateBlockMeta ¶ added in v0.10.0
func ValidateBlockMeta(meta *types.BlockMeta, check lc.Checkpoint) error
func ValidateHeader ¶ added in v0.10.0
func ValidateHeader(head *types.Header, check lc.Checkpoint) error
Types ¶
type AppProof ¶
AppProof containts a key-value pair at a given height. It also contains the merkle proof from that key-value pair to the root hash, which can be verified against a signed header.
func (AppProof) BlockHeight ¶
type AppProver ¶
type AppProver struct {
// contains filtered or unexported fields
}
AppProver provides positive proofs of key-value pairs in the abciapp.
TODO: also support negative proofs (this key is not set)
func NewAppProver ¶
type KeyMaker ¶ added in v0.10.0
type KeyMaker struct {
Prefix []byte
}
KeyMaker can be embedded for a basic and flexible key encoder
type Presenter ¶ added in v0.10.0
Presenter allows us to encode queries and parse results in an app-specific way
type Presenters ¶ added in v0.10.0
func NewPresenters ¶ added in v0.10.0
func NewPresenters() Presenters
NewPresenters gives you a default raw presenter
func (Presenters) BruteForce ¶ added in v0.10.0
func (p Presenters) BruteForce(raw []byte) (interface{}, error)
BruteForce will try all regitered parsers in random order, before calling RawPresenter. Use if we have no idea how to interpret the data (eg. decoding all tx in a block)
func (Presenters) Lookup ¶ added in v0.10.0
func (p Presenters) Lookup(app string) (Presenter, error)
Lookup tries to find a registered presenter, or the raw presenter
func (Presenters) Register ¶ added in v0.10.0
func (p Presenters) Register(app string, pres Presenter)
Register adds this app to the lookup table to parse it
type RawPresenter ¶ added in v0.10.0
type RawPresenter struct {
KeyMaker
}
RawPresenter just hex-encodes/decodes text. Useful as default, or to embed in other structs for the MakeKey implementation
If you set a prefix, it will be prepended to all your data after hex-decoding them
func (RawPresenter) ParseData ¶ added in v0.10.0
func (p RawPresenter) ParseData(raw []byte) (interface{}, error)
ParseData on the raw-presenter, just provides a hex-encoding of the bytes
type TxProof ¶
TxProof checks ALL txs for one block... we need a better way!
func (TxProof) BlockHeight ¶
type TxProver ¶
type TxProver struct {
// contains filtered or unexported fields
}
TxProver provides positive proofs of key-value pairs in the abciapp.
TODO: also support negative proofs (this key is not set)