types

package
v0.0.0-...-b8c38bb Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName defines the module name
	ModuleName = "service"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_service"
)
View Source
const DefaultAddServiceFee = 1000000000 // 1000 POKT

DefaultAddServiceFee is the default value for the add service fee parameter in the genesis state of the service module. TODO_BLOCKER: Revisit default param values for service fee

View Source
const (
	// ServiceKeyPrefix is the prefix to retrieve all Service
	ServiceKeyPrefix = "Service/id/"
)

Variables

View Source
var (
	ErrServiceInvalidSigner        = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message")
	ErrServiceDuplicateIndex       = sdkerrors.Register(ModuleName, 1101, "duplicate index when adding a new service")
	ErrServiceInvalidAddress       = sdkerrors.Register(ModuleName, 1102, "invalid address when adding a new service")
	ErrServiceMissingID            = sdkerrors.Register(ModuleName, 1103, "missing service ID")
	ErrServiceMissingName          = sdkerrors.Register(ModuleName, 1104, "missing service name")
	ErrServiceAlreadyExists        = sdkerrors.Register(ModuleName, 1105, "service already exists")
	ErrServiceInvalidServiceFee    = sdkerrors.Register(ModuleName, 1106, "invalid service fee")
	ErrServiceAccountNotFound      = sdkerrors.Register(ModuleName, 1107, "account not found")
	ErrServiceNotEnoughFunds       = sdkerrors.Register(ModuleName, 1108, "not enough funds to add service")
	ErrServiceFailedToDeductFee    = sdkerrors.Register(ModuleName, 1109, "failed to deduct fee")
	ErrServiceInvalidRelayResponse = sdkerrors.Register(ModuleName, 1110, "invalid relay response")
	ErrServiceInvalidRelayRequest  = sdkerrors.Register(ModuleName, 1111, "invalid relay request")
)

x/service module sentinel errors

View Source
var (
	KeyAddServiceFee = []byte("AddServiceFee")
)
View Source
var ParamsKey = []byte("p_service")

Functions

func GetHashFromBytes

func GetHashFromBytes(relayBz []byte) [32]byte

GetHashFromBytes returns the hash of the relay (full, request or response) bytes. It is used as helper in the case that the relay is already marshaled and centralizes the hasher used.

func KeyPrefix

func KeyPrefix(p string) []byte

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable the param key table for launch module

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func ServiceKey

func ServiceKey(serviceID string) []byte

ServiceKey returns the store key to retrieve a Service from the index fields

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(context.Context, sdk.AccAddress) sdk.AccountI // only used for simulation

}

AccountKeeper defines the expected interface for the Account module.

type BankKeeper

type BankKeeper interface {
	SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins
	// We use the bankkeeper SendXXX instead of DelegateXX methods
	// because their purpose is to "escrow" funds on behalf of an account rather
	// than "delegate" funds from one account to another which is more closely
	// linked to staking.
	SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the expected interface for the Bank module.

Jump to

Keyboard shortcuts

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