batch

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 4 Imported by: 0

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"`
}

Batch represents a batch used for synchronization

func (*Batch) HashToSign

func (b *Batch) HashToSign() []byte

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 SignedBatch

type SignedBatch struct {
	Batch     Batch        `json:"batch"`
	Signature rpc.ArgBytes `json:"signature"`
}

SignedBatch is a batch but signed

func (*SignedBatch) Signer

func (s *SignedBatch) Signer() (common.Address, error)

Signer returns the address of the signer

Jump to

Keyboard shortcuts

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