feature/implement did state (#15)

* refactor: update model proto

* feat: add status field to Controller

* feat: add Verification.Kind field to state protobuf to support different verification types

* fix: remove QueryService and QueryResolve RPCs from query.proto
This commit is contained in:
Prad Nukala
2024-09-18 17:27:30 -04:00
committed by GitHub
parent 2c1cf56e3c
commit 6d8bd8fc85
18 changed files with 1348 additions and 5998 deletions
-17
View File
@@ -4,7 +4,6 @@ import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/onsonr/sonr/x/did/builder"
"github.com/onsonr/sonr/x/did/types"
"google.golang.org/grpc/peer"
)
@@ -42,19 +41,3 @@ func (c Context) PeerID() string {
}
return c.Peer.Addr.String()
}
func (c Context) GetService(origin string) (*types.Service, error) {
rec, err := c.Keeper.OrmDB.ServiceRecordTable().GetByOrigin(c.SDK(), origin)
if err != nil {
return nil, err
}
return builder.ModuleFormatAPIServiceRecord(rec), nil
}
func (c Context) GetServiceInfo(origin string) *types.ServiceInfo {
rec, _ := c.GetService(origin)
if rec == nil {
return &types.ServiceInfo{Exists: false, Origin: origin, Fingerprint: types.ComputeOriginTXTRecord(origin)}
}
return &types.ServiceInfo{Exists: true, Origin: origin, Fingerprint: types.ComputeOriginTXTRecord(origin), Service: rec}
}