ecocredit

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ModuleName is the module name constant used in many places
	ModuleName        = "ecocredit"
	RouterKey         = ModuleName
	DefaultParamspace = ModuleName

	ORMPrefix byte = 0x7
)
View Source
const GasCostPerIteration = uint64(10)

TODO: Revisit this once we have proper gas fee framework. Tracking issue https://github.com/cosmos/cosmos-sdk/discussions/9072

Variables

View Source
var (
	ErrParseFailure        = sdkerrors.Register(ModuleName, 2, "parse error")
	ErrInsufficientCredits = sdkerrors.Register(ModuleName, 3, "insufficient credit balance")
	ErrMaxLimit            = sdkerrors.Register(ModuleName, 4, "limit exceeded")
	ErrInvalidSellOrder    = sdkerrors.Register(ModuleName, 5, "invalid sell order")
	ErrInvalidBuyOrder     = sdkerrors.Register(ModuleName, 6, "invalid buy order")
)
View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)
View Source
var ModuleSchema = ormapi.ModuleSchemaDescriptor{
	SchemaFile: []*ormapi.ModuleSchemaDescriptor_FileEntry{
		{Id: 1, ProtoFileName: basketapi.File_regen_ecocredit_basket_v1_state_proto.Path()},
		{Id: 2, ProtoFileName: api.File_regen_ecocredit_v1_state_proto.Path()},
		{Id: 3, ProtoFileName: marketApi.File_regen_ecocredit_marketplace_v1_state_proto.Path()},
	},
	Prefix: []byte{ORMPrefix},
}

Functions

This section is empty.

Types

type AccountKeeper

type AccountKeeper interface {
	// NewAccount returns a new account with the next account number. Does not save the new account to the store.
	NewAccount(sdk.Context, authtypes.AccountI) authtypes.AccountI

	// GetAccount retrieves an account from the store.
	GetAccount(sdk.Context, sdk.AccAddress) authtypes.AccountI

	// GetModuleAddress retrieves a module account address from the store.
	GetModuleAddress(moduleName string) sdk.AccAddress

	// SetAccount sets an account in the store.
	SetAccount(sdk.Context, authtypes.AccountI)
}

AccountKeeper defines the expected interface needed to create and retrieve accounts.

type BankKeeper

type BankKeeper interface {
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
	GetSupply(ctx sdk.Context, denom string) sdk.Coin
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
}

BankKeeper defines the expected interface needed to burn and send coins and to retrieve account balances.

type ParamKeeper

type ParamKeeper interface {

	// Get fetches a parameter by key from the Subspace's KVStore and sets the provided pointer to the fetched value.
	// If the value does not exist, this method will panic.
	Get(ctx sdk.Context, key []byte, ptr interface{})

	// GetParamSet fetches each parameter in the ParamSet.
	GetParamSet(ctx sdk.Context, ps types.ParamSet)
}

Directories

Path Synopsis
Package basket is a reverse proxy.
Package basket is a reverse proxy.
Package core is a reverse proxy.
Package core is a reverse proxy.
Package marketplace is a reverse proxy.
Package marketplace is a reverse proxy.
migrations
v3
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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