go-cyber/x/cyberbank/module.go

package cyberbank

import (
	"encoding/json"

	"github.com/cosmos/cosmos-sdk/client"
	codectypes "github.com/cosmos/cosmos-sdk/codec/types"
	"github.com/gorilla/mux"
	"github.com/grpc-ecosystem/grpc-gateway/runtime"
	"github.com/spf13/cobra"

	abci "github.com/cometbft/cometbft/abci/types"

	"github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/cosmos/cosmos-sdk/types/module"

	"github.com/cybercongress/go-cyber/v7/x/cyberbank/keeper"
	"github.com/cybercongress/go-cyber/v7/x/cyberbank/types"
)

var (
	_ module.AppModule      = AppModule{}
	_ module.AppModuleBasic = AppModuleBasic{}
)

type AppModuleBasic struct {
	cdc codec.Codec
}

func (AppModuleBasic) Name() string { return types.ModuleName }

func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {}

func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage {
	return nil
}

func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, _ json.RawMessage) error {
	return nil
}

func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {}

func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {}

func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil }

func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil }

func (AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) {}

type AppModule struct {
	AppModuleBasic

	keeper *keeper.IndexedKeeper
}

func NewAppModule(
	cdc codec.Codec,
	ik *keeper.IndexedKeeper,
) AppModule {
	return AppModule{
		AppModuleBasic: AppModuleBasic{cdc: cdc},
		keeper:         ik,
	}
}

func (AppModule) Name() string { return types.ModuleName }

func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

func (AppModule) RegisterServices(_ module.Configurator) {}

func (am AppModule) InitGenesis(ctx sdk.Context, _ codec.JSONCodec, _ json.RawMessage) []abci.ValidatorUpdate {
	// this will be called by the app module manager because of null module params in genesis, used direct call in InitChainer
	// am.keeper.InitGenesis(ctx)
	return []abci.ValidatorUpdate{}
}

func (AppModule) ExportGenesis(_ sdk.Context, _ codec.JSONCodec) json.RawMessage { return nil }

func (am AppModule) ConsensusVersion() uint64 {
	return 1
}

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {}

func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
	EndBlocker(ctx, am.keeper)
	return []abci.ValidatorUpdate{}
}

Synonyms

go-cyber/x/liquidity/module.go
cyberindex/modules/graph/module.go
cyberindex/modules/grid/module.go
space-pussy/x/grid/module.go
cyberindex/modules/liquidity/module.go
go-cyber/x/rank/module.go
space-pussy/x/resources/module.go
go-cyber/x/dmn/module.go
space-pussy/x/graph/module.go
go-cyber/x/graph/module.go
go-cyber/x/tokenfactory/module.go
cyberindex/modules/resources/module.go
go-cyber/x/clock/module.go
space-pussy/x/rank/module.go
cyberindex/modules/bank/module.go
space-pussy/x/bandwidth/module.go
space-pussy/x/cyberbank/module.go
go-cyber/x/resources/module.go
space-pussy/x/dmn/module.go
go-cyber/x/staking/module.go
cyberindex/modules/wasm/module.go
space-pussy/x/staking/module.go
go-cyber/x/bandwidth/module.go
go-cyber/x/grid/module.go

Neighbours