payerreport

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPayerReportManager

type IPayerReportManager interface {
	GenerateReport(ctx context.Context, params PayerReportGenerationParams) (*PayerReport, error)
	AttestReport(
		ctx context.Context,
		prevReport *PayerReport,
		newReport *PayerReport,
	) (*PayerReportAttestation, error)
}

type NodeSignature

type NodeSignature struct {
	NodeID    uint32
	Signature []byte
}

type PayerReport

type PayerReport struct {
	// The Originator Node that the report is about
	OriginatorNodeID uint32
	// The report applies to messages with sequence IDs > StartSequenceID
	StartSequenceID uint64
	// The report applies to messages with sequence IDs <= EndSequenceID
	EndSequenceID uint64
	// The payers in the report and the number of messages they paid for
	Payers map[common.Address]currency.PicoDollar
	// The merkle root of the Payers mapping
	PayersMerkleRoot []byte
	// The active node IDs in the report
	ActiveNodeIds []uint32
}

func (*PayerReport) ID added in v0.4.0

func (p *PayerReport) ID() ([]byte, error)

func (*PayerReport) ToProto added in v0.4.0

func (p *PayerReport) ToProto() *proto.PayerReport

type PayerReportAttestation

type PayerReportAttestation struct {
	Report        *PayerReport
	NodeSignature NodeSignature
}

type PayerReportGenerationParams

type PayerReportGenerationParams struct {
	OriginatorID            uint32
	LastReportEndSequenceID uint64
	NumHours                int
}

type PayerReportManager

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

func NewPayerReportManager

func NewPayerReportManager(
	log *zap.Logger,
	queries *queries.Queries,
) *PayerReportManager

func (*PayerReportManager) GenerateReport

func (p *PayerReportManager) GenerateReport(
	ctx context.Context,
	params PayerReportGenerationParams,
) (*PayerReport, error)

Jump to

Keyboard shortcuts

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