Some checks failed
CodeQL / Analyze (push) Waiting to run
Docker Build & Push Simapp (main) / docker-build (push) Waiting to run
golangci-lint / lint (push) Waiting to run
Tests / Code Coverage / build (amd64) (push) Waiting to run
Tests / Code Coverage / build (arm64) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[additional-args:-tags="test_e2e" name:e2e path:./e2e]) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[name:08-wasm path:./modules/light-clients/08-wasm]) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[name:ibc-go path:.]) (push) Waiting to run
Deploy to GitHub Pages / Deploy to GitHub Pages (push) Has been cancelled
Buf-Push / push (push) Has been cancelled
87 lines
2.7 KiB
Go
87 lines
2.7 KiB
Go
package solomachine
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
|
"github.com/spf13/cobra"
|
|
|
|
"cosmossdk.io/core/appmodule"
|
|
|
|
"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"
|
|
)
|
|
|
|
var (
|
|
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
|
|
_ appmodule.AppModule = (*AppModule)(nil)
|
|
)
|
|
|
|
// 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{}
|
|
|
|
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
|
|
func (AppModuleBasic) IsOnePerModuleType() {}
|
|
|
|
// IsAppModule implements the appmodule.AppModule interface.
|
|
func (AppModuleBasic) IsAppModule() {}
|
|
|
|
// Name returns the solo machine module name.
|
|
func (AppModuleBasic) Name() string {
|
|
return ModuleName
|
|
}
|
|
|
|
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
|
|
func (AppModule) IsOnePerModuleType() {}
|
|
|
|
// IsAppModule implements the appmodule.AppModule interface.
|
|
func (AppModule) IsAppModule() {}
|
|
|
|
// 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
|
|
}
|
|
|
|
// AppModule is the application module for the Solomachine client module
|
|
type AppModule struct {
|
|
AppModuleBasic
|
|
lightClientModule LightClientModule
|
|
}
|
|
|
|
// NewAppModule creates a new Solomachine client module
|
|
func NewAppModule(lightClientModule LightClientModule) AppModule {
|
|
return AppModule{
|
|
lightClientModule: lightClientModule,
|
|
}
|
|
}
|