mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feature/1214 session fetch refactor (#1215)
* chore(docs): remove token economy guide * refactor(context): update GatewayContext to use Querier interface * chore(database): update schema path * docs: Update READMEs for x/did, x/dwn, and x/svc with UCAN integration * chore(pkg): update database scope name * refactor(did): optimize GenesisState proto methods * refactor(svc): update Service proto to use repeated fields * refactor(api): rename MsgSpawn to MsgInitialize
This commit is contained in:
@@ -14,10 +14,10 @@ import (
|
||||
|
||||
type GatewayContext struct {
|
||||
echo.Context
|
||||
*hwayorm.Queries
|
||||
agent useragent.UserAgent
|
||||
hwayorm.Querier
|
||||
id string
|
||||
ipfsClient common.IPFS
|
||||
agent useragent.UserAgent
|
||||
tokenStore common.IPFSTokenStore
|
||||
stagedEnclaves map[string]mpc.Enclave
|
||||
grpcAddr string
|
||||
@@ -38,12 +38,12 @@ func UseGateway(env hway.Hway, ipc common.IPFS, db *hwayorm.Queries) echo.Middle
|
||||
ua := useragent.NewParser()
|
||||
ctx := &GatewayContext{
|
||||
Context: c,
|
||||
turnstileSiteKey: env.GetTurnstileSiteKey(),
|
||||
agent: ua.Parse(c.Request().UserAgent()),
|
||||
Queries: db,
|
||||
Querier: db,
|
||||
ipfsClient: ipc,
|
||||
agent: ua.Parse(c.Request().UserAgent()),
|
||||
grpcAddr: env.GetSonrGrpcUrl(),
|
||||
tokenStore: common.NewUCANStore(ipc),
|
||||
turnstileSiteKey: env.GetTurnstileSiteKey(),
|
||||
}
|
||||
return next(ctx)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func UpdateProfile(c echo.Context) (*hwayorm.Profile, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &profile, nil
|
||||
return profile, nil
|
||||
}
|
||||
|
||||
func ReadProfile(c echo.Context) (*hwayorm.Profile, error) {
|
||||
@@ -36,7 +36,7 @@ func ReadProfile(c echo.Context) (*hwayorm.Profile, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &profile, nil
|
||||
return profile, nil
|
||||
}
|
||||
|
||||
func DeleteProfile(c echo.Context) error {
|
||||
|
||||
@@ -32,7 +32,7 @@ func (c *CredentialDescriptor) ToModel(handle, origin string) *hwayorm.Credentia
|
||||
}
|
||||
}
|
||||
|
||||
func CredentialArrayToDescriptors(credentials []hwayorm.Credential) []*CredentialDescriptor {
|
||||
func CredentialArrayToDescriptors(credentials []*hwayorm.Credential) []*CredentialDescriptor {
|
||||
var descriptors []*CredentialDescriptor
|
||||
for _, cred := range credentials {
|
||||
cd := &CredentialDescriptor{
|
||||
|
||||
Reference in New Issue
Block a user