github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/types/module/adapter.go (about) 1 package module 2 3 import ( 4 clictx "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/client/context" 5 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/codec" 6 codectypes "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/codec/types" 7 sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types" 8 "github.com/gorilla/mux" 9 "github.com/grpc-ecosystem/grpc-gateway/runtime" 10 "github.com/spf13/cobra" 11 ) 12 13 // AppModuleBasic is the standard form for basic non-dependant elements of an application module. 14 type AppModuleBasicAdapter interface { 15 AppModuleBasic 16 RegisterInterfaces(codectypes.InterfaceRegistry) 17 // client functionality 18 RegisterGRPCGatewayRoutes(clictx.CLIContext, *runtime.ServeMux) 19 GetTxCmdV2(cdc *codec.CodecProxy, reg codectypes.InterfaceRegistry) *cobra.Command 20 GetQueryCmdV2(cdc *codec.CodecProxy, reg codectypes.InterfaceRegistry) *cobra.Command 21 22 RegisterRouterForGRPC(cliCtx clictx.CLIContext, r *mux.Router) 23 } 24 25 // AppModuleGenesis is the standard form for an application module genesis functions 26 type AppModuleGenesisAdapter interface { 27 AppModuleGenesis 28 AppModuleBasicAdapter 29 } 30 31 // AppModule is the standard form for an application module 32 type AppModuleAdapter interface { 33 AppModule 34 AppModuleGenesisAdapter 35 // registers 36 RegisterInvariants(sdk.InvariantRegistry) 37 // RegisterServices allows a module to register services 38 RegisterServices(Configurator) 39 }