keeper

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryParameters       = "params"
	QueryPurchaseOrders   = "orders"
	QueryGetPurchaseOrder = "order"
	QueryGetLocked        = "locked"
	QueryTotalLocked      = "total-locked"
	QueryTotalUnlocked    = "total-unlocked"
	QueryEnterpriseSupply = "ent-supply"
	QueryTotalSupply      = "total-supply"
	QueryTotalSupplyOf    = "total-supply-of"
	QueryWhitelist        = "whitelist"
	QueryWhitelisted      = "whitelisted"
)

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(keeper Keeper) sdk.Invariant

AllInvariants runs all invariants of the enterprise module

func ModuleAccountInvariant

func ModuleAccountInvariant(keeper Keeper) sdk.Invariant

ModuleAccountInvariant checks that the module account coins reflects the sum of locked FUND held on store

func NewLegacyQuerier

func NewLegacyQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewLegacyQuerier is the module level router for state queries

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the gov MsgServer interface for the provided Keeper.

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)

RegisterInvariants registers all enterprise invariants

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(storeKey storetypes.StoreKey, bankKeeper types.BankKeeper,
	accKeeper types.AccountKeeper, paramSpace paramtypes.Subspace,
	cdc codec.BinaryCodec) Keeper

NewKeeper creates new instances of the enterprise Keeper

func (Keeper) AccountHasLockedUnd

func (k Keeper) AccountHasLockedUnd(ctx sdk.Context, address sdk.AccAddress) bool

Check if a record exists for locked FUND given an account address

func (Keeper) AccountHasSpentEFUND added in v1.6.1

func (k Keeper) AccountHasSpentEFUND(ctx sdk.Context, address sdk.AccAddress) bool

AccountHasSpentEFUND checks if given account has an entry for spent eFUND

func (Keeper) AddAddressToWhitelist

func (k Keeper) AddAddressToWhitelist(ctx sdk.Context, address sdk.AccAddress) error

AddAddressToWhitelist adds an address to the whitelist

func (Keeper) AddPoToAcceptedQueue

func (k Keeper) AddPoToAcceptedQueue(ctx sdk.Context, purchaseOrderId uint64)

func (Keeper) AddPoToRaisedQueue

func (k Keeper) AddPoToRaisedQueue(ctx sdk.Context, purchaseOrderId uint64)

func (Keeper) AddressIsWhitelisted

func (k Keeper) AddressIsWhitelisted(ctx sdk.Context, address sdk.AccAddress) bool

Check if a record exists for locked FUND given an account address

func (Keeper) EnterpriseUndPurchaseOrder

Purchase Order queries PO details based on PurchaseOrderId

func (Keeper) EnterpriseUndPurchaseOrders

Purchase Orders paginated

func (Keeper) GetAllAcceptedPurchaseOrders

func (k Keeper) GetAllAcceptedPurchaseOrders(ctx sdk.Context) (purchaseOrderIds []uint64)

GetAllAcceptedPurchaseOrders returns all the purchase orders from store

func (Keeper) GetAllLockedUndAccountsIterator

func (k Keeper) GetAllLockedUndAccountsIterator(ctx sdk.Context) sdk.Iterator

Get an iterator over all accounts with Locked FUND

func (Keeper) GetAllLockedUnds

func (k Keeper) GetAllLockedUnds(ctx sdk.Context) (lockedUnds []types.LockedUnd)

func (Keeper) GetAllPurchaseOrders

func (k Keeper) GetAllPurchaseOrders(ctx sdk.Context) (purchaseOrders []types.EnterpriseUndPurchaseOrder)

GetAllPurchaseOrders returns all the purchase orders from store

func (Keeper) GetAllRaisedPurchaseOrders

func (k Keeper) GetAllRaisedPurchaseOrders(ctx sdk.Context) (purchaseOrderIds []uint64)

GetAllRaisedPurchaseOrders returns all the purchase orders from store

func (Keeper) GetAllSpentEFUNDAccountsIterator added in v1.6.1

func (k Keeper) GetAllSpentEFUNDAccountsIterator(ctx sdk.Context) sdk.Iterator

Get an iterator over all accounts with spent eFUND

func (Keeper) GetAllSpentEFUNDs added in v1.6.1

func (k Keeper) GetAllSpentEFUNDs(ctx sdk.Context) (spentEFUNDs []types.SpentEFUND)

func (Keeper) GetAllWhitelistedAddresses

func (k Keeper) GetAllWhitelistedAddresses(ctx sdk.Context) (addresses []string)

GetAllWhitelistedAddresses returns an array of all currently whitelisted addresses

func (Keeper) GetCoins

func (k Keeper) GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins

func (Keeper) GetEnterpriseAccount

func (k Keeper) GetEnterpriseAccount(ctx sdk.Context) authtypes.ModuleAccountI

GetEnterpriseAccount returns the enterprise ModuleAccount

func (Keeper) GetEnterpriseSupplyIncludingLockedUnd

func (k Keeper) GetEnterpriseSupplyIncludingLockedUnd(ctx sdk.Context) types.UndSupply

GetEnterpriseSupplyIncludingLockedUnd returns information including total FUND supply, total locked and unlocked

func (Keeper) GetEnterpriseUserAccount

func (k Keeper) GetEnterpriseUserAccount(ctx sdk.Context, owner sdk.AccAddress) types.EnterpriseUserAccount

func (Keeper) GetHighestPurchaseOrderID

func (k Keeper) GetHighestPurchaseOrderID(ctx sdk.Context) (purchaseOrderID uint64, err error)

GetHighestPurchaseOrderID gets the highest purchase order ID

func (Keeper) GetLockedUndAmountForAccount

func (k Keeper) GetLockedUndAmountForAccount(ctx sdk.Context, address sdk.AccAddress) sdk.Coin

func (Keeper) GetLockedUndForAccount

func (k Keeper) GetLockedUndForAccount(ctx sdk.Context, address sdk.AccAddress) types.LockedUnd

Gets a record for Locked FUND for a given address

func (Keeper) GetParamDecisionLimit

func (k Keeper) GetParamDecisionLimit(ctx sdk.Context) uint64

func (Keeper) GetParamDenom

func (k Keeper) GetParamDenom(ctx sdk.Context) string

func (Keeper) GetParamEntSigners

func (k Keeper) GetParamEntSigners(ctx sdk.Context) string

func (Keeper) GetParamEntSignersAsAddressArray

func (k Keeper) GetParamEntSignersAsAddressArray(ctx sdk.Context) []sdk.AccAddress

func (Keeper) GetParamMinAccepts

func (k Keeper) GetParamMinAccepts(ctx sdk.Context) uint64

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of Enterprise FUND parameters.

func (Keeper) GetPurchaseOrder

func (k Keeper) GetPurchaseOrder(ctx sdk.Context, purchaseOrderID uint64) (types.EnterpriseUndPurchaseOrder, bool)

Gets a purchase order for a given purchaseOrderID

func (Keeper) GetPurchaseOrderAmount

func (k Keeper) GetPurchaseOrderAmount(ctx sdk.Context, purchaseOrderID uint64) sdk.Coin

GetPurchaseOrderAmount - get the Amount of a raised purchase order for a given purchaseOrderID

func (Keeper) GetPurchaseOrderPurchaser

func (k Keeper) GetPurchaseOrderPurchaser(ctx sdk.Context, purchaseOrderID uint64) sdk.AccAddress

GetPurchaseOrderPurchaser - get the Purchaser address of a purchase order should be the same as the search term!

func (Keeper) GetPurchaseOrderStatus

func (k Keeper) GetPurchaseOrderStatus(ctx sdk.Context, purchaseOrderID uint64) types.PurchaseOrderStatus

GetPurchaseOrderStatus - get the Decision of a purchase order for a given purchaseOrderID

func (Keeper) GetPurchaseOrdersFiltered

func (k Keeper) GetPurchaseOrdersFiltered(ctx sdk.Context, params types.QueryPurchaseOrdersParams) []types.EnterpriseUndPurchaseOrder

GetPurchaseOrdersFiltered retrieves purchase orders filtered by a given set of params which include pagination parameters along a purchase order status.

NOTE: If no filters are provided, all proposals will be returned in paginated form.

func (Keeper) GetSpentEFUNDAmountForAccount added in v1.6.1

func (k Keeper) GetSpentEFUNDAmountForAccount(ctx sdk.Context, address sdk.AccAddress) sdk.Coin

func (Keeper) GetSpentEFUNDForAccount added in v1.6.1

func (k Keeper) GetSpentEFUNDForAccount(ctx sdk.Context, address sdk.AccAddress) types.SpentEFUND

GetSpentEFUNDForAccount Gets a record for used eFUND for a given address

func (Keeper) GetSupplyOfWithLockedNundRemoved

func (k Keeper) GetSupplyOfWithLockedNundRemoved(ctx sdk.Context, denom string) sdk.Coin

func (Keeper) GetTotalLockedUnd

func (k Keeper) GetTotalLockedUnd(ctx sdk.Context) sdk.Coin

GetTotalLockedUnd returns the total locked eFUND

func (Keeper) GetTotalSpentEFUND added in v1.6.1

func (k Keeper) GetTotalSpentEFUND(ctx sdk.Context) sdk.Coin

GetTotalSpentEFUND returns the total spent eFUND

func (Keeper) GetTotalSupplyWithLockedNundRemoved

func (k Keeper) GetTotalSupplyWithLockedNundRemoved(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error)

GetTotalSupplyWithLockedNundRemoved sits on top of the Bank Keeper's GetPaginatedTotalSupply and removes locked FUND from nund supply

func (Keeper) GetTotalUnLockedUnd

func (k Keeper) GetTotalUnLockedUnd(ctx sdk.Context) sdk.Coin

GetTotalUnLockedUnd returns the amount of unlocked FUND - i.e. in active circulation (totalSupply - locked)

func (Keeper) GetTotalUndSupply

func (k Keeper) GetTotalUndSupply(ctx sdk.Context) sdk.Coin

GetTotalUndSupply returns the total FUND in supply, obtained from the supply module's keeper

func (Keeper) IsAuthorisedToDecide

func (k Keeper) IsAuthorisedToDecide(ctx sdk.Context, signer sdk.AccAddress) bool

func (Keeper) IsLocked

func (k Keeper) IsLocked(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IterateAcceptedQueue

func (k Keeper) IterateAcceptedQueue(ctx sdk.Context, cb func(purchaseOrderId uint64) (stop bool))

IterateAcceptedQueue iterates over the all the Accepted purchase orders and performs a callback function

func (Keeper) IteratePurchaseOrders

func (k Keeper) IteratePurchaseOrders(ctx sdk.Context, cb func(purchaseOrder types.EnterpriseUndPurchaseOrder) (stop bool))

IteratePurchaseOrders iterates over the all the purchase orders and performs a callback function

func (Keeper) IterateRaisedQueue

func (k Keeper) IterateRaisedQueue(ctx sdk.Context, cb func(purchaseOrderId uint64) (stop bool))

IterateRaisedQueue iterates over the all the raised purchase orders and performs a callback function

func (Keeper) IterateWhitelist

func (k Keeper) IterateWhitelist(ctx sdk.Context, cb func(addr sdk.AccAddress) (stop bool))

IterateWhitelist iterates over the all the whitelisted addresses and performs a callback function

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MintCoinsAndLock

func (k Keeper) MintCoinsAndLock(ctx sdk.Context, recipient sdk.AccAddress, amount sdk.Coin) error

MintCoinsAndLock implements an alias call to the underlying bank keeper's MintCoins MintCoinsAndLock to be used in BeginBlocker.

func (Keeper) Params

func (Keeper) ProcessAcceptedPurchaseOrders

func (k Keeper) ProcessAcceptedPurchaseOrders(ctx sdk.Context)

func (Keeper) ProcessPurchaseOrderDecision

func (k Keeper) ProcessPurchaseOrderDecision(ctx sdk.Context, purchaseOrderID uint64, decision types.PurchaseOrderStatus, signer sdk.AccAddress) error

func (Keeper) ProcessWhitelistAction

func (k Keeper) ProcessWhitelistAction(ctx sdk.Context, address sdk.AccAddress, action types.WhitelistAction, signer sdk.AccAddress) error

ProcessWhitelistAction processes the add/remove whitelist messages

func (Keeper) PurchaseOrderExists

func (k Keeper) PurchaseOrderExists(ctx sdk.Context, purchaseOrderID uint64) bool

Check if a raised purchase order for a given purchaseOrderID is in the store or not

func (Keeper) PurchaseOrderIsInAcceptedQueue

func (k Keeper) PurchaseOrderIsInAcceptedQueue(ctx sdk.Context, purchaseOrderId uint64) bool

func (Keeper) PurchaseOrderIsInRaisedQueue

func (k Keeper) PurchaseOrderIsInRaisedQueue(ctx sdk.Context, purchaseOrderId uint64) bool

func (Keeper) RaiseNewPurchaseOrder

func (k Keeper) RaiseNewPurchaseOrder(ctx sdk.Context, purchaseOrder types.EnterpriseUndPurchaseOrder) (uint64, error)

func (Keeper) RemoveAddressFromWhitelist

func (k Keeper) RemoveAddressFromWhitelist(ctx sdk.Context, address sdk.AccAddress) error

RemoveAddressFromWhitelist removes an address from the whitelist

func (Keeper) RemovePurchaseOrderFromAcceptedQueue

func (k Keeper) RemovePurchaseOrderFromAcceptedQueue(ctx sdk.Context, purchaseOrderId uint64)

func (Keeper) RemovePurchaseOrderFromRaisedQueue

func (k Keeper) RemovePurchaseOrderFromRaisedQueue(ctx sdk.Context, purchaseOrderId uint64)

func (Keeper) SetHighestPurchaseOrderID

func (k Keeper) SetHighestPurchaseOrderID(ctx sdk.Context, purchaseOrderID uint64)

SetHighestPurchaseOrderID sets the new proposal ID to the store

func (Keeper) SetLockedUndForAccount

func (k Keeper) SetLockedUndForAccount(ctx sdk.Context, lockedUnd types.LockedUnd) error

Sets the Locked FUND data

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the total set of Enterprise FUND parameters.

func (Keeper) SetPurchaseOrder

func (k Keeper) SetPurchaseOrder(ctx sdk.Context, purchaseOrder types.EnterpriseUndPurchaseOrder) error

Sets the Purchase Order data

func (Keeper) SetSpentEFUNDForAccount added in v1.6.1

func (k Keeper) SetSpentEFUNDForAccount(ctx sdk.Context, spent types.SpentEFUND) error

SetSpentEFUNDForAccount Sets the spent eFUND data

func (Keeper) SetTotalLockedUnd

func (k Keeper) SetTotalLockedUnd(ctx sdk.Context, totalLocked sdk.Coin) error

SetTotalLockedUnd sets the total locked FUND

func (Keeper) SetTotalSpentEFUND added in v1.6.1

func (k Keeper) SetTotalSpentEFUND(ctx sdk.Context, totalUsed sdk.Coin) error

SetTotalSpentEFUND sets the total used eFUND

func (Keeper) SpentEFUNDByAddress added in v1.6.1

func (Keeper) SupplyOf

SupplyOf Should be used in place of /cosmos/bank/v1beta1/supply to get true total supply, with locked eFUND removed from total for nund

func (Keeper) SupplyOfOverwrite

func (Keeper) TallyPurchaseOrderDecisions

func (k Keeper) TallyPurchaseOrderDecisions(ctx sdk.Context)

func (Keeper) TotalSpentEFUND added in v1.6.1

func (Keeper) TotalSupply

TotalSupply Should be used in place of /cosmos/bank/v1beta1/supply to get true total supply, with locked eFUND removed from total for nund

func (Keeper) UnlockCoinsForFees

func (k Keeper) UnlockCoinsForFees(ctx sdk.Context, feePayer sdk.AccAddress, feesToPay sdk.Coins) error

type Migrator added in v1.6.1

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator added in v1.6.1

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

Jump to

Keyboard shortcuts

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