feature/dwn sw js (#1103)

- **feat(macaroon): add  and  to macaroon genesis**
- **refactor: move schema definitions to dedicated file**
- **feat: remove Session model**
- **refactor: move session middleware to internal package**
This commit is contained in:
Prad Nukala
2024-10-02 01:40:49 -04:00
committed by GitHub
parent d62fb30eb8
commit edb109b542
55 changed files with 2472 additions and 543 deletions
+10
View File
@@ -6,10 +6,12 @@ import (
"cosmossdk.io/log"
"cosmossdk.io/orm/model/ormdb"
"github.com/cosmos/cosmos-sdk/codec"
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"
apiv1 "github.com/onsonr/sonr/api/macaroon/v1"
didkeeper "github.com/onsonr/sonr/x/did/keeper"
"github.com/onsonr/sonr/x/macaroon/types"
)
@@ -23,6 +25,9 @@ type Keeper struct {
Params collections.Item[types.Params]
OrmDB apiv1.StateStore
AccountKeeper authkeeper.AccountKeeper
DIDKeeper didkeeper.Keeper
authority string
}
@@ -32,6 +37,8 @@ func NewKeeper(
storeService storetypes.KVStoreService,
logger log.Logger,
authority string,
accKeeper authkeeper.AccountKeeper,
didKeeper didkeeper.Keeper,
) Keeper {
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
@@ -58,6 +65,9 @@ func NewKeeper(
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
OrmDB: store,
AccountKeeper: accKeeper,
DIDKeeper: didKeeper,
authority: authority,
}
+1 -1
View File
@@ -78,7 +78,7 @@ func SetupTest(t *testing.T) *testFixture {
registerBaseSDKModules(f, encCfg, storeService, logger, require)
// Setup Keeper.
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr)
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr, f.accountkeeper, f.didk)
f.msgServer = keeper.NewMsgServerImpl(f.k)
f.queryServer = keeper.NewQuerier(f.k)
f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didk)
-2
View File
@@ -32,13 +32,11 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type
// RefreshToken implements types.QueryServer.
func (k Querier) RefreshToken(goCtx context.Context, req *types.QueryRefreshTokenRequest) (*types.QueryRefreshTokenResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("RefreshToken is unimplemented")
return &types.QueryRefreshTokenResponse{}, nil
}
// ValidateToken implements types.QueryServer.
func (k Querier) ValidateToken(goCtx context.Context, req *types.QueryValidateTokenRequest) (*types.QueryValidateTokenResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("ValidateToken is unimplemented")
return &types.QueryValidateTokenResponse{}, nil
}
+1 -3
View File
@@ -3,9 +3,9 @@ package keeper
import (
"context"
"cosmossdk.io/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"cosmossdk.io/errors"
"github.com/onsonr/sonr/x/macaroon/types"
)
@@ -31,13 +31,11 @@ func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams
// AuthorizeService implements types.MsgServer.
func (ms msgServer) AuthorizeService(ctx context.Context, msg *types.MsgIssueMacaroon) (*types.MsgIssueMacaroonResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("AuthorizeService is unimplemented")
return &types.MsgIssueMacaroonResponse{}, nil
}
// IssueMacaroon implements types.MsgServer.
func (ms msgServer) IssueMacaroon(ctx context.Context, msg *types.MsgIssueMacaroon) (*types.MsgIssueMacaroonResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("IssueMacaroon is unimplemented")
return &types.MsgIssueMacaroonResponse{}, nil
}