-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
module.go
29 lines (23 loc) · 915 Bytes
/
module.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
package localhost
import (
"fmt"
"github.com/gorilla/mux"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/x/ibc/09-localhost/client/cli"
"github.com/cosmos/cosmos-sdk/x/ibc/09-localhost/client/rest"
"github.com/cosmos/cosmos-sdk/x/ibc/09-localhost/types"
)
// Name returns the IBC client name
func Name() string {
return types.SubModuleName
}
// RegisterRESTRoutes registers the REST routes for the IBC localhost client
func RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router, queryRoute string) {
rest.RegisterRoutes(ctx, rtr, fmt.Sprintf("%s/%s", queryRoute, types.SubModuleName))
}
// GetTxCmd returns the root tx command for the IBC localhost client
func GetTxCmd(cdc *codec.Codec, storeKey string) *cobra.Command {
return cli.GetTxCmd(cdc, fmt.Sprintf("%s/%s", storeKey, types.SubModuleName))
}