feature/did accounts (#23)

* feat: add support for DID number as primary key for Controllers

* refactor: rename pkg/proxy to app/proxy

* feat: add vault module keeper tests

* feat(vault): add DID keeper to vault module

* refactor: move vault client code to its own package

* refactor(vault): extract schema definition

* refactor: use vaulttypes for MsgAllocateVault

* refactor: update vault assembly logic to use new methods

* feat: add dwn-proxy command

* refactor: remove unused context.go file

* refactor: remove unused web-related code

* feat: add DWN proxy server

* feat: add BuildTx RPC to vault module

* fix: Implement BuildTx endpoint

* feat: add devbox integration to project
This commit is contained in:
Prad Nukala
2024-09-25 19:45:28 -04:00
committed by GitHub
parent 97b3f9836a
commit 60c48d2409
216 changed files with 18162 additions and 9232 deletions
+6 -32
View File
@@ -4,9 +4,8 @@ import (
"context"
"cosmossdk.io/log"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ipfs/boxo/path"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/onsonr/sonr/x/did/types"
)
@@ -32,41 +31,16 @@ func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
}
// this line is used by starport scaffolding # genesis/module/export
return &types.GenesisState{
Params: params,
}
}
// CheckValidatorExists checks if a validator exists
func (k Keeper) CheckValidatorExists(ctx sdk.Context, addr string) bool {
address, err := sdk.ValAddressFromBech32(addr)
// CurrentSchema returns the current schema
func (k Keeper) CurrentParams(ctx sdk.Context) (*types.Params, error) {
p, err := k.Params.Get(ctx)
if err != nil {
return false
return nil, err
}
ok, err := k.StakingKeeper.Validator(ctx, address)
if err != nil {
return false
}
if ok != nil {
return true
}
return false
}
// HasPathInIPFS checks if a file is in the local IPFS node
func (k Keeper) HasPathInIPFS(ctx sdk.Context, cid string) (bool, error) {
path, err := path.NewPath(cid)
if err != nil {
return false, err
}
v, err := k.ipfsClient.Unixfs().Get(ctx, path)
if err != nil {
return false, err
}
if v == nil {
return false, nil
}
return true, nil
return &p, nil
}