bucket

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "bucket"
)

Variables

View Source
var (
	EventCreateBucket             = proto.MessageName(&storagetypes.EventCreateBucket{})
	EventDeleteBucket             = proto.MessageName(&storagetypes.EventDeleteBucket{})
	EventUpdateBucketInfo         = proto.MessageName(&storagetypes.EventUpdateBucketInfo{})
	EventDiscontinueBucket        = proto.MessageName(&storagetypes.EventDiscontinueBucket{})
	EventCompleteMigrationBucket  = proto.MessageName(&storagetypes.EventCompleteMigrationBucket{})
	EventToggleSPAsDelegatedAgent = proto.MessageName(&storagetypes.EventToggleSPAsDelegatedAgent{})
)

Functions

func AddStatus added in v1.6.0

func AddStatus(currentStatus int, statusToAdd int) int

AddStatus updates the current status by adding the specified status to it.

func IsStatusSet added in v1.6.0

func IsStatusSet(currentStatus int, statusToCheck int) bool

IsStatusSet checks if the specified status is set in the current status.

func RemoveStatus added in v1.6.0

func RemoveStatus(currentStatus int, statusToRemove int) int

RemoveStatus removes the specified status from the current status.

Types

type Module

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

Module represents the bucket module

func NewModule

func NewModule(db *database.DB) *Module

NewModule builds a new Module instance

func (*Module) AutoMigrate

func (m *Module) AutoMigrate() error

AutoMigrate implements

func (*Module) ClearCtx added in v1.2.0

func (m *Module) ClearCtx()

ClearCtx resets the module's context to a new, empty context. This effectively removes all key-value pairs previously stored in the context. This can be used for cleanup or reinitialization purposes.

func (*Module) ExtractEventStatements

func (m *Module) ExtractEventStatements(ctx context.Context, block *tmctypes.ResultBlock, txHash common.Hash, event sdk.Event) (map[string][]interface{}, error)

func (*Module) GetCtx added in v1.2.0

func (m *Module) GetCtx(key string) interface{}

GetCtx retrieves the value associated with a given key from the module's context. If the key exists in the context, it returns the value; otherwise, it returns nil. This is commonly used to access data that was previously stored with Set.

func (*Module) HandleEvent

func (m *Module) HandleEvent(ctx context.Context, block *tmctypes.ResultBlock, txHash common.Hash, event sdk.Event) error

func (*Module) Name

func (m *Module) Name() string

Name implements modules.Module

func (*Module) PrepareTables

func (m *Module) PrepareTables() error

PrepareTables implements

func (*Module) SetCtx added in v1.2.0

func (m *Module) SetCtx(key string, val interface{})

SetCtx associates a given key with a value in the module's context. It takes a key of type string and a value of any type, and stores the pair in the context. This is useful for passing data across different parts of a module.

type OffChainStatus added in v1.6.0

type OffChainStatus int
const (
	// OffChainStatusIsLimited has the value of 1 (binary: 00000001)
	OffChainStatusIsLimited OffChainStatus = 1 << iota // 1

	// OffChainStatusSpAsDelegatedAgentDisabled has the value of 2 (binary: 00000010)
	OffChainStatusSpAsDelegatedAgentDisabled // 1 << 1
)

Jump to

Keyboard shortcuts

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