Documentation ¶
Index ¶
- Constants
- Variables
- func DisableLog()
- func IsEqualPrim(p1, p2 Prim, withAnno bool) bool
- func IsManagerTz(buf []byte) bool
- func KeyHash(buf []byte) tezos.ExprHash
- func UseLogger(logger logpkg.Logger)
- type BigmapDiff
- type BigmapDiffElem
- type Bool
- type Ciphertext
- type Code
- type DiffAction
- type Entrypoint
- type Entrypoints
- type Features
- type Interface
- type Interfaces
- type Key
- func (k Key) Bytes() []byte
- func (k Key) Hash() tezos.ExprHash
- func (k Key) IsPacked() bool
- func (k Key) MarshalBinary() ([]byte, error)
- func (k Key) MarshalJSON() ([]byte, error)
- func (k Key) Prim() Prim
- func (k Key) PrimPtr() *Prim
- func (k Key) String() string
- func (k Key) Unpack() (Key, error)
- func (k Key) UnpackPrim() (p Prim, err error)
- type OpCode
- type Parameters
- func (p Parameters) Branch(prefix string, eps Entrypoints) string
- func (p Parameters) MapEntrypoint(script *Script) (Entrypoint, Prim, error)
- func (p Parameters) MarshalBinary() ([]byte, error)
- func (p Parameters) MarshalJSON() ([]byte, error)
- func (p *Parameters) UnmarshalBinary(data []byte) error
- func (p *Parameters) UnmarshalJSON(data []byte) error
- func (p Parameters) Unwrap(branch string) Prim
- type Prim
- func ASSERT_CMPEQ() Prim
- func DELEGATE_ENTRY() Prim
- func DO_ENTRY() Prim
- func DUUP() Prim
- func IFCMPNEQ(left, right Prim) Prim
- func NewBig(i *big.Int) Prim
- func NewBigmapRef(id int64) Prim
- func NewBigmapRefType(anno string) Prim
- func NewBytes(b []byte) Prim
- func NewCode(c OpCode, args ...Prim) Prim
- func NewCodeAnno(c OpCode, anno string, args ...Prim) Prim
- func NewInt64(i int64) Prim
- func NewPairType(l, r Prim, anno ...string) Prim
- func NewPairValue(l, r Prim, anno ...string) Prim
- func NewPrim(c OpCode, anno ...string) Prim
- func NewSeq(args ...Prim) Prim
- func NewString(s string) Prim
- func UNPAIR() Prim
- func (p Prim) BuildType() Type
- func (p Prim) CanUnfold(typ Type) bool
- func (p Prim) Clone() Prim
- func (p Prim) ContainsOpCode(typ OpCode) bool
- func (p *Prim) DecodeBuffer(buf *bytes.Buffer) error
- func (p Prim) Dump() string
- func (p Prim) DumpLimit(n int) string
- func (p Prim) EncodeBuffer(buf *bytes.Buffer) error
- func (p Prim) FindLabels(label string) ([]Prim, bool)
- func (p Prim) FindOpCodes(typ OpCode) ([]Prim, bool)
- func (p Prim) FoldPair() Prim
- func (p Prim) GetFieldAnno() string
- func (p Prim) GetFieldAnnoAny() string
- func (p Prim) GetIndex(index []int) (Prim, error)
- func (p Prim) GetPath(path string) (Prim, error)
- func (p Prim) GetTypeAnno() string
- func (p Prim) GetTypeAnnoAny() string
- func (p Prim) GetVarAnno() string
- func (p Prim) GetVarAnnoAny() string
- func (p Prim) GetVarOrFieldAnno() string
- func (p Prim) HasAnno() bool
- func (p Prim) HasFieldAnno() bool
- func (p Prim) HasTypeAnno() bool
- func (p Prim) HasVarAnno() bool
- func (p Prim) HasVarOrFieldAnno() bool
- func (p Prim) Index(label string) ([]int, bool)
- func (p Prim) IsContainerType() bool
- func (p Prim) IsConvertedComb() bool
- func (p Prim) IsElt() bool
- func (p Prim) IsEqual(p2 Prim) bool
- func (p Prim) IsEqualWithAnno(p2 Prim) bool
- func (p Prim) IsLambda() bool
- func (p Prim) IsList() bool
- func (p Prim) IsMap() bool
- func (p Prim) IsNil() bool
- func (p Prim) IsOperation() bool
- func (p Prim) IsPacked() bool
- func (p Prim) IsPackedAny() bool
- func (p Prim) IsPair() bool
- func (p Prim) IsScalar() bool
- func (p Prim) IsScalarType() bool
- func (p Prim) IsSequence() bool
- func (p Prim) IsSet() bool
- func (p Prim) IsTicket() bool
- func (p Prim) IsValid() bool
- func (p Prim) LooksLikeContainer() bool
- func (p Prim) LooksLikeLambda() bool
- func (p Prim) LooksLikeMap() bool
- func (p Prim) LooksLikeSet() bool
- func (p Prim) MarshalBinary() ([]byte, error)
- func (p Prim) MarshalJSON() ([]byte, error)
- func (p Prim) MatchesAnno(anno string) bool
- func (p Prim) MigrateToBabylonStorage(managerHash []byte) Prim
- func (p *Prim) StripAnno(name string)
- func (p Prim) UnfoldPair(typ Type) []Prim
- func (p *Prim) UnmarshalBinary(data []byte) error
- func (p *Prim) UnmarshalJSON(data []byte) error
- func (p Prim) Unpack() (pp Prim, err error)
- func (p Prim) UnpackAll() (Prim, error)
- func (p *Prim) UnpackJSON(val interface{}) error
- func (p *Prim) UnpackPrimitive(val map[string]interface{}) error
- func (p *Prim) UnpackScalar(val interface{}) error
- func (p *Prim) UnpackSequence(val []interface{}) error
- func (p Prim) Value(as OpCode) interface{}
- func (p *Prim) Visit(f PrimVisitorFunc) error
- func (p Prim) Walk(f PrimWalkerFunc) error
- type PrimType
- type PrimVisitorFunc
- type PrimWalkerFunc
- type SaplingDiffElem
- type SaplingUpdate
- type Script
- func (s *Script) BigmapsById() []int64
- func (s *Script) BigmapsByName() map[string]int64
- func (s *Script) CodeHash() []byte
- func (s *Script) Entrypoints(withPrim bool) (Entrypoints, error)
- func (s *Script) Features() Features
- func (s *Script) Implements(i Interface) bool
- func (s *Script) InterfaceHash() []byte
- func (s *Script) Interfaces() Interfaces
- func (p Script) MarshalBinary() ([]byte, error)
- func (s *Script) MigrateToBabylonAddDo(managerHash []byte)
- func (s *Script) MigrateToBabylonSetDelegate(managerHash []byte)
- func (s *Script) SearchEntrypointName(name string) string
- func (s *Script) StorageHash() []byte
- func (s *Script) StorageType() Type
- func (p *Script) UnmarshalBinary(data []byte) error
- type Stack
- type Type
- func (t Type) Clone() Type
- func (t Type) HasLabel() bool
- func (t Type) IsEqual(t2 Type) bool
- func (t Type) IsEqualWithAnno(t2 Type) bool
- func (t Type) Label() string
- func (t Type) Left() Type
- func (t Type) MarshalJSON() ([]byte, error)
- func (t Type) Right() Type
- func (t Type) Typedef(name string) Typedef
- func (t Type) TypedefPtr(name string) *Typedef
- func (t *Type) UnmarshalBinary(buf []byte) error
- type Typedef
- type Value
- func (v *Value) Decode(buf []byte) error
- func (e Value) Dump() string
- func (e Value) DumpLimit(n int) string
- func (e Value) DumpTo(w io.Writer)
- func (e *Value) FixType()
- func (v *Value) GetAddress(label string) (tezos.Address, bool)
- func (v *Value) GetBig(label string) (*big.Int, bool)
- func (v *Value) GetBool(label string) (bool, bool)
- func (v *Value) GetBytes(label string) ([]byte, bool)
- func (v *Value) GetInt64(label string) (int64, bool)
- func (v *Value) GetKey(label string) (tezos.Key, bool)
- func (v *Value) GetSignature(label string) (tezos.Signature, bool)
- func (v *Value) GetString(label string) (string, bool)
- func (v *Value) GetTime(label string) (time.Time, bool)
- func (v *Value) GetValue(label string) (interface{}, bool)
- func (v Value) IsPacked() bool
- func (v Value) IsPackedAny() bool
- func (e *Value) Map() (interface{}, error)
- func (e Value) MarshalJSON() ([]byte, error)
- func (v *Value) Unmarshal(label string, val interface{}) error
- func (v Value) Unpack() (Value, error)
- func (v Value) UnpackAll() (Value, error)
- func (v *Value) Walk(label string, fn ValueWalkerFunc) error
- type ValueWalkerFunc
- type Z
- func (z *Z) Big() *big.Int
- func (z *Z) DecodeBuffer(buf *bytes.Buffer) error
- func (z *Z) EncodeBuffer(buf *bytes.Buffer) error
- func (z *Z) Int64() int64
- func (z *Z) MarshalBinary() ([]byte, error)
- func (z *Z) Set(b *big.Int) *Z
- func (z *Z) SetInt64(i int64) *Z
- func (z *Z) UnmarshalBinary(data []byte) error
Constants ¶
const ( TypeAnnoPrefix = ":" VarAnnoPrefix = "%" FieldAnnoPrefix = "@" )
const ( TypeStruct = "struct" TypeUnion = "union" )
Extra Types
const ( CONST_ENTRYPOINT = "@entrypoint" CONST_KEY = "@key" CONST_VALUE = "@value" CONST_ITEM = "@item" CONST_PARAM = "@param" CONST_RETURN = "@return" CONST_UNION_LEFT = "@or_0" CONST_UNION_RIGHT = "@or_1" )
Default names
const EMPTY_LABEL = `@%%@` // illegal Michelson annotation value
const PATH_SEPARATOR = "."
Variables ¶
var ( IManager = Interface("MANAGER") ISetDelegate = Interface("SET_DELEGATE") ITzip5 = Interface("TZIP-005") ITzip7 = Interface("TZIP-007") ITzip12 = Interface("TZIP-012") IDexter = Interface("DEXTER") )
var ( InvalidPrim = Prim{} EmptyPrim = Prim{Type: PrimNullary, OpCode: 255} )
var BigmapRefType = Prim{ Type: PrimNullary, OpCode: T_INT, }
var PrimSkip = errors.New("skip branch")
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func IsEqualPrim ¶
func IsManagerTz ¶
Types ¶
type BigmapDiff ¶
type BigmapDiff []BigmapDiffElem
func (BigmapDiff) MarshalBinary ¶
func (b BigmapDiff) MarshalBinary() ([]byte, error)
func (*BigmapDiff) UnmarshalBinary ¶
func (b *BigmapDiff) UnmarshalBinary(data []byte) error
type BigmapDiffElem ¶
type BigmapDiffElem struct { Action DiffAction Id int64 SourceId int64 // used on copy DestId int64 // used on copy KeyHash tezos.ExprHash Key Prim // works with any type Value Prim KeyType Prim // used on alloc/copy, uses Prim for native marshalling ValueType Prim // used on alloc/copy, uses Prim for native marshalling }
func (BigmapDiffElem) Encoding ¶
func (e BigmapDiffElem) Encoding() PrimType
func (BigmapDiffElem) GetKey ¶
func (e BigmapDiffElem) GetKey(typ Type) Key
func (BigmapDiffElem) GetKeyPtr ¶
func (e BigmapDiffElem) GetKeyPtr(typ Type) *Key
func (BigmapDiffElem) MarshalJSON ¶
func (e BigmapDiffElem) MarshalJSON() ([]byte, error)
func (*BigmapDiffElem) UnmarshalJSON ¶
func (e *BigmapDiffElem) UnmarshalJSON(data []byte) error
TODO: lazy_storage_diff updates
type Ciphertext ¶
type Ciphertext struct { Cv []byte Epk []byte PayloadEnc []byte NonceEnc []byte PayloadOut []byte NonceOut []byte }
func (*Ciphertext) UnmarshalJSON ¶
func (c *Ciphertext) UnmarshalJSON(data []byte) error
type Code ¶
type Code struct { Param Prim // call types Storage Prim // storage types Code Prim // program code BadCode *Prim // catch-all for ill-formed contracts }
func (Code) MarshalBinary ¶
func (Code) MarshalJSON ¶
func (*Code) UnmarshalBinary ¶
func (*Code) UnmarshalJSON ¶
type DiffAction ¶
type DiffAction byte
const ( DiffActionUpdate DiffAction = iota DiffActionRemove DiffActionCopy DiffActionAlloc )
func ParseDiffAction ¶
func ParseDiffAction(data string) (DiffAction, error)
func (DiffAction) MarshalText ¶
func (a DiffAction) MarshalText() ([]byte, error)
func (DiffAction) String ¶
func (a DiffAction) String() string
func (*DiffAction) UnmarshalText ¶
func (a *DiffAction) UnmarshalText(data []byte) error
type Entrypoint ¶
type Entrypoint struct { Id int `json:"id"` Call string `json:"call"` Branch string `json:"branch"` Typedef []Typedef `json:"type"` Prim *Prim `json:"prim,omitempty"` }
func (Entrypoint) Type ¶
func (e Entrypoint) Type() Type
type Entrypoints ¶
type Entrypoints map[string]Entrypoint
func (Entrypoints) FindBranch ¶
func (e Entrypoints) FindBranch(branch string) (Entrypoint, bool)
func (Entrypoints) FindId ¶
func (e Entrypoints) FindId(id int) (Entrypoint, bool)
type Interface ¶
type Interface string
func (Interface) Matches ¶
func (m Interface) Matches(e Entrypoints) bool
search all interfaces in the list of entrypoints
type Interfaces ¶
type Interfaces []Interface
func (Interfaces) Contains ¶
func (i Interfaces) Contains(x Interface) bool
func (Interfaces) MarshalJSON ¶
func (i Interfaces) MarshalJSON() ([]byte, error)
func (Interfaces) MarshalText ¶
func (i Interfaces) MarshalText() ([]byte, error)
func (*Interfaces) Parse ¶
func (i *Interfaces) Parse(s string) error
func (Interfaces) String ¶
func (i Interfaces) String() string
func (*Interfaces) UnmarshalText ¶
func (i *Interfaces) UnmarshalText(b []byte) error
type Key ¶
type Key struct { Type Type // TODO: refactor into simple Prim IntKey *big.Int StringKey string BytesKey []byte BoolKey bool AddrKey tezos.Address KeyKey tezos.Key SignatureKey tezos.Signature TimeKey time.Time PrimKey Prim }
Comparable key as used in bigmaps and maps
func (Key) MarshalBinary ¶
func (Key) MarshalJSON ¶
func (Key) UnpackPrim ¶
type OpCode ¶
type OpCode byte
const ( // Keys K_PARAMETER OpCode = iota // 00 K_STORAGE // 01 K_CODE // 02 // Data D_FALSE // 03 D_ELT // 04 D_LEFT // 05 D_NONE // 06 D_PAIR // 07 D_RIGHT // 08 D_SOME // 09 D_TRUE // 0A D_UNIT // 0B // instructions I_PACK // 0C I_UNPACK // 0D I_BLAKE2B // 0E I_SHA256 // 0F I_SHA512 // 10 I_ABS // 11 I_ADD // 12 I_AMOUNT // 13 I_AND // 14 I_BALANCE // 15 I_CAR // 16 I_CDR // 17 I_CHECK_SIGNATURE // 18 I_COMPARE // 19 I_CONCAT // 1A I_CONS // 1B I_CREATE_ACCOUNT // 1C I_CREATE_CONTRACT // 1D I_IMPLICIT_ACCOUNT // 1E I_DIP // 1F I_DROP // 20 I_DUP // 21 I_EDIV // 22 I_EMPTY_MAP // 23 I_EMPTY_SET // 24 I_EQ // 25 I_EXEC // 26 I_FAILWITH // 27 I_GE // 28 I_GET // 29 I_GT // 2A I_HASH_KEY // 2B I_IF // 2C I_IF_CONS // 2D I_IF_LEFT // 2E I_IF_NONE // 2F I_INT // 30 I_LAMBDA // 31 I_LE // 32 I_LEFT // 33 I_LOOP // 34 I_LSL // 35 I_LSR // 36 I_LT // 37 I_MAP // 38 I_MEM // 39 I_MUL // 3A I_NEG // 3B I_NEQ // 3C I_NIL // 3D I_NONE // 3E I_NOT // 3F I_NOW // 40 I_OR // 41 I_PAIR // 42 I_PUSH // 43 I_RIGHT // 44 I_SIZE // 45 I_SOME // 46 I_SOURCE // 47 I_SENDER // 48 I_SELF // 49 I_STEPS_TO_QUOTA // 4A I_SUB // 4B I_SWAP // 4C I_TRANSFER_TOKENS // 4D I_SET_DELEGATE // 4E I_UNIT // 4F I_UPDATE // 50 I_XOR // 51 I_ITER // 52 I_LOOP_LEFT // 53 I_ADDRESS // 54 I_CONTRACT // 55 I_ISNAT // 56 I_CAST // 57 I_RENAME // 58 // Types T_BOOL // 59 T_CONTRACT // 5A T_INT // 5B T_KEY // 5C T_KEY_HASH // 5D T_LAMBDA // 5E T_LIST // 5F T_MAP // 60 T_BIG_MAP // 61 T_NAT // 62 T_OPTION // 63 T_OR // 64 T_PAIR // 65 T_SET // 66 T_SIGNATURE // 67 T_STRING // 68 T_BYTES // 69 T_MUTEZ // 6A T_TIMESTAMP // 6B T_UNIT // 6C T_OPERATION // 6D T_ADDRESS // 6E // v002 addition I_SLICE // 6F // v005 addition // https://blog.nomadic-labs.com/michelson-updates-in-005.html I_DIG // 70 I_DUG // 71 I_EMPTY_BIG_MAP // 72 I_APPLY // 73 T_CHAIN_ID // 74 I_CHAIN_ID // 75 // v008 additions I_LEVEL // 76 I_SELF_ADDRESS // 77 T_NEVER // 78 I_NEVER // 79 I_UNPAIR // 7A I_VOTING_POWER // 7B I_TOTAL_VOTING_POWER // 7C I_KECCAK // 7D I_SHA3 // 7E I_PAIRING_CHECK // 7F T_BLS12_381_G1 // 80 T_BLS12_381_G2 // 81 T_BLS12_381_FR // 82 T_SAPLING_STATE // 83 T_SAPLING_TRANSACTION // 84 I_SAPLING_EMPTY_STATE // 85 I_SAPLING_VERIFY_UPDATE // 86 T_TICKET // 87 I_TICKET // 88 I_READ_TICKET // 89 I_SPLIT_TICKET // 8A I_JOIN_TICKETS // 8B I_GET_AND_UPDATE // 8C )
Michelson V1 Primitives
func InferKeyType ¶
func ParseKeyType ¶
func ParseOpCode ¶
func (OpCode) IsTypeCode ¶
func (OpCode) MarshalText ¶
type Parameters ¶
func (Parameters) Branch ¶
func (p Parameters) Branch(prefix string, eps Entrypoints) string
func (Parameters) MapEntrypoint ¶
func (p Parameters) MapEntrypoint(script *Script) (Entrypoint, Prim, error)
func (Parameters) MarshalBinary ¶
func (p Parameters) MarshalBinary() ([]byte, error)
stay compatible with v005 transaction serialization
func (Parameters) MarshalJSON ¶
func (p Parameters) MarshalJSON() ([]byte, error)
func (*Parameters) UnmarshalBinary ¶
func (p *Parameters) UnmarshalBinary(data []byte) error
func (*Parameters) UnmarshalJSON ¶
func (p *Parameters) UnmarshalJSON(data []byte) error
func (Parameters) Unwrap ¶
func (p Parameters) Unwrap(branch string) Prim
type Prim ¶
type Prim struct { Type PrimType // primitive type OpCode OpCode // primitive opcode (invalid on sequences, strings, bytes, int) Args []Prim // optional arguments Anno []string // optional type annotations Int *big.Int // optional data String string // optional data Bytes []byte // optional data WasPacked bool // true when content was unpacked (and no type info is available) }
func NewBigmapRef ¶
func NewBigmapRefType ¶
func NewPairType ¶
func NewPairValue ¶
func (Prim) CanUnfold ¶
Detects whether a primitive contains a regular pair or any form of container type. Pairs can be unfolded into flat sequences.
func (Prim) ContainsOpCode ¶
func (Prim) GetFieldAnno ¶
func (Prim) GetFieldAnnoAny ¶
prefers FieldAnno, first anno otherwise
func (Prim) GetTypeAnno ¶
func (Prim) GetTypeAnnoAny ¶
prefers TypeAnno, first anno otherwise
func (Prim) GetVarAnno ¶
func (Prim) GetVarAnnoAny ¶
prefers VarAnno, first anno otherwise
func (Prim) GetVarOrFieldAnno ¶ added in v0.9.2
func (Prim) HasFieldAnno ¶
func (Prim) HasTypeAnno ¶
func (Prim) HasVarAnno ¶
func (Prim) HasVarOrFieldAnno ¶ added in v0.9.2
func (Prim) IsContainerType ¶
func (Prim) IsConvertedComb ¶
Checks if a Prim looks like an optimized (i.e. flat) comb sequence.
func (Prim) IsEqualWithAnno ¶
func (Prim) IsOperation ¶
func (Prim) IsPacked ¶
Checks if a primitve contains a packed value such as a byte sequence generated with PACK (starting with 0x05), an address or ascii/utf string.
func (Prim) IsPackedAny ¶
func (Prim) IsScalar ¶
returns true when the prim can be expressed as a single value key/value pairs (ie. prims with annots) do not fit into this category used when mapping complex big map values to JSON objects
func (Prim) IsScalarType ¶
func (Prim) IsSequence ¶
func (Prim) LooksLikeContainer ¶
Checks if a Prim looks like a container type. This is necessary to distinguish optimized comb pairs from other container types.
func (Prim) LooksLikeLambda ¶
Checks if a Prim looks like a lambda type.
func (Prim) LooksLikeMap ¶
func (Prim) LooksLikeSet ¶
func (Prim) MarshalBinary ¶
func (Prim) MarshalJSON ¶
func (Prim) MatchesAnno ¶
func (Prim) MigrateToBabylonStorage ¶
func (Prim) UnfoldPair ¶
Converts a pair tree into a flat sequence. While Michelson optimized comb pairs are only used for right-side combs, this function applies to all pairs. It makes use of the type definition to identify which contained type is a regular pair, an already unfolded pair sequence or anther container type.
- Works both on value trees and type trees. - When called on already converted comb sequences this function is a noop.
func (*Prim) UnmarshalBinary ¶
func (*Prim) UnmarshalJSON ¶
func (Prim) Unpack ¶
Unpacks all primitive contents that looks like packed and returns a new primitive tree.
func (*Prim) UnpackJSON ¶
func (*Prim) UnpackPrimitive ¶
func (*Prim) UnpackScalar ¶
func (*Prim) UnpackSequence ¶
func (*Prim) Visit ¶
func (p *Prim) Visit(f PrimVisitorFunc) error
Visit traverses the prim tree in pre-order and allows the callback to alter the contents of a visited node.
func (Prim) Walk ¶
func (p Prim) Walk(f PrimWalkerFunc) error
Walk traverses the prim tree in pre-order in read-only mode, forwarding value copies to the callback.
type PrimType ¶
type PrimType byte
const ( PrimInt PrimType = iota // 00 {name: 'int'} PrimString // 01 {name: 'string'} PrimSequence // 02 [] PrimNullary // 03 {name: 'prim', len: 0, annots: false}, PrimNullaryAnno // 04 {name: 'prim', len: 0, annots: true}, PrimUnary // 05 {name: 'prim', len: 1, annots: false}, PrimUnaryAnno // 06 {name: 'prim', len: 1, annots: true}, PrimBinary // 07 {name: 'prim', len: 2, annots: false}, PrimBinaryAnno // 08 {name: 'prim', len: 2, annots: true}, PrimVariadicAnno // 09 {name: 'prim', len: n, annots: true}, PrimBytes // 0A {name: 'bytes' } )
func ParsePrimType ¶
func (PrimType) MarshalText ¶
type PrimVisitorFunc ¶
PrimWalkerFunc is the callback function signature used while traversing a prim tree. The callback may change the contents of the visited node, including altering nested child nodes and annotations.
type PrimWalkerFunc ¶
PrimWalkerFunc is the callback function signature used while traversing a prim tree in read-only mode.
type SaplingDiffElem ¶
type SaplingDiffElem struct { Action DiffAction `json:"action"` Updates SaplingUpdate `json:"updates"` MemoSize int `json:"memo_size"` }
type SaplingUpdate ¶
type SaplingUpdate struct { Commitments [][]byte `json:"commitments"` Ciphertexts []Ciphertext `json:"ciphertexts"` Nullifiers [][]byte `json:"nullifiers"` }
type Script ¶
type Script struct { Code Code `json:"code"` // code section, i.e. parameter & storage types, code Storage Prim `json:"storage"` // data section, i.e. initial contract storage }
func MakeManagerScript ¶
func (*Script) BigmapsById ¶
Returns a list of bigmaps referenced by a contracts current storage. Note that in rare cases when storage type uses a T_OR branch above its bigmap type definitions and the relevant branch is inactive/hidden the storage value lacks bigmap references and this function will return an empty list, even though bigmaps exist.
func (*Script) BigmapsByName ¶
Returns a named map containing all bigmaps currently referenced by a contracts storage value. Names are derived from Michelson type annotations and if missing, a sequence number. Optionally appends a sequence number to prevent duplicate names.
func (*Script) CodeHash ¶
Returns the first 4 bytes of the SHA256 hash from a binary encoded code section of a contract.
func (*Script) Entrypoints ¶
func (s *Script) Entrypoints(withPrim bool) (Entrypoints, error)
func (*Script) Implements ¶
func (*Script) InterfaceHash ¶
Returns the first 4 bytes of the SHA256 hash from a binary encoded parameter type definition. This value is sufficiently unique to identify contracts with exactly the same entrypoints including annotations.
To identify syntactically equal entrypoints with or without annotations use `IsEqual()`, `IsEqualWithAnno()` or `IsEqualPrim()`.
func (*Script) Interfaces ¶
func (s *Script) Interfaces() Interfaces
func (Script) MarshalBinary ¶
func (*Script) MigrateToBabylonAddDo ¶
Patch params, storage and code
func (*Script) MigrateToBabylonSetDelegate ¶
func (*Script) SearchEntrypointName ¶
returns path to named entrypoint
func (*Script) StorageHash ¶
Returns the first 4 bytes of the SHA256 hash from a binary encoded storage type definition. This value is sufficiently unique to identify contracts with exactly the same entrypoints including annotations.
func (*Script) StorageType ¶
func (*Script) UnmarshalBinary ¶
type Type ¶
type Type struct {
Prim
}
func NewTypePtr ¶
func TicketType ¶
Wraps ticket value type into type structure that is compatible with ticket values. This is necessary because T_TICKET uses an implicit structure (extra fields amount, ticketer) in addition to the defined value.
func (Type) IsEqualWithAnno ¶
func (Type) MarshalJSON ¶
func (Type) TypedefPtr ¶
func (*Type) UnmarshalBinary ¶
type Value ¶
func NewValuePtr ¶
func (Value) IsPackedAny ¶
func (Value) MarshalJSON ¶
type ValueWalkerFunc ¶
type Z ¶
A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells if this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.