types

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TypeNat       = "nat"
	TypeInt       = "int"
	TypeString    = "string"
	TypeBool      = "bool"
	TypeBytes     = "bytes"
	TypeUnit      = "unit"
	TypeTimestamp = "timestamp"
	TypeAddress   = "address"
	TypeMutez     = "mutez"
	TypeKey       = "key"
	TypeKeyHash   = "key_hash"
	TypeSignature = "signature"
	TypeChainID   = "chain_id"
	TypeOperation = "operation"
	TypeContract  = "contract"
)

Builtin types

View Source
const (
	TypeStruct = "struct"
	TypeUnion  = "union"
	TypeList   = "list"
	TypeSet    = "set"
	TypeMap    = "map"
	TypeBigmap = "big_map"
	TypeOption = "option"
	TypeLambda = "lambda"
)

Container types

View Source
const HashSize = md5.Size

Variables

Functions

func TypeHash

func TypeHash(elems ...[]byte) []byte

Types

type Address

type Address struct{}

func (Address) Hash

func (Address) Hash() []byte

func (Address) TypeName

func (Address) TypeName() string

type Bigmap

type Bigmap struct {
	Key   Type
	Value Type
}

func (*Bigmap) Hash

func (b *Bigmap) Hash() []byte

func (Bigmap) TypeName

func (Bigmap) TypeName() string

type Bool

type Bool struct{}

func (Bool) Hash

func (Bool) Hash() []byte

func (Bool) TypeName

func (Bool) TypeName() string

type Bytes

type Bytes struct{}

func (Bytes) Hash

func (Bytes) Hash() []byte

func (Bytes) TypeName

func (Bytes) TypeName() string

type ChainID

type ChainID struct{}

func (ChainID) Hash

func (ChainID) Hash() []byte

func (ChainID) TypeName

func (ChainID) TypeName() string

type Contract

type Contract struct{}

func (Contract) Hash

func (Contract) Hash() []byte

func (Contract) TypeName

func (Contract) TypeName() string

type Int

type Int struct{}

func (Int) Hash

func (Int) Hash() []byte

func (Int) TypeName

func (Int) TypeName() string

type Key

type Key struct{}

func (Key) Hash

func (Key) Hash() []byte

func (Key) TypeName

func (Key) TypeName() string

type KeyHash

type KeyHash struct{}

func (KeyHash) Hash

func (KeyHash) Hash() []byte

func (KeyHash) TypeName

func (KeyHash) TypeName() string

type Lambda added in v0.4.0

type Lambda struct {
	Param  Type
	Return Type
}

func (*Lambda) Hash added in v0.4.0

func (l *Lambda) Hash() []byte

func (Lambda) TypeName added in v0.4.0

func (Lambda) TypeName() string

type List

type List struct {
	Type Type
}

func (*List) Hash

func (l *List) Hash() []byte

func (List) TypeName

func (List) TypeName() string

type Map

type Map struct {
	Key   Type
	Value Type
}

func (*Map) Hash

func (m *Map) Hash() []byte

func (Map) TypeName

func (Map) TypeName() string

type Mutez

type Mutez struct{}

func (Mutez) Hash

func (Mutez) Hash() []byte

func (Mutez) TypeName

func (Mutez) TypeName() string

type Nat

type Nat struct{}

func (Nat) Hash

func (Nat) Hash() []byte

func (Nat) TypeName

func (Nat) TypeName() string

type Operation

type Operation struct{}

func (Operation) Hash

func (Operation) Hash() []byte

func (Operation) TypeName

func (Operation) TypeName() string

type Option

type Option struct {
	Type Type
}

func (*Option) Hash

func (o *Option) Hash() []byte

func (Option) TypeName

func (Option) TypeName() string

type Param

type Param struct {
	Name         string
	OriginalType string // TODO: keep?
	Type         Type
}

Param is a type associated with a name. It can be an argument of an entrypoint or a field of a struct.

func (Param) Hash

func (p Param) Hash() []byte

type Set

type Set struct {
	Type Type
}

func (*Set) Hash

func (s *Set) Hash() []byte

func (Set) TypeName

func (Set) TypeName() string

type Signature

type Signature struct{}

func (Signature) Hash

func (Signature) Hash() []byte

func (Signature) TypeName

func (Signature) TypeName() string

type String

type String struct{}

func (String) Hash

func (String) Hash() []byte

func (String) TypeName

func (String) TypeName() string

type Struct

type Struct struct {
	Name   string
	Fields []Param
	// If true, the expected prim matching to this struct has a flat structure,
	// instead of a tree of pairs.
	Flat bool
}

Struct is an aggregation of named fields. It corresponds to non-top-level `pair` prims, in Michelson. It can represent either a parameter's type of entrypoint, or a record in a storage type.

func (*Struct) Hash

func (s *Struct) Hash() []byte

func (Struct) TypeName

func (Struct) TypeName() string

type Timestamp

type Timestamp struct{}

func (Timestamp) Hash

func (Timestamp) Hash() []byte

func (Timestamp) TypeName

func (Timestamp) TypeName() string

type Type

type Type interface {
	TypeName() string
	Hash() []byte
}

type Union

type Union struct {
	Name  string
	Left  Type
	Right Type
}

Union is a type that can be either its Left type, or its Right one. It corresponds to `or` types in Michelson.

func (*Union) Hash

func (u *Union) Hash() []byte

func (Union) TypeName

func (Union) TypeName() string

type Unit

type Unit struct{}

func (Unit) Hash

func (Unit) Hash() []byte

func (Unit) TypeName

func (Unit) TypeName() string

Jump to

Keyboard shortcuts

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