Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
Number rpc.ArgUint64 `json:"number"`
GlobalExitRoot common.Hash `json:"globalExitRoot"`
Timestamp rpc.ArgUint64 `json:"timestamp"`
Coinbase common.Address `json:"coinbase"`
L2Data rpc.ArgBytes `json:"batchL2Data"`
Transactions []TransactionOrHash `json:"transactions"`
}
Batch represents a batch used for synchronization
func (*Batch) HashToSign ¶
HashToSign returns a hash that uniquely identifies the batch
func (*Batch) Sign ¶
func (b *Batch) Sign(privateKey *ecdsa.PrivateKey) (*SignedBatch, error)
Sign returns a signed batch by the private key
type OffChainData ¶
OffChainData represents some data that is not stored on chain and should be preserved
type Sequence ¶
type Sequence struct {
Batches []Batch `json:"batches"`
OldAccInputHash common.Hash `json:"oldAccInputhash"`
}
Sequence represents the data that the sequencer will send to L1 and other metadata needed to build the accumulated input hash aka accInputHash
func (*Sequence) HashToSign ¶
HashToSign returns the accumulated input hash of the sequence. Note that this is equivalent to what happens on the smart contract
func (*Sequence) OffChainData ¶
func (s *Sequence) OffChainData() []OffChainData
OffChainData returns the data that needs to be stored off chain from a given sequence
func (*Sequence) Sign ¶
func (s *Sequence) Sign(privateKey *ecdsa.PrivateKey) (*SignedSequence, error)
Sign returns a signed sequence by the private key. Note that what's being signed is the accumulated input hash
type SignedBatch ¶
SignedBatch is a batch but signed
type SignedSequence ¶
type SignedSequence struct {
Sequence Sequence `json:"sequence"`
Signature rpc.ArgBytes `json:"signature"`
}
SignedSequence is a sequence but signed
type TransactionOrHash ¶
TransactionOrHash for union type of transaction and types.Hash