feat: add initial DID implementation

This commit is contained in:
Prad Nukala
2024-09-05 18:37:38 -04:00
parent 3fd84dbdda
commit b3b176a25d
35 changed files with 1073 additions and 14 deletions
+4 -1
View File
@@ -9,6 +9,7 @@ import (
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
stakkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
apiv1 "github.com/onsonr/sonr/api/did/v1"
"github.com/onsonr/sonr/x/did/types"
@@ -26,12 +27,13 @@ type Keeper struct {
Schema collections.Schema
AccountKeeper authkeeper.AccountKeeper
StakingKeeper *stakkeeper.Keeper
authority string
}
// NewKeeper creates a new poa Keeper instance
func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, accKeeper authkeeper.AccountKeeper, logger log.Logger, authority string) Keeper {
func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, accKeeper authkeeper.AccountKeeper, stkKeeper *stakkeeper.Keeper, logger log.Logger, authority string) Keeper {
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
sb := collections.NewSchemaBuilder(storeService)
if authority == "" {
@@ -52,6 +54,7 @@ func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, ac
authority: authority,
OrmDB: store,
AccountKeeper: accKeeper,
StakingKeeper: stkKeeper,
}
schema, err := sb.Build()
if err != nil {