github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/x/staking/module_ibc.go (about) 1 package staking 2 3 import ( 4 "context" 5 6 "github.com/fibonacci-chain/fbc/x/staking/keeper" 7 8 cosmost "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/store/types" 9 "github.com/fibonacci-chain/fbc/x/staking/typesadapter" 10 11 clictx "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/client/context" 12 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/codec" 13 anytypes "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/codec/types" 14 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types/module" 15 "github.com/gorilla/mux" 16 "github.com/grpc-ecosystem/grpc-gateway/runtime" 17 18 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types/upgrade" 19 params2 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/x/params" 20 "github.com/fibonacci-chain/fbc/x/params" 21 "github.com/fibonacci-chain/fbc/x/staking/client/rest" 22 "github.com/fibonacci-chain/fbc/x/staking/types" 23 _ "github.com/fibonacci-chain/fbc/x/staking/typesadapter" 24 "github.com/spf13/cobra" 25 ) 26 27 var ( 28 _ upgrade.UpgradeModule = AppModule{} 29 _ module.AppModuleAdapter = AppModule{} 30 _ module.AppModuleBasicAdapter = AppModuleBasic{} 31 ) 32 33 // appmoduleBasic 34 func (am AppModuleBasic) RegisterRouterForGRPC(cliCtx clictx.CLIContext, r *mux.Router) { 35 rest.RegisterOriginRPCRoutersForGRPC(cliCtx, r) 36 } 37 38 func (am AppModuleBasic) RegisterInterfaces(registry anytypes.InterfaceRegistry) {} 39 40 func (am AppModuleBasic) RegisterGRPCGatewayRoutes(cliContext clictx.CLIContext, serveMux *runtime.ServeMux) { 41 typesadapter.RegisterQueryHandlerClient(context.Background(), serveMux, typesadapter.NewQueryClient(cliContext)) 42 } 43 44 func (am AppModuleBasic) GetTxCmdV2(cdc *codec.CodecProxy, reg anytypes.InterfaceRegistry) *cobra.Command { 45 return nil 46 } 47 48 func (am AppModuleBasic) GetQueryCmdV2(cdc *codec.CodecProxy, reg anytypes.InterfaceRegistry) *cobra.Command { 49 return nil 50 } 51 52 // / appmodule 53 func (am AppModule) RegisterServices(cfg module.Configurator) { 54 typesadapter.RegisterQueryServer(cfg.QueryServer(), keeper.NewGrpcQuerier(am.keeper)) 55 } 56 57 func (am AppModule) RegisterTask() upgrade.HeightTask { 58 return nil 59 } 60 61 func (am AppModule) UpgradeHeight() int64 { 62 return -1 63 } 64 65 func (am AppModule) RegisterParam() params.ParamSet { 66 v := types.KeyHistoricalEntriesParams(7) 67 return params2.ParamSet(v) 68 } 69 70 func (am AppModule) ModuleName() string { 71 return ModuleName 72 } 73 74 func (am AppModule) CommitFilter() *cosmost.StoreFilter { 75 return nil 76 } 77 78 func (am AppModule) PruneFilter() *cosmost.StoreFilter { 79 return nil 80 } 81 82 func (am AppModule) VersionFilter() *cosmost.VersionFilter { 83 return nil 84 }