types

package
v0.0.0-...-194be82 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADDRESS_LENGTH int = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountAddress

type AccountAddress []byte

func GetAddressFromSecret

func GetAddressFromSecret(secretKey string) AccountAddress

Get Address from secret key in hex

func NewAccountAddress

func NewAccountAddress(address string) AccountAddress

func (AccountAddress) IsValidBytes

func (a AccountAddress) IsValidBytes() bool

func (AccountAddress) ToString

func (a AccountAddress) ToString() string

type AccountState

type AccountState struct {
	AuthenticationKey   string `json:"authentication_key"`
	Balance             uint64 `json:"balance"`
	RecievedEventsCount uint64 `json:"received_events_count"`
	SentEventsCount     uint64 `json:"sent_events_count"`
	SequenceNumber      uint64 `json:sequence_number`
}

func (*AccountState) Deserialize

func (a *AccountState) Deserialize(payload []byte) error

func (*AccountState) Serialize

func (a *AccountState) Serialize() []byte

type ContractEvent

type ContractEvent struct {
	// The data payload of the event.
	EventData []byte
	// Address to access path.
	AccountAddress AccountAddress
	// The number of messages that have been emitted to the path previously.
	SequenceNumber uint64
	// The path that the event was emitted to.
	Path []byte
}

type LibraArgument

type LibraArgument interface {
	IsArgumentType()
}

type LibraArgument_Address

type LibraArgument_Address AccountAddress

func (LibraArgument_Address) IsArgumentType

func (l LibraArgument_Address) IsArgumentType()

type LibraArgument_ByteArray

type LibraArgument_ByteArray []byte

func (LibraArgument_ByteArray) IsArgumentType

func (l LibraArgument_ByteArray) IsArgumentType()

type LibraArgument_String

type LibraArgument_String string

func (LibraArgument_String) IsArgumentType

func (l LibraArgument_String) IsArgumentType()

type LibraArgument_UInt

type LibraArgument_UInt uint64

func (LibraArgument_UInt) IsArgumentType

func (l LibraArgument_UInt) IsArgumentType()

type LibraProgram

type LibraProgram struct {
	Code      []byte
	Arguments []*LibraProgramArgument
	Modules   [][]byte
}

type LibraProgramArgument

type LibraProgramArgument struct {
	Type LibraProgramArgumentType
	Data []byte
}

type LibraProgramArgumentType

type LibraProgramArgumentType uint64

type RawTransaction

type RawTransaction struct {
	// Sender's Address.
	Sender AccountAddress
	// Sequence Number of this transaction corresponding to sender's account.
	SequenceNumber uint64
	// The transaction program to execute.
	TransactionProgram *LibraProgram
	// Maximal total gas specified by wallet to spend for this transaction.
	MaxGasAmount uint64
	// Maximal price can be paid per gas.
	GasUnitPrice uint64
	// Expiration time for this transaction.
	ExpirationTime uint64
}

type SignedTransaction

type SignedTransaction struct {
	// The raw transaction.
	RawTransaction *RawTransaction
	// Sender's public key. When checking the signature, we first need to check whether this key
	// is indeed the pre-image of the pubkey hash stored under sender's account.
	PublicKey *crypto.PublicKey
	// Signature of the transaction that correspond with the public key.
	Signature *crypto.Signature
	// The original raw bytes generated from the wallet.
	RawTxnBytes []byte
}

type SignedTransactionProof

type SignedTransactionProof interface {
}

type SignedTransactionWithProof

type SignedTransactionWithProof struct {
	// The version of the returned signed transaction. This is also like transaction Id
	Version uint64
	// The transaction itself.
	SignedTransaction *SignedTransaction
	// The proof authenticating the signed transaction.
	Proof SignedTransactionProof
	// The events yielded by executing the transaction.
	Events []*ContractEvent
}

type TransactionInfo

type TransactionInfo struct {
	// Hash of the signed transaction that is stored
	SignTransactionHash []byte
	// The root hash of Sparse Merkle Tree describing the world state at the end
	// of this transaction
	StateRootHash []byte
	// The root hash of Merkle Accumulator storing all events emitted during this
	// transaction.
	EventRootHash []byte
	// The amount of gas used by this transaction.
	GasUsed uint64
}

`TransactionInfo` is the object we store in the transaction accumulator. It consists of the transaction as well as the execution result of this transaction. This are later returned to the client so that a client can validate the tree

Jump to

Keyboard shortcuts

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