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