mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
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:
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user