mock

package
v0.3.1-0...-ee1233d Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MockChainID       = big.NewInt(167001)
	LatestBlockNumber = big.NewInt(10)
)
View Source
var (
	LatestBlock = &eventindexer.ProcessedBlock{
		Height:  100,
		Hash:    "0x",
		ChainID: MockChainID.Int64(),
	}
)

Functions

This section is empty.

Types

type EventRepository

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

func NewEventRepository

func NewEventRepository() *EventRepository

func (*EventRepository) Delete

func (r *EventRepository) Delete(
	ctx context.Context,
	id int,
) error

func (*EventRepository) FindByEventTypeAndBlockID

func (r *EventRepository) FindByEventTypeAndBlockID(
	ctx context.Context,
	eventType string,
	blockID int64) (*eventindexer.Event, error)

func (*EventRepository) FindUniqueProposers

func (r *EventRepository) FindUniqueProposers(
	ctx context.Context,
) ([]eventindexer.UniqueProposersResponse, error)

func (*EventRepository) FindUniqueProvers

func (r *EventRepository) FindUniqueProvers(
	ctx context.Context,
) ([]eventindexer.UniqueProversResponse, error)

func (*EventRepository) FirstByAddressAndEventName

func (r *EventRepository) FirstByAddressAndEventName(
	ctx context.Context,
	address string,
	event string,
) (*eventindexer.Event, error)

func (*EventRepository) GetAssignedBlocksByProverAddress

func (r *EventRepository) GetAssignedBlocksByProverAddress(
	ctx context.Context,
	req *http.Request,
	address string,
) (paginate.Page, error)

func (*EventRepository) GetByAddressAndEventName

func (r *EventRepository) GetByAddressAndEventName(
	ctx context.Context,
	req *http.Request,
	address string,
	event string,
) (paginate.Page, error)

func (*EventRepository) GetCountByAddressAndEventName

func (r *EventRepository) GetCountByAddressAndEventName(
	ctx context.Context,
	address string,
	event string,
) (int, error)

func (*EventRepository) GetTotalSlashedTokens

func (r *EventRepository) GetTotalSlashedTokens(
	ctx context.Context,
) (*big.Int, error)

func (*EventRepository) Save

type NFTBalanceRepository

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

func NewNFTBalanceRepository

func NewNFTBalanceRepository() *NFTBalanceRepository

func (*NFTBalanceRepository) FindByAddress

func (r *NFTBalanceRepository) FindByAddress(ctx context.Context,
	req *http.Request,
	address string,
	chainID string,
) (paginate.Page, error)

func (*NFTBalanceRepository) IncreaseBalance

func (*NFTBalanceRepository) SubtractBalance

type ProcessedBlockRepository

type ProcessedBlockRepository struct {
}

func (*ProcessedBlockRepository) GetLatestBlockProcessedForEvent

func (r *ProcessedBlockRepository) GetLatestBlockProcessedForEvent(
	chainID *big.Int,
) (*eventindexer.ProcessedBlock, error)

func (*ProcessedBlockRepository) Save

type StatRepository

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

func NewStatRepository

func NewStatRepository() *StatRepository

func (*StatRepository) Find

func (r *StatRepository) Find(
	ctx context.Context,
	statType string,
	feeTokenAddress *string,
) (*eventindexer.Stat, error)

func (*StatRepository) FindAll

func (r *StatRepository) FindAll(
	ctx context.Context,
) ([]*eventindexer.Stat, error)

FindAll finds each type of unique stat and merges them together

func (*StatRepository) Save

Jump to

Keyboard shortcuts

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