bigmapdiff

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigMapDiff

type BigMapDiff struct {
	bun.BaseModel `bun:"big_map_diffs"`

	ID          int64       `bun:"id,pk,notnull,autoincrement"`
	Ptr         int64       `bun:"ptr"`
	Key         types.Bytes `bun:"key,notnull,type:bytea"`
	KeyHash     string      `bun:"key_hash,type:text"`
	Value       types.Bytes `bun:"value,type:bytea"`
	Level       int64
	Contract    string    `bun:"contract,type:text"`
	Timestamp   time.Time `bun:"timestamp,pk,notnull"`
	ProtocolID  int64     `bun:"protocol_id,type:SMALLINT"`
	OperationID int64
}

BigMapDiff -

func (*BigMapDiff) GetID

func (b *BigMapDiff) GetID() int64

GetID -

func (*BigMapDiff) KeyBytes

func (b *BigMapDiff) KeyBytes() []byte

KeyBytes -

func (*BigMapDiff) LogFields

func (b *BigMapDiff) LogFields() map[string]interface{}

LogFields -

func (BigMapDiff) TableName

func (BigMapDiff) TableName() string

func (*BigMapDiff) ToState

func (b *BigMapDiff) ToState() *BigMapState

ToState -

func (*BigMapDiff) ValueBytes

func (b *BigMapDiff) ValueBytes() []byte

ValueBytes -

type BigMapState

type BigMapState struct {
	bun.BaseModel `bun:"big_map_states"`

	ID              int64       `bun:"id,pk,notnull,autoincrement"`
	Ptr             int64       `bun:"ptr,notnull,unique:big_map_state_unique"`
	LastUpdateLevel int64       `bun:"last_update_level"`
	Count           int64       `bun:"count"`
	LastUpdateTime  time.Time   `bun:"last_update_time"`
	KeyHash         string      `bun:"key_hash,type:text,notnull,unique:big_map_state_unique"`
	Contract        string      `bun:"contract,type:text,notnull,unique:big_map_state_unique"`
	Key             types.Bytes `bun:"key,type:bytea,notnull"`
	Value           types.Bytes `bun:"value,type:bytea"`
	Removed         bool        `bun:"removed"`

	IsRollback bool `bun:"-"`
}

BigMapState -

func (*BigMapState) GetID

func (b *BigMapState) GetID() int64

GetID -

func (*BigMapState) LogFields

func (b *BigMapState) LogFields() map[string]interface{}

LogFields -

func (BigMapState) String

func (b BigMapState) String() string

func (BigMapState) TableName

func (BigMapState) TableName() string

func (*BigMapState) ToDiff

func (b *BigMapState) ToDiff() BigMapDiff

ToDiff -

type Bucket

type Bucket struct {
	BigMapDiff

	KeysCount int64
}

Bucket -

type GetContext

type GetContext struct {
	Ptr          *int64
	Size         int64
	Offset       int64
	MaxLevel     *int64
	MinLevel     *int64
	CurrentLevel *int64
	Contract     string
}

GetContext -

type Repository

type Repository interface {
	Get(ctx context.Context, reqCtx GetContext) ([]Bucket, error)
	GetForOperation(ctx context.Context, id int64) ([]BigMapDiff, error)
	GetByPtr(ctx context.Context, contract string, ptr int64) ([]BigMapState, error)
	GetByPtrAndKeyHash(ctx context.Context, ptr int64, keyHash string, size int64, offset int64) ([]BigMapDiff, int64, error)
	GetForAddress(ctx context.Context, address string) ([]BigMapState, error)
	Count(ctx context.Context, ptr int64) (int, error)
	Current(ctx context.Context, keyHash string, ptr int64) (BigMapState, error)
	Previous(ctx context.Context, diffs []BigMapDiff) ([]BigMapDiff, error)
	GetStats(ctx context.Context, ptr int64) (Stats, error)
	Keys(ctx context.Context, reqCtx GetContext) (states []BigMapState, err error)
}

type Stats

type Stats struct {
	Total    int64
	Active   int64
	Contract string
}

Stats -

Jump to

Keyboard shortcuts

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