-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add AppModuleBasic for solo machine client (#2826)
feat: add `AppModuleBasic` for the 06-solomachine client and remove solo machine type registration from core IBC. Chains must register the `AppModuleBasic` of light clients.
- Loading branch information
1 parent
83f1cd1
commit 13e0c57
Showing
5 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,56 @@ | ||
package solomachine | ||
|
||
// Name returns the solo machine client name. | ||
func Name() string { | ||
import ( | ||
"encoding/json" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
"github.com/grpc-ecosystem/grpc-gateway/runtime" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var _ module.AppModuleBasic = AppModuleBasic{} | ||
|
||
// AppModuleBasic defines the basic application module used by the solo machine light client. | ||
// Only the RegisterInterfaces function needs to be implemented. All other function perform | ||
// a no-op. | ||
type AppModuleBasic struct{} | ||
|
||
// Name returns the solo machine module name. | ||
func (AppModuleBasic) Name() string { | ||
return SubModuleName | ||
} | ||
|
||
// RegisterLegacyAminoCodec performs a no-op. The solo machine client does not support amino. | ||
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {} | ||
|
||
// RegisterInterfaces registers module concrete types into protobuf Any. This allows core IBC | ||
// to unmarshal solo machine types. | ||
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { | ||
RegisterInterfaces(registry) | ||
} | ||
|
||
// DefaultGenesis performs a no-op. Genesis is not supported for solo machine. | ||
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { | ||
return nil | ||
} | ||
|
||
// ValidateGenesis performs a no-op. Genesis is not supported for solo machine. | ||
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { | ||
return nil | ||
} | ||
|
||
// RegisterGRPCGatewayRoutes performs a no-op. | ||
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {} | ||
|
||
// GetTxCmd performs a no-op. Please see the 02-client cli commands. | ||
func (AppModuleBasic) GetTxCmd() *cobra.Command { | ||
return nil | ||
} | ||
|
||
// GetQueryCmd performs a no-op. Please see the 02-client cli commands. | ||
func (AppModuleBasic) GetQueryCmd() *cobra.Command { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters