evidence

package
v0.0.0-...-c7417fd Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MultiCodecType = uint64(cid.DagCBOR) // TODO: replace this with the chosen codec
	MultiHashType  = uint64(multihash.SHA2_256)
)

Functions

func AddSupportToChooser

AddSupportToChooser takes an existing node prototype chooser and subs in Evidence for the tendermint evidence multicodec code.

func AppendEncode

func AppendEncode(enc []byte, inNode ipld.Node) ([]byte, error)

AppendEncode is like Encode, but it uses a destination buffer directly. This means less copying of bytes, and if the destination has enough capacity, fewer allocations.

func Decode

func Decode(na ipld.NodeAssembler, in io.Reader) error

Decode provides an IPLD codec decode interface for Cosmos Evidence IPLDs. This function is registered via the go-ipld-prime link loader for multicodec code XXX when this package is invoked via init.

func DecodeBytes

func DecodeBytes(na ipld.NodeAssembler, src []byte) error

DecodeBytes is like Decode, but it uses an input buffer directly. Decode will grab or read all the bytes from an io.Reader anyway, so this can save having to copy the bytes or create a bytes.Buffer.

func DecodeDuplicateEvidence

func DecodeDuplicateEvidence(na ipld.NodeAssembler, e types.DuplicateVoteEvidence) error

DecodeDuplicateEvidence is like Decode, but it uses an input tendermint DuplicateVoteEvidence type

func DecodeLightEvidence

func DecodeLightEvidence(na ipld.NodeAssembler, e types.LightClientAttackEvidence) error

DecodeLightEvidence is like Decode, but it uses an input tendermint LightClientAttackEvidence type

func Decoder deprecated

func Decoder(na ipld.NodeAssembler, r io.Reader) error

Deprecated: use Decode instead.

func Encode

func Encode(node ipld.Node, w io.Writer) error

Encode provides an IPLD codec encode interface for Tendermint Evidence IPLDs. This function is registered via the go-ipld-prime link loader for multicodec code XXX when this package is invoked via init.

func EncodeDuplicateEvidence

func EncodeDuplicateEvidence(de *types.DuplicateVoteEvidence, inNode ipld.Node) error

EncodeDuplicateEvidence is like Encode, but it uses an input tendermint DuplicateVoteEvidence type

func EncodeLightEvidence

func EncodeLightEvidence(le *types.LightClientAttackEvidence, inNode ipld.Node) error

EncodeLightEvidence is like Encode, but it uses an input tendermint LightClientAttackEvidence type

func Encoder deprecated

func Encoder(inNode ipld.Node, w io.Writer) error

Deprecated: use Encode instead.

func Marshal deprecated

func Marshal(inNode ipld.Node, w io.Writer) error

Deprecated: use Encode instead.

func Unmarshal deprecated

func Unmarshal(na ipld.NodeAssembler, r io.Reader) error

Deprecated: use Decode instead.

Types

type EvidenceKind

type EvidenceKind string
const (
	LIGHT_EVIDENCE     EvidenceKind = "LightClientAttackEvidence"
	DUPLICATE_EVIDENCE EvidenceKind = "DuplicateVoteEvidence"
)

func (EvidenceKind) String

func (n EvidenceKind) String() string

Jump to

Keyboard shortcuts

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