models

package
v0.0.0-...-3eec7cb Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocAccounts        = "accounts"
	DocBigMapActions   = "big_map_actions"
	DocBigMapDiff      = "big_map_diffs"
	DocBigMapState     = "big_map_states"
	DocBlocks          = "blocks"
	DocContracts       = "contracts"
	DocGlobalConstants = "global_constants"
	DocMigrations      = "migrations"
	DocOperations      = "operations"
	DocProtocol        = "protocols"
	DocScripts         = "scripts"
	DocTicketUpdates   = "ticket_updates"
	DocTickets         = "tickets"
	DocTicketBalances  = "ticket_balances"
	DocSmartRollups    = "smart_rollup"
	DocStats           = "stats"
)

Document names

Variables

This section is empty.

Functions

func AllDocuments

func AllDocuments() []string

AllDocuments - returns all document names

func ManyToMany

func ManyToMany() []interface{}

ManyToMany -

Types

type GeneralRepository

type GeneralRepository interface {
	InitDatabase(ctx context.Context) error
	TablesExist(ctx context.Context) bool
	CreateIndex(ctx context.Context, name, columns string, model any) error
	IsRecordNotFound(err error) bool

	// Drop - drops full database
	Drop(ctx context.Context) error
}

type LastAction

type LastAction struct {
	AccountId int64     `bun:"address"`
	Time      time.Time `bun:"time"`
}

type Model

type Model interface {
	GetID() int64
	TableName() string
}

func AllModels

func AllModels() []Model

AllModels -

type Rollback

type Rollback interface {
	DeleteAll(ctx context.Context, model any, level int64) (int, error)
	StatesChangedAtLevel(ctx context.Context, level int64) ([]bigmapdiff.BigMapState, error)
	DeleteBigMapState(ctx context.Context, state bigmapdiff.BigMapState) error
	LastDiff(ctx context.Context, ptr int64, keyHash string, skipRemoved bool) (bigmapdiff.BigMapDiff, error)
	SaveBigMapState(ctx context.Context, state bigmapdiff.BigMapState) error
	GetOperations(ctx context.Context, level int64) ([]operation.Operation, error)
	GetMigrations(ctx context.Context, level int64) ([]migration.Migration, error)
	GetTicketUpdates(ctx context.Context, level int64) ([]ticket.TicketUpdate, error)
	GetLastAction(ctx context.Context, addressIds ...int64) ([]LastAction, error)
	UpdateAccountStats(ctx context.Context, account account.Account) error
	UpdateTicket(ctx context.Context, ticket ticket.Ticket) error
	GlobalConstants(ctx context.Context, level int64) ([]contract.GlobalConstant, error)
	Scripts(ctx context.Context, level int64) ([]contract.Script, error)
	DeleteScriptsConstants(ctx context.Context, scriptIds []int64, constantsIds []int64) error
	Protocols(ctx context.Context, level int64) error
	UpdateStats(ctx context.Context, stats stats.Stats) error
	TicketBalances(ctx context.Context, balances ...*ticket.Balance) error
	DeleteTickets(ctx context.Context, level int64) (ids []int64, err error)
	DeleteTicketBalances(ctx context.Context, ticketIds []int64) (err error)

	Commit() error
	Rollback() error
}

type Transaction

type Transaction interface {
	Save(ctx context.Context, data any) error
	Migrations(ctx context.Context, migrations ...*migration.Migration) error
	GlobalConstants(ctx context.Context, constants ...*contract.GlobalConstant) error
	BigMapStates(ctx context.Context, states ...*bigmapdiff.BigMapState) error
	BigMapDiffs(ctx context.Context, bigmapdiffs ...*bigmapdiff.BigMapDiff) error
	BigMapActions(ctx context.Context, bigmapdiffs ...*bigmapaction.BigMapAction) error
	Accounts(ctx context.Context, accounts ...*account.Account) error
	SmartRollups(ctx context.Context, rollups ...*smartrollup.SmartRollup) error
	Operations(ctx context.Context, operations ...*operation.Operation) error
	TickerUpdates(ctx context.Context, updates ...*ticket.TicketUpdate) error
	Contracts(ctx context.Context, contracts ...*contract.Contract) error
	Scripts(ctx context.Context, scripts ...*contract.Script) error
	ScriptConstant(ctx context.Context, data ...*contract.ScriptConstants) error
	Block(ctx context.Context, block *block.Block) error
	Protocol(ctx context.Context, proto *protocol.Protocol) error
	UpdateStats(ctx context.Context, stats stats.Stats) error
	Tickets(ctx context.Context, tickets ...*ticket.Ticket) error
	TicketBalances(ctx context.Context, balances ...*ticket.Balance) error

	ToBabylon(ctx context.Context) error
	BabylonUpdateNonDelegator(ctx context.Context, contract *contract.Contract) error
	ToJakarta(ctx context.Context) error
	JakartaVesting(ctx context.Context, contract *contract.Contract) error
	JakartaUpdateNonDelegator(ctx context.Context, contract *contract.Contract) error
	BabylonUpdateBigMapDiffs(ctx context.Context, contract string, ptr int64) (int, error)
	DeleteBigMapStatesByContract(ctx context.Context, contract string) ([]bigmapdiff.BigMapState, error)

	Commit() error
	Rollback() error
}

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.
account
Code generated by MockGen.
Code generated by MockGen.
bigmapaction
Code generated by MockGen.
Code generated by MockGen.
bigmapdiff
Code generated by MockGen.
Code generated by MockGen.
block
Code generated by MockGen.
Code generated by MockGen.
contract
Code generated by MockGen.
Code generated by MockGen.
domains
Code generated by MockGen.
Code generated by MockGen.
migration
Code generated by MockGen.
Code generated by MockGen.
operation
Code generated by MockGen.
Code generated by MockGen.
protocol
Code generated by MockGen.
Code generated by MockGen.
smart_rollup
Code generated by MockGen.
Code generated by MockGen.
stats
Code generated by MockGen.
Code generated by MockGen.
ticket
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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