Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

types.gno

0.86 Kb · 36 lines
 1package rlp
 2
 3import "errors"
 4
 5// Kind identifies the RLP item kind after reading the leading tag.
 6type Kind int
 7
 8const (
 9	KindByte Kind = iota
10	KindString
11	KindList
12)
13
14// Value is a decoded RLP item. Bytes holds the payload for byte/string items.
15// List holds child items for lists.
16type Value struct {
17	Kind  Kind
18	Bytes []byte
19	List  []Value
20}
21
22var (
23	ErrExpectedString = errors.New("rlp: expected string")
24	ErrExpectedList   = errors.New("rlp: expected list")
25	ErrCanonSize      = errors.New("rlp: non-canonical size")
26	ErrCanonInt       = errors.New("rlp: non-canonical integer")
27	ErrValueTooLarge  = errors.New("rlp: value too large")
28	ErrTrailingBytes  = errors.New("rlp: trailing bytes")
29	ErrUnexpectedEOF  = errors.New("rlp: unexpected eof")
30	ErrDepthLimit     = errors.New("rlp: depth limit exceeded")
31)
32
33const (
34	maxDecodeDepth = 256
35	maxInt         = int(^uint(0) >> 1)
36)