* clear

* feat: Add everything

* fix: Commenht
This commit is contained in:
Prad Nukala
2025-10-03 14:45:52 -04:00
committed by GitHub
parent 43b4a11c06
commit 13e6c3e84d
1935 changed files with 655061 additions and 40058 deletions
Regular → Executable
+22 -5
View File
@@ -1,3 +1,4 @@
// Package module provides the Cosmos SDK implementation for the SVC module.
package module
import (
@@ -18,8 +19,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/sonr-io/snrd/x/svc/keeper"
"github.com/sonr-io/snrd/x/svc/types"
"github.com/sonr-io/sonr/x/svc/keeper"
"github.com/sonr-io/sonr/x/svc/types"
)
const (
@@ -67,7 +68,11 @@ func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
})
}
func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error {
func (a AppModuleBasic) ValidateGenesis(
marshaler codec.JSONCodec,
_ client.TxEncodingConfig,
message json.RawMessage,
) error {
var data types.GenesisState
err := marshaler.UnmarshalJSON(message, &data)
if err != nil {
@@ -83,7 +88,11 @@ func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
}
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
err := types.RegisterQueryHandlerClient(
context.Background(),
mux,
types.NewQueryClient(clientCtx),
)
if err != nil {
// same behavior as in cosmos-sdk
panic(err)
@@ -109,7 +118,11 @@ func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) {
types.RegisterInterfaces(r)
}
func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate {
func (a AppModule) InitGenesis(
ctx sdk.Context,
marshaler codec.JSONCodec,
message json.RawMessage,
) []abci.ValidatorUpdate {
var genesisState types.GenesisState
marshaler.MustUnmarshalJSON(message, &genesisState)
@@ -117,6 +130,10 @@ func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, messa
panic(err)
}
if err := a.keeper.InitGenesis(ctx, &genesisState); err != nil {
panic(err)
}
return nil
}