db

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package db defines the interface for the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GuardDB

type GuardDB interface {
	GuardDBWriter
	GuardDBReader
	SubmitterDB() submitterDB.Service
}

GuardDB is the interface for the guard's database.

type GuardDBReader added in v0.0.239

type GuardDBReader interface {
	// GetRelayableAgentStatuses gets eligible parameters for the updateAgentStatus() contract call.
	GetRelayableAgentStatuses(ctx context.Context, chainID uint32) ([]agentTypes.AgentTree, error)
	// GetSummitBlockNumberForRoot gets the summit block number for a given agent root.
	GetSummitBlockNumberForRoot(ctx context.Context, agentRoot string) (uint64, error)
}

GuardDBReader is the interface for reading from the guard's database.

type GuardDBWriter added in v0.0.239

type GuardDBWriter interface {
	// StoreRelayableAgentStatus stores a relayable agent status.
	StoreRelayableAgentStatus(
		ctx context.Context,
		agentAddress common.Address,
		staleFlag agentTypes.AgentFlagType,
		updatedFlag agentTypes.AgentFlagType,
		domain uint32,
	) error

	// UpdateAgentStatusRelayedState updates the relayed state for a relayable agent status.
	UpdateAgentStatusRelayedState(
		ctx context.Context,
		agentAddress common.Address,
		state agentTypes.AgentStatusRelayedState,
	) error

	// StoreAgentTree stores an agent tree.
	StoreAgentTree(
		ctx context.Context,
		agentRoot [32]byte,
		agentAddress common.Address,
		blockNumber uint64,
		proof [][32]byte,
	) error

	// StoreAgentRoot stores an agent root.
	StoreAgentRoot(
		ctx context.Context,
		agentRoot [32]byte,
		blockNumber uint64,
	) error
}

GuardDBWriter is the interface for writing to the guard's database.

Directories

Path Synopsis
sql
base
Package base contains the base sql implementation
Package base contains the base sql implementation
mysql
Package mysql contains a mysql db
Package mysql contains a mysql db
sqlite
Package sqlite implements the sqlite package
Package sqlite implements the sqlite package

Jump to

Keyboard shortcuts

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