Documentation ¶
Index ¶
- func EncodeBlock(s *Serializer, blockNumber *big.Int, serializedTransitions [][]byte) ([]byte, error)
- type AccountInfo
- type AccountInfoUpdate
- type ContractFraudProof
- type CreateAndDepositTransition
- type CreateAndTransferTransition
- type DepositTransaction
- type DepositTransition
- type IncludedStorageSlot
- type IncludedTransition
- type InclusionProof
- type LocalFraudProof
- type RollupBlock
- type RollupBlockInfo
- func (info *RollupBlockInfo) GetIncludedTransition(transitionIndex int) (*mainchain.DataTypesIncludedTransition, error)
- func (info *RollupBlockInfo) GetNumTransitions() int
- func (info *RollupBlockInfo) GetTransitionInclusionProof(transitionIndex int) (*mainchain.DataTypesTransitionInclusionProof, error)
- type Serializer
- func (s *Serializer) DeserializeAccountInfo(data []byte) (*AccountInfo, error)
- func (s *Serializer) DeserializeCreateAndDepositTransition(data []byte) (*CreateAndDepositTransition, error)
- func (s *Serializer) DeserializeCreateAndTransferTransition(data []byte) (*CreateAndTransferTransition, error)
- func (s *Serializer) DeserializeDepositTransition(data []byte) (*DepositTransition, error)
- func (s *Serializer) DeserializeRollupBlockFromData(data []byte) (*RollupBlock, error)
- func (s *Serializer) DeserializeRollupBlockFromFields(blockNumber uint64, rawTransitions [][]byte) (*RollupBlock, error)
- func (s *Serializer) DeserializeTransferTransition(data []byte) (*TransferTransition, error)
- func (s *Serializer) DeserializeTransition(data []byte) (Transition, error)
- func (s *Serializer) DeserializeWithdrawTransition(data []byte) (*WithdrawTransition, error)
- type SignedStateReceipt
- type StateSnapshot
- type StateUpdate
- type StateUpdateEntry
- type StorageSlot
- type Transaction
- type TransactionType
- type TransferTransaction
- type TransferTransition
- type Transition
- type TransitionInclusionProof
- type TransitionPosition
- type TransitionType
- type WithdrawTransaction
- type WithdrawTransition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeBlock ¶
Types ¶
type AccountInfo ¶
type AccountInfo struct { Account common.Address Balances []*big.Int TransferNonces []*big.Int WithdrawNonces []*big.Int }
func (*AccountInfo) Serialize ¶
func (info *AccountInfo) Serialize(s *Serializer) ([]byte, error)
type AccountInfoUpdate ¶
type AccountInfoUpdate struct { Info *AccountInfo NewAccount bool }
type ContractFraudProof ¶
type ContractFraudProof struct { PreStateIncludedTransition mainchain.DataTypesIncludedTransition InvalidIncludedTransition mainchain.DataTypesIncludedTransition TransitionStorageSlots []mainchain.DataTypesIncludedStorageSlot }
type CreateAndDepositTransition ¶
type CreateAndDepositTransition struct { TransitionType *big.Int StateRoot [32]byte AccountSlotIndex *big.Int Account common.Address TokenIndex *big.Int Amount *big.Int Signature []byte }
func (*CreateAndDepositTransition) GetSignature ¶
func (t *CreateAndDepositTransition) GetSignature() []byte
func (*CreateAndDepositTransition) GetStateRoot ¶
func (t *CreateAndDepositTransition) GetStateRoot() [32]byte
func (*CreateAndDepositTransition) GetTransitionType ¶
func (*CreateAndDepositTransition) GetTransitionType() TransitionType
func (*CreateAndDepositTransition) Serialize ¶
func (transition *CreateAndDepositTransition) Serialize(s *Serializer) ([]byte, error)
type CreateAndTransferTransition ¶
type CreateAndTransferTransition struct { TransitionType *big.Int StateRoot [32]byte SenderSlotIndex *big.Int RecipientSlotIndex *big.Int Recipient common.Address TokenIndex *big.Int Amount *big.Int Nonce *big.Int Signature []byte }
func (*CreateAndTransferTransition) GetSignature ¶
func (t *CreateAndTransferTransition) GetSignature() []byte
func (*CreateAndTransferTransition) GetStateRoot ¶
func (t *CreateAndTransferTransition) GetStateRoot() [32]byte
func (*CreateAndTransferTransition) GetTransitionType ¶
func (*CreateAndTransferTransition) GetTransitionType() TransitionType
func (*CreateAndTransferTransition) Serialize ¶
func (transition *CreateAndTransferTransition) Serialize(s *Serializer) ([]byte, error)
type DepositTransaction ¶
type DepositTransaction struct { Account common.Address Token common.Address Amount *big.Int Signature []byte }
func (*DepositTransaction) GetSignature ¶
func (t *DepositTransaction) GetSignature() []byte
func (*DepositTransaction) GetTransactionType ¶
func (*DepositTransaction) GetTransactionType() TransactionType
type DepositTransition ¶
type DepositTransition struct { TransitionType *big.Int StateRoot [32]byte AccountSlotIndex *big.Int TokenIndex *big.Int Amount *big.Int Signature []byte }
func (*DepositTransition) GetSignature ¶
func (t *DepositTransition) GetSignature() []byte
func (*DepositTransition) GetStateRoot ¶
func (t *DepositTransition) GetStateRoot() [32]byte
func (*DepositTransition) GetTransitionType ¶
func (*DepositTransition) GetTransitionType() TransitionType
func (*DepositTransition) Serialize ¶
func (transition *DepositTransition) Serialize(s *Serializer) ([]byte, error)
type IncludedStorageSlot ¶
type IncludedStorageSlot struct { StorageSlot *StorageSlot Siblings [][32]byte }
type IncludedTransition ¶
type IncludedTransition struct { Transition []byte InclusionProof *TransitionInclusionProof }
type InclusionProof ¶
type InclusionProof [][32]byte
func ConvertToInclusionProof ¶
func ConvertToInclusionProof(data [][]byte) InclusionProof
type LocalFraudProof ¶
type LocalFraudProof struct { Position *TransitionPosition Inputs []*StateSnapshot Transition Transition }
type RollupBlock ¶
type RollupBlock struct { BlockNumber uint64 Transitions []Transition }
func NewRollupBlock ¶
func NewRollupBlock(blockNumber uint64) *RollupBlock
func (*RollupBlock) Serialize ¶
func (block *RollupBlock) Serialize(s *Serializer) ([][]byte, []byte, error)
type RollupBlockInfo ¶
type RollupBlockInfo struct {
// contains filtered or unexported fields
}
func NewRollupBlockInfo ¶
func NewRollupBlockInfo(serializer *Serializer, rollupBlock *RollupBlock) (*RollupBlockInfo, error)
func (*RollupBlockInfo) GetIncludedTransition ¶
func (info *RollupBlockInfo) GetIncludedTransition(transitionIndex int) (*mainchain.DataTypesIncludedTransition, error)
func (*RollupBlockInfo) GetNumTransitions ¶
func (info *RollupBlockInfo) GetNumTransitions() int
func (*RollupBlockInfo) GetTransitionInclusionProof ¶
func (info *RollupBlockInfo) GetTransitionInclusionProof(transitionIndex int) (*mainchain.DataTypesTransitionInclusionProof, error)
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
func NewSerializer ¶
func NewSerializer() (*Serializer, error)
func (*Serializer) DeserializeAccountInfo ¶
func (s *Serializer) DeserializeAccountInfo(data []byte) (*AccountInfo, error)
func (*Serializer) DeserializeCreateAndDepositTransition ¶
func (s *Serializer) DeserializeCreateAndDepositTransition( data []byte) (*CreateAndDepositTransition, error)
func (*Serializer) DeserializeCreateAndTransferTransition ¶
func (s *Serializer) DeserializeCreateAndTransferTransition( data []byte) (*CreateAndTransferTransition, error)
func (*Serializer) DeserializeDepositTransition ¶
func (s *Serializer) DeserializeDepositTransition(data []byte) (*DepositTransition, error)
func (*Serializer) DeserializeRollupBlockFromData ¶
func (s *Serializer) DeserializeRollupBlockFromData(data []byte) (*RollupBlock, error)
func (*Serializer) DeserializeRollupBlockFromFields ¶
func (s *Serializer) DeserializeRollupBlockFromFields( blockNumber uint64, rawTransitions [][]byte) (*RollupBlock, error)
func (*Serializer) DeserializeTransferTransition ¶
func (s *Serializer) DeserializeTransferTransition(data []byte) (*TransferTransition, error)
func (*Serializer) DeserializeTransition ¶
func (s *Serializer) DeserializeTransition(data []byte) (Transition, error)
func (*Serializer) DeserializeWithdrawTransition ¶
func (s *Serializer) DeserializeWithdrawTransition(data []byte) (*WithdrawTransition, error)
type SignedStateReceipt ¶
type SignedStateReceipt struct { }
type StateSnapshot ¶
type StateSnapshot struct { SlotIndex *big.Int AccountInfo *AccountInfo StateRoot []byte InclusionProof InclusionProof }
type StateUpdate ¶
type StateUpdate struct { Transaction Transaction StateRoot [32]byte Entries []*StateUpdateEntry }
type StateUpdateEntry ¶
type StateUpdateEntry struct { SlotIndex *big.Int InclusionProof InclusionProof AccountInfo *AccountInfo NewAccount bool }
type StorageSlot ¶
type StorageSlot struct { SlotIndex *big.Int AccountInfo *AccountInfo }
func (*StorageSlot) Serialize ¶
func (slot *StorageSlot) Serialize(s *Serializer) ([]byte, error)
type Transaction ¶
type Transaction interface { GetTransactionType() TransactionType GetSignature() []byte }
type TransactionType ¶
type TransactionType int
const ( TransactionTypeDeposit TransactionType = iota TransactionTypeWithdraw TransactionTypeTransfer )
type TransferTransaction ¶
type TransferTransaction struct { Sender common.Address Recipient common.Address Token common.Address Amount *big.Int Nonce *big.Int Signature []byte }
func (*TransferTransaction) GetSignature ¶
func (t *TransferTransaction) GetSignature() []byte
func (*TransferTransaction) GetTransactionType ¶
func (*TransferTransaction) GetTransactionType() TransactionType
type TransferTransition ¶
type TransferTransition struct { TransitionType *big.Int StateRoot [32]byte SenderSlotIndex *big.Int RecipientSlotIndex *big.Int TokenIndex *big.Int Amount *big.Int Nonce *big.Int Signature []byte }
func (*TransferTransition) GetSignature ¶
func (t *TransferTransition) GetSignature() []byte
func (*TransferTransition) GetStateRoot ¶
func (t *TransferTransition) GetStateRoot() [32]byte
func (*TransferTransition) GetTransitionType ¶
func (*TransferTransition) GetTransitionType() TransitionType
func (*TransferTransition) Serialize ¶
func (transition *TransferTransition) Serialize(s *Serializer) ([]byte, error)
type Transition ¶
type Transition interface { GetTransitionType() TransitionType GetSignature() []byte GetStateRoot() [32]byte Serialize(*Serializer) ([]byte, error) }
type TransitionPosition ¶
type TransitionType ¶
type TransitionType int
const ( TransitionTypeCreateAndDeposit TransitionType = iota TransitionTypeDeposit TransitionTypeWithdraw TransitionTypeCreateAndTransfer TransitionTypeTransfer )
type WithdrawTransaction ¶
type WithdrawTransaction struct { Account common.Address Token common.Address Amount *big.Int Nonce *big.Int Signature []byte }
func (*WithdrawTransaction) GetSignature ¶
func (t *WithdrawTransaction) GetSignature() []byte
func (*WithdrawTransaction) GetTransactionType ¶
func (*WithdrawTransaction) GetTransactionType() TransactionType
type WithdrawTransition ¶
type WithdrawTransition struct { TransitionType *big.Int StateRoot [32]byte AccountSlotIndex *big.Int TokenIndex *big.Int Amount *big.Int Nonce *big.Int Signature []byte }
func (*WithdrawTransition) GetSignature ¶
func (t *WithdrawTransition) GetSignature() []byte
func (*WithdrawTransition) GetStateRoot ¶
func (t *WithdrawTransition) GetStateRoot() [32]byte
func (*WithdrawTransition) GetTransitionType ¶
func (*WithdrawTransition) GetTransitionType() TransitionType
func (*WithdrawTransition) Serialize ¶
func (transition *WithdrawTransition) Serialize(s *Serializer) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.