anchorTxValidator

package
v0.0.0-...-1d04f91 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorTxValidator

type AnchorTxValidator struct {
	// contains filtered or unexported fields
}

AnchorTxValidator is responsible for validating the anchor transaction (MxcL2.anchor) in each L2 block, which is always the first transaction.

func New

func New(mxcL2Address common.Address, chainID *big.Int, rpc *rpc.Client) (*AnchorTxValidator, error)

New creates a new AnchorTxValidator instance.

func (*AnchorTxValidator) GetAnchoredSignalRoot

func (v *AnchorTxValidator) GetAnchoredSignalRoot(
	ctx context.Context,
	tx *types.Transaction,
) (common.Hash, error)

GetAnchoredSignalRoot gets the anchored signal service state root in the given `MxcL2.anchor` transaction.

func (*AnchorTxValidator) GetAndValidateAnchorTxReceipt

func (v *AnchorTxValidator) GetAndValidateAnchorTxReceipt(
	ctx context.Context,
	tx *types.Transaction,
) (*types.Receipt, error)

GetAndValidateAnchorTxReceipt gets and validates the `MxcL2.anchor` transaction's receipt.

func (*AnchorTxValidator) ValidateAnchorTx

func (v *AnchorTxValidator) ValidateAnchorTx(ctx context.Context, tx *types.Transaction) error

validateAnchorTx checks whether the given transaction is a valid `MxcL2.anchor` transaction.

Jump to

Keyboard shortcuts

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