hints.go 783 Bytes
Newer Older
1 2 3 4 5 6 7 8
package l1

import (
	"github.com/ethereum/go-ethereum/common"

	"github.com/ethereum-optimism/optimism/op-program/preimage"
)

9 10 11 12 13 14
const (
	HintL1BlockHeader  = "l1-block-header"
	HintL1Transactions = "l1-transactions"
	HintL1Receipts     = "l1-receipts"
)

15 16 17 18 19
type BlockHeaderHint common.Hash

var _ preimage.Hint = BlockHeaderHint{}

func (l BlockHeaderHint) Hint() string {
20
	return HintL1BlockHeader + " " + (common.Hash)(l).String()
21 22 23 24 25 26 27
}

type TransactionsHint common.Hash

var _ preimage.Hint = TransactionsHint{}

func (l TransactionsHint) Hint() string {
28
	return HintL1Transactions + " " + (common.Hash)(l).String()
29 30 31 32 33 34 35
}

type ReceiptsHint common.Hash

var _ preimage.Hint = ReceiptsHint{}

func (l ReceiptsHint) Hint() string {
36
	return HintL1Receipts + " " + (common.Hash)(l).String()
37
}