message

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 18 Imported by: 17

Documentation

Index

Constants

View Source
const (
	EthType          inbox.Type = 0
	L2Type           inbox.Type = 3
	InitType         inbox.Type = 4
	EthDepositTxType inbox.Type = 7
	RetryableType    inbox.Type = 9
)

Variables

This section is empty.

Functions

func CalculateRequestId added in v0.8.0

func CalculateRequestId(chainId *big.Int, msgCount *big.Int) common.Hash

func ChainAddressToID

func ChainAddressToID(chain common.Address) *big.Int

func NewInboxMessage

func NewInboxMessage(msg Message, sender common.Address, inboxSeqNum *big.Int, gasPrice *big.Int, time inbox.ChainTime) inbox.InboxMessage

func NewRandomInboxMessage

func NewRandomInboxMessage(msg Message) inbox.InboxMessage

func NewRandomSignedEthTx

func NewRandomSignedEthTx(chain common.Address, privKey *ecdsa.PrivateKey, nonce uint64) *types.Transaction

func RetryableId added in v0.8.0

func RetryableId(requestId common.Hash) common.Hash

Types

type AbstractL2Message

type AbstractL2Message interface {
	L2Type() L2SubType
	AsData() ([]byte, error)
}

type AbstractTransaction

type AbstractTransaction interface {
	Destination() common.Address
}

type BasicTx added in v0.7.2

type BasicTx struct {
	MaxGas      *big.Int
	GasPriceBid *big.Int
	DestAddress common.Address
	Payment     *big.Int
	Data        []byte
}

func (BasicTx) AsData added in v0.7.2

func (t BasicTx) AsData() ([]byte, error)

func (BasicTx) AsDataSafe added in v0.7.2

func (t BasicTx) AsDataSafe() []byte

func (BasicTx) Destination added in v0.7.2

func (t BasicTx) Destination() common.Address

type Call

type Call struct {
	BasicTx
}

func NewCallFromData

func NewCallFromData(data []byte) Call

func NewRandomCall

func NewRandomCall() Call

func (Call) L2Type

func (c Call) L2Type() L2SubType

type CompressedAddress added in v0.7.2

type CompressedAddress interface {
	fmt.Stringer

	Encode() ([]byte, error)
	// contains filtered or unexported methods
}

func DecodeAddress added in v0.7.3

func DecodeAddress(r io.Reader) (CompressedAddress, error)

type CompressedAddressFull added in v0.7.2

type CompressedAddressFull struct {
	common.Address
}

func (CompressedAddressFull) Encode added in v0.7.2

func (c CompressedAddressFull) Encode() ([]byte, error)

func (CompressedAddressFull) String added in v0.7.2

func (c CompressedAddressFull) String() string

type CompressedAddressIndex added in v0.7.2

type CompressedAddressIndex struct {
	*big.Int
}

func (CompressedAddressIndex) Encode added in v0.7.2

func (c CompressedAddressIndex) Encode() ([]byte, error)

func (CompressedAddressIndex) String added in v0.7.2

func (c CompressedAddressIndex) String() string

type CompressedECDSATransaction added in v0.7.2

type CompressedECDSATransaction struct {
	CompressedTx

	V byte
	R *big.Int
	S *big.Int
}

func NewCompressedECDSAFromEth added in v0.7.2

func NewCompressedECDSAFromEth(tx *types.Transaction) CompressedECDSATransaction

func (CompressedECDSATransaction) AsData added in v0.7.2

func (t CompressedECDSATransaction) AsData() ([]byte, error)

func (CompressedECDSATransaction) AsEthTx added in v0.7.3

func (t CompressedECDSATransaction) AsEthTx(chainId *big.Int) (*types.Transaction, error)

func (CompressedECDSATransaction) IsEIP155 added in v0.7.3

func (t CompressedECDSATransaction) IsEIP155() bool

func (CompressedECDSATransaction) L2Type added in v0.7.2

func (CompressedECDSATransaction) String added in v0.7.2

type CompressedTx added in v0.7.2

type CompressedTx struct {
	SequenceNum *big.Int
	GasPrice    *big.Int
	GasLimit    *big.Int
	To          CompressedAddress
	Payment     *big.Int
	Calldata    []byte
}

type ContractTransaction

type ContractTransaction struct {
	BasicTx
}

func NewContractTransactionFromData

func NewContractTransactionFromData(data []byte) ContractTransaction

func NewRandomContractTransaction

func NewRandomContractTransaction() ContractTransaction

func (ContractTransaction) AsEthTx added in v0.7.3

func (t ContractTransaction) AsEthTx() *types.Transaction

func (ContractTransaction) L2Type

func (t ContractTransaction) L2Type() L2SubType

type Eth

type Eth struct {
	Dest  common.Address
	Value *big.Int
}

func NewEthFromData

func NewEthFromData(data []byte) Eth

func NewRandomEth

func NewRandomEth() Eth

func (Eth) AsData

func (e Eth) AsData() []byte

func (Eth) Type

func (e Eth) Type() inbox.Type

type EthConvertable

type EthConvertable interface {
	AsEthTx() *types.Transaction
}

type EthDepositTx added in v0.8.0

type EthDepositTx struct {
	L2Message
}

func NewEthDepositTxFromData added in v0.8.0

func NewEthDepositTxFromData(data []byte) EthDepositTx

func (EthDepositTx) AsData added in v0.8.0

func (e EthDepositTx) AsData() []byte

func (EthDepositTx) Type added in v0.8.0

func (e EthDepositTx) Type() inbox.Type

type FunctionTable added in v0.7.3

type FunctionTable []FunctionTableEntry

func NewFunctionTableFromData added in v0.7.3

func NewFunctionTableFromData(data []byte) (FunctionTable, error)

func (FunctionTable) Encode added in v0.7.3

func (ft FunctionTable) Encode() ([]byte, error)

type FunctionTableEntry added in v0.7.3

type FunctionTableEntry struct {
	FuncID  [4]byte
	Payable byte
	MaxGas  *big.Int
}

func NewRandomFunctionTableEntry added in v0.7.3

func NewRandomFunctionTableEntry() FunctionTableEntry

func (FunctionTableEntry) Equals added in v0.7.3

func (fte FunctionTableEntry) Equals(fte2 FunctionTableEntry) bool

type HeartbeatMessage added in v0.8.0

type HeartbeatMessage struct {
}

func (HeartbeatMessage) AsData added in v0.8.0

func (t HeartbeatMessage) AsData() ([]byte, error)

func (HeartbeatMessage) AsDataSafe added in v0.8.0

func (t HeartbeatMessage) AsDataSafe() []byte

func (HeartbeatMessage) L2Type added in v0.8.0

func (t HeartbeatMessage) L2Type() L2SubType

type Init

type Init struct {
	protocol.ChainParams
	Owner       common.Address
	ExtraConfig []byte
}

func NewInitFromData

func NewInitFromData(data []byte) Init

func (Init) AsData

func (m Init) AsData() []byte

func (Init) Type

func (m Init) Type() inbox.Type

type L2Message

type L2Message struct {
	Data []byte
}

func NewL2Message

func NewL2Message(msg AbstractL2Message) (L2Message, error)

func NewSafeL2Message

func NewSafeL2Message(msg SafeAbstractL2Message) L2Message

func (L2Message) AbstractMessage

func (l L2Message) AbstractMessage() (AbstractL2Message, error)

func (L2Message) AsData

func (l L2Message) AsData() []byte

func (L2Message) String

func (l L2Message) String() string

func (L2Message) Type

func (l L2Message) Type() inbox.Type

type L2SubType

type L2SubType uint8
const (
	TransactionType         L2SubType = 0
	ContractTransactionType L2SubType = 1
	CallType                L2SubType = 2
	TransactionBatchType    L2SubType = 3
	SignedTransactionType   L2SubType = 4
	HeartbeatType           L2SubType = 6
	CompressedECDSA         L2SubType = 7
)

type Message

type Message interface {
	Type() inbox.Type
	AsData() []byte
}

func NestedMessage

func NestedMessage(data []byte, kind inbox.Type) (Message, error)

type OutMessage

type OutMessage interface {
}

func NewOutMessageFromBytes added in v0.8.0

func NewOutMessageFromBytes(val []byte) (OutMessage, error)

type RetryableTx added in v0.8.0

type RetryableTx struct {
	Destination       common.Address
	Value             *big.Int
	Deposit           *big.Int
	MaxSubmissionCost *big.Int
	CreditBack        common.Address
	Beneficiary       common.Address
	MaxGas            *big.Int
	GasPriceBid       *big.Int
	Data              []byte
}

func NewRetryableTxFromData added in v0.8.0

func NewRetryableTxFromData(data []byte) RetryableTx

func (RetryableTx) AsData added in v0.8.0

func (t RetryableTx) AsData() []byte

func (RetryableTx) Equals added in v0.8.0

func (t RetryableTx) Equals(o RetryableTx) bool

func (RetryableTx) Type added in v0.8.0

func (t RetryableTx) Type() inbox.Type

type SafeAbstractL2Message

type SafeAbstractL2Message interface {
	AbstractL2Message
	AsDataSafe() []byte
}

type SendMessageRoot added in v0.8.0

type SendMessageRoot struct {
	BatchNumber *big.Int
	NumInBatch  *big.Int
	OutputRoot  common.Hash
}

type SignedTransaction

type SignedTransaction struct {
	Tx *types.Transaction
}

func NewRandomSignedTx

func NewRandomSignedTx(chain common.Address, privKey *ecdsa.PrivateKey, nonce uint64) SignedTransaction

func (SignedTransaction) AsData

func (t SignedTransaction) AsData() ([]byte, error)

func (SignedTransaction) AsEthTx

func (t SignedTransaction) AsEthTx() *types.Transaction

func (SignedTransaction) Destination

func (t SignedTransaction) Destination() common.Address

func (SignedTransaction) Equals

func (SignedTransaction) L2Type

func (t SignedTransaction) L2Type() L2SubType

func (SignedTransaction) String

func (t SignedTransaction) String() string

type Transaction

type Transaction struct {
	MaxGas      *big.Int
	GasPriceBid *big.Int
	SequenceNum *big.Int
	DestAddress common.Address
	Payment     *big.Int
	Data        []byte
}

func NewRandomTransaction

func NewRandomTransaction() Transaction

func NewTransactionFromEthTx

func NewTransactionFromEthTx(tx *types.Transaction) Transaction

func (Transaction) AsData

func (t Transaction) AsData() ([]byte, error)

func (Transaction) AsDataSafe

func (t Transaction) AsDataSafe() []byte

func (Transaction) AsEthTx

func (t Transaction) AsEthTx() *types.Transaction

func (Transaction) Destination

func (t Transaction) Destination() common.Address

func (Transaction) Equals

func (t Transaction) Equals(o Transaction) bool

func (Transaction) L2Type

func (t Transaction) L2Type() L2SubType

func (Transaction) MessageID

func (t Transaction) MessageID(sender common.Address, chain common.Address) common.Hash

func (Transaction) String

func (t Transaction) String() string

type TransactionBatch

type TransactionBatch struct {
	Transactions [][]byte
}

func NewRandomTransactionBatch

func NewRandomTransactionBatch(txCount int, chain common.Address, privKey *ecdsa.PrivateKey, initialNonce uint64) (TransactionBatch, error)

func NewTransactionBatchFromMessages

func NewTransactionBatchFromMessages(messages []AbstractL2Message) (TransactionBatch, error)

func (TransactionBatch) AsData

func (t TransactionBatch) AsData() ([]byte, error)

func (TransactionBatch) AsDataSafe

func (t TransactionBatch) AsDataSafe() []byte

func (TransactionBatch) L2Type

func (t TransactionBatch) L2Type() L2SubType

func (TransactionBatch) String

func (t TransactionBatch) String() string

Jump to

Keyboard shortcuts

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