mock

package
v0.3.1-0...-684a909 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 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)
)

Functions

This section is empty.

Types

type ERC20BalanceRepository

type ERC20BalanceRepository struct {
	ERC20Balances []*eventindexer.ERC20Balance
}

func NewERC20BalanceRepository

func NewERC20BalanceRepository() *ERC20BalanceRepository

func (*ERC20BalanceRepository) CreateMetadata

func (r *ERC20BalanceRepository) CreateMetadata(
	ctx context.Context,
	chainID int64,
	contractAddress string,
	symbol string,
	decimals uint8,
) (int, error)

func (*ERC20BalanceRepository) FindByAddress

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

func (*ERC20BalanceRepository) FindMetadata

func (r *ERC20BalanceRepository) FindMetadata(
	ctx context.Context,
	chainID int64,
	contractAddress string,
) (*eventindexer.ERC20Metadata, error)

func (*ERC20BalanceRepository) IncreaseAndDecreaseBalancesInTx

func (r *ERC20BalanceRepository) IncreaseAndDecreaseBalancesInTx(
	ctx context.Context,
	increaseOpts eventindexer.UpdateERC20BalanceOpts,
	decreaseOpts eventindexer.UpdateERC20BalanceOpts,
) (increasedBalance *eventindexer.ERC20Balance, decreasedBalance *eventindexer.ERC20Balance, err error)

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) DeleteAllAfterBlockID

func (r *EventRepository) DeleteAllAfterBlockID(ctx context.Context, blockID uint64, srcChainID uint64) error

DeleteAllAfterBlockID is used when a reorg is detected

func (*EventRepository) FindByEventTypeAndBlockID

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

func (*EventRepository) FindLatestBlockID

func (r *EventRepository) FindLatestBlockID(
	ctx context.Context,
	srcChainID uint64,
) (uint64, error)

GetLatestBlockID get latest block id

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) GetBlockProposedBy

func (r *EventRepository) GetBlockProposedBy(ctx context.Context, blockID int) (*eventindexer.Event, error)

func (*EventRepository) GetBlockProvenBy

func (r *EventRepository) GetBlockProvenBy(ctx context.Context, blockID int) ([]*eventindexer.Event, 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) IncreaseAndDecreaseBalancesInTx

func (r *NFTBalanceRepository) IncreaseAndDecreaseBalancesInTx(
	ctx context.Context,
	increaseOpts eventindexer.UpdateNFTBalanceOpts,
	decreaseOpts eventindexer.UpdateNFTBalanceOpts,
) (increasedBalance *eventindexer.NFTBalance, decreasedBalance *eventindexer.NFTBalance, err error)

Jump to

Keyboard shortcuts

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