types

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamsJSON = "json"
	ParamsHex  = "hex"
)
View Source
const BigIntMaxSerializedLen = 128

BigIntMaxSerializedLen is the max length of a byte slice representing a CBOR serialized big.

Variables

This section is empty.

Functions

func BitLen

func BitLen(a Int) uint

func Cmp

func Cmp(a, b Int) int

func MsgStateToString

func MsgStateToString(state MessageState) string

func StateToString

func StateToString(state State) string

Types

type Address

type Address struct {
	ID   UUID            `json:"id"`
	Addr address.Address `json:"addr"`
	//max for current, use nonce and +1
	Nonce  uint64 `json:"nonce"`
	Weight int64  `json:"weight"`
	// number of address selection messages
	SelMsgNum         uint64  `json:"selMsgNum"`
	State             State   `json:"state"`
	GasOverEstimation float64 `json:"gasOverEstimation"`
	MaxFee            big.Int `json:"maxFee,omitempty"`
	MaxFeeCap         big.Int `json:"maxFeeCap"`

	IsDeleted int       `json:"isDeleted"` // 是否删除 1:是  -1:否
	CreatedAt time.Time `json:"createAt"`  // 创建时间
	UpdatedAt time.Time `json:"updateAt"`  // 更新时间
}

type Arguments

type Arguments struct{}

type Int

type Int struct {
	*big.Int
}

func Add

func Add(a, b Int) Int

func Div

func Div(a, b Int) Int

func Exp

func Exp(a Int, e Int) Int

Returns a**e unless e <= 0 (in which case returns 1).

func FromBytes

func FromBytes(buf []byte) (Int, error)

func FromString

func FromString(s string) (Int, error)

func Lsh

func Lsh(a Int, n uint) Int

Returns x << n

func Max

func Max(x, y Int) Int

func Min

func Min(x, y Int) Int

func Mod

func Mod(a, b Int) Int

func Mul

func Mul(a, b Int) Int

func MustFromString

func MustFromString(s string) Int

MustFromString convers dec string into big integer and panics if conversion is not sucessful.

func NewFromGo

func NewFromGo(i *big.Int) Int

func NewInt

func NewInt(i int64) Int

func NewIntUnsigned

func NewIntUnsigned(i uint64) Int

func PositiveFromUnsignedBytes

func PositiveFromUnsignedBytes(b []byte) Int

PositiveFromUnsignedBytes interprets b as the bytes of a big-endian unsigned integer and returns a positive Int with this absolute value.

func Product

func Product(ints ...Int) Int

func Rsh

func Rsh(a Int, n uint) Int

Returns x >> n

func Sub

func Sub(a, b Int) Int

func Subtract

func Subtract(num1 Int, ints ...Int) Int

func Sum

func Sum(ints ...Int) Int

func Zero

func Zero() Int

func (Int) Abs

func (bi Int) Abs() Int

Abs returns the absolute value of bi.

func (*Int) Bytes

func (bi *Int) Bytes() ([]byte, error)

func (Int) Copy

func (bi Int) Copy() Int

func (Int) Equals

func (bi Int) Equals(o Int) bool

Equals returns true if bi == o

func (Int) GreaterThan

func (bi Int) GreaterThan(o Int) bool

GreaterThan returns true if bi > o

func (Int) GreaterThanEqual

func (bi Int) GreaterThanEqual(o Int) bool

GreaterThanEqual returns true if bi >= o

func (*Int) IsZero

func (bi *Int) IsZero() bool

func (Int) LessThan

func (bi Int) LessThan(o Int) bool

LessThan returns true if bi < o

func (Int) LessThanEqual

func (bi Int) LessThanEqual(o Int) bool

LessThanEqual returns true if bi <= o

func (*Int) MarshalBinary

func (bi *Int) MarshalBinary() ([]byte, error)

func (*Int) MarshalJSON

func (bi *Int) MarshalJSON() ([]byte, error)

func (Int) Neg

func (bi Int) Neg() Int

Neg returns the negative of bi.

func (*Int) Nil

func (bi *Int) Nil() bool

func (*Int) NilOrZero

func (bi *Int) NilOrZero() bool

func (*Int) Scan

func (bi *Int) Scan(value interface{}) error

Scan assigns a value from a database driver. An error should be returned if the value cannot be stored without loss of information.

Reference types such as []byte are only valid until the next call to Scan and should not be retained. Their underlying memory is owned by the driver. If retention is necessary, copy their values before the next call to Scan.

func (*Int) UnmarshalBinary

func (bi *Int) UnmarshalBinary(buf []byte) error

func (*Int) UnmarshalJSON

func (bi *Int) UnmarshalJSON(b []byte) error

func (Int) Value

func (bi Int) Value() (driver.Value, error)

Value implement sql.Scanner

type Message

type Message struct {
	ID string

	UnsignedCid *cid.Cid
	SignedCid   *cid.Cid
	venusTypes.UnsignedMessage
	Signature *crypto.Signature

	Height     int64
	Confidence int64
	Receipt    *venusTypes.MessageReceipt
	TipSetKey  venusTypes.TipSetKey
	Meta       *MsgMeta
	WalletName string
	FromUser   string

	State MessageState

	CreatedAt time.Time
	UpdatedAt time.Time
}

func FromUnsignedMessage

func FromUnsignedMessage(unsignedMsg venusTypes.UnsignedMessage) *Message

type MessageState

type MessageState int
const (
	UnKnown MessageState = iota
	UnFillMsg
	FillMsg
	OnChainMsg
	FailedMsg
	ReplacedMsg
	NoWalletMsg
)

type MessageWithUID

type MessageWithUID struct {
	UnsignedMessage venusTypes.UnsignedMessage
	ID              string
}

type MsgMeta

type MsgMeta struct {
	ExpireEpoch       abi.ChainEpoch `json:"expireEpoch"`
	GasOverEstimation float64        `json:"gasOverEstimation"`
	MaxFee            big.Int        `json:"maxFee,omitempty"`
	MaxFeeCap         big.Int        `json:"maxFeeCap"`
}

type Node

type Node struct {
	ID UUID

	Name  string
	URL   string
	Token string
	Type  NodeType
}

type NodeType

type NodeType int
const (
	FullNode NodeType
	LightNode
)

type NonceMap

type NonceMap struct {
	// contains filtered or unexported fields
}

func NewNonceMap

func NewNonceMap() *NonceMap

func (*NonceMap) Add

func (nonceMap *NonceMap) Add(addr address.Address, val uint64)

func (*NonceMap) Each added in v1.1.0

func (nonceMap *NonceMap) Each(f func(addr address.Address, val uint64))

func (*NonceMap) Get

func (nonceMap *NonceMap) Get(addr address.Address) (uint64, bool)

func (*NonceMap) Len added in v1.1.0

func (nonceMap *NonceMap) Len() int

type SendParams added in v1.1.1

type SendParams struct {
	To      address.Address
	From    address.Address
	Val     abi.TokenAmount
	Account string

	GasPremium *abi.TokenAmount
	GasFeeCap  *abi.TokenAmount
	GasLimit   *int64

	Method     abi.MethodNum
	Params     string
	ParamsType string // json or hex
}

type SharedParams

type SharedParams struct {
	ID uint `json:"id"`

	GasOverEstimation float64 `json:"gasOverEstimation"`
	MaxFee            big.Int `json:"maxFee,omitempty"`
	MaxFeeCap         big.Int `json:"maxFeeCap"`

	SelMsgNum uint64 `json:"selMsgNum"`
}

func (*SharedParams) GetMsgMeta

func (sp *SharedParams) GetMsgMeta() *MsgMeta

type State

type State int
const (
	Alive State
	Removing
	Removed
	Forbiden // forbiden received message
)

type UUID

type UUID uuid.UUID

func NewUUID

func NewUUID() UUID

func ParseUUID

func ParseUUID(uid string) (UUID, error)

func (UUID) IsEmpty

func (uid UUID) IsEmpty() bool

Value implement sql.Scanner

func (UUID) MarshalJSON

func (uid UUID) MarshalJSON() ([]byte, error)

func (*UUID) Scan

func (uid *UUID) Scan(value interface{}) error

Scan assigns a value from a database driver. An error should be returned if the value cannot be stored without loss of information.

Reference types such as []byte are only valid until the next call to Scan and should not be retained. Their underlying memory is owned by the driver. If retention is necessary, copy their values before the next call to Scan.

func (UUID) String

func (uid UUID) String() string

Value implement sql.Scanner

func (*UUID) UnmarshalJSON

func (uid *UUID) UnmarshalJSON(b []byte) error

func (UUID) Value

func (uid UUID) Value() (driver.Value, error)

Value implement sql.Scanner

Jump to

Keyboard shortcuts

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