types

package
v0.0.0-...-23aaab0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MessageVersion = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	Code    cid.Cid         `json:"Code"`
	Head    cid.Cid         `json:"Head"`
	Nonce   uint64          `json:"Nonce"`
	Balance decimal.Decimal `json:"Balance"`
}

type BeaconEntry

type BeaconEntry struct {
	Round uint64
	Data  []byte
}

type BlockHeader

type BlockHeader struct {
	Miner                 string
	Ticket                *Ticket
	Parents               []cid.Cid
	ParentWeight          decimal.Decimal
	Height                int64
	ParentStateRoot       cid.Cid
	ParentMessageReceipts cid.Cid
	Messages              cid.Cid
	BLSAggregate          *crypto.Signature
	Timestamp             uint64
	BlockSig              *crypto.Signature
	ForkSignaling         uint64
	ParentBaseFee         decimal.Decimal
}

type BlockMessages

type BlockMessages struct {
	BlsMessages   []*Message       `json:"BlsMessages"`
	SecpkMessages []*SignedMessage `json:"SecpkMessages"`
	Cids          []cid.Cid        `json:"Cids"`
}

type ExecutionTrace

type ExecutionTrace struct {
	Msg        *Message
	MsgRct     *MessageReceipt
	Error      string
	Duration   time.Duration
	GasCharges []*GasTrace

	Subcalls []ExecutionTrace
}

type GasTrace

type GasTrace struct {
	Name string

	Location          []Loc `json:"loc"`
	TotalGas          int64 `json:"tg"`
	ComputeGas        int64 `json:"cg"`
	StorageGas        int64 `json:"sg"`
	TotalVirtualGas   int64 `json:"vtg"`
	VirtualComputeGas int64 `json:"vcg"`
	VirtualStorageGas int64 `json:"vsg"`

	TimeTaken time.Duration `json:"tt"`
	Extra     interface{}   `json:"ex,omitempty"`
}

type HeadChange

type HeadChange struct {
	Type string
	Val  *TipSet
}

type InvocResult

type InvocResult struct {
	Msg            *Message
	MsgRct         *MessageReceipt
	ExecutionTrace ExecutionTrace
	Error          string
	Duration       time.Duration
}

type IpldObject

type IpldObject struct {
	Cid cid.Cid
	Obj interface{}
}

type KeyInfo

type KeyInfo struct {
	Type       KeyType
	PrivateKey []byte
}

KeyInfo is used for storing keys in KeyStore

type KeyType

type KeyType string

KeyType defines a type of a key

const (
	KTBLS             KeyType = "bls"
	KTSecp256k1       KeyType = "secp256k1"
	KTSecp256k1Ledger KeyType = "secp256k1-ledger"
)

func (*KeyType) UnmarshalJSON

func (kt *KeyType) UnmarshalJSON(bb []byte) error

type Loc

type Loc struct {
	File     string
	Line     int
	Function string
}

type Message

type Message struct {
	Version    uint64          `json:"Version"`
	To         address.Address `json:"To"`
	From       address.Address `json:"From"`
	Nonce      uint64          `json:"Nonce"`
	Value      abi.TokenAmount `json:"Value"`
	GasLimit   int64           `json:"GasLimit"`
	GasFeeCap  abi.TokenAmount `json:"GasFeeCap"`
	GasPremium abi.TokenAmount `json:"GasPremium"`
	Method     abi.MethodNum   `json:"Method"`
	Params     []byte          `json:"Params"`
}

func DecodeMessage

func DecodeMessage(b []byte) (*Message, error)

func (*Message) Caller

func (m *Message) Caller() address.Address

func (*Message) ChainLength

func (m *Message) ChainLength() int

func (*Message) Cid

func (m *Message) Cid() cid.Cid

func (*Message) MarshalCBOR

func (t *Message) MarshalCBOR(w io.Writer) error

func (*Message) MarshalJSON

func (m *Message) MarshalJSON() ([]byte, error)

func (*Message) Receiver

func (m *Message) Receiver() address.Address

func (*Message) Serialize

func (m *Message) Serialize() ([]byte, error)

func (*Message) ToStorageBlock

func (m *Message) ToStorageBlock() (block.Block, error)

func (*Message) UnmarshalCBOR

func (t *Message) UnmarshalCBOR(r io.Reader) error

func (*Message) VMMessage

func (m *Message) VMMessage() *Message

type MessageReceipt

type MessageReceipt struct {
	// Ok = ExitCode(0)
	ExitCode int64 // 状态为0表示成功
	Return   []byte
	GasUsed  int64
}

type MessageSendSpec

type MessageSendSpec struct {
	MaxFee abi.TokenAmount `json:"MaxFee"`
}

type MsgLookup

type MsgLookup struct {
	Message   cid.Cid // Can be different than requested, in case it was replaced, but only gas values changed
	Receipt   MessageReceipt
	ReturnDec interface{}
	TipSet    TipSetKey
	Height    int64
}

type ObjStat

type ObjStat struct {
	Size  uint64
	Links uint64
}

type ParentMessage

type ParentMessage struct {
	Cid     cid.Cid `json:"Cid"`
	Message Message `json:"Message"`
}

type RawMessage

type RawMessage Message

type SignedMessage

type SignedMessage struct {
	Message   Message          `json:"Message"`
	Signature crypto.Signature `json:"Signature"`
}

func DecodeSignedMessage

func DecodeSignedMessage(data []byte) (*SignedMessage, error)

func (*SignedMessage) Cid

func (sm *SignedMessage) Cid() cid.Cid

func (*SignedMessage) MarshalCBOR

func (t *SignedMessage) MarshalCBOR(w io.Writer) error

func (*SignedMessage) Serialize

func (sm *SignedMessage) Serialize() ([]byte, error)

func (*SignedMessage) ToStorageBlock

func (sm *SignedMessage) ToStorageBlock() (block.Block, error)

func (*SignedMessage) UnmarshalCBOR

func (t *SignedMessage) UnmarshalCBOR(r io.Reader) error

type Ticket

type Ticket struct {
	VRFProof []byte
}

type TipSet

type TipSet struct {
	Cids   []cid.Cid
	Blocks []*BlockHeader
	Height int64
}

type TipSetKey

type TipSetKey []cid.Cid

type Version

type Version struct {
	Version    string
	APIVersion uint32
	BlockDelay uint64
}

Jump to

Keyboard shortcuts

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