mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
fix: Add ProveWitness and SyncVault RPCs
The commit message should be: feat: Add ProveWitness and SyncVault RPCs This change adds two new RPCs to the DID module: 1. ProveWitness: An operation to prove the controller has a valid property using ZK Accumulators. 2. SyncVault: Synchronizes the controller with the Vault Motr DWN WASM Wallet. These new RPCs allow for more advanced DID management functionality.
This commit is contained in:
parent
2923b8866b
commit
68104f985b
File diff suppressed because it is too large
Load Diff
@ -21,6 +21,8 @@ const _ = grpc.SupportPackageIsVersion7
|
|||||||
const (
|
const (
|
||||||
Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams"
|
Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams"
|
||||||
Msg_Authenticate_FullMethodName = "/did.v1.Msg/Authenticate"
|
Msg_Authenticate_FullMethodName = "/did.v1.Msg/Authenticate"
|
||||||
|
Msg_ProveWitness_FullMethodName = "/did.v1.Msg/ProveWitness"
|
||||||
|
Msg_SyncVault_FullMethodName = "/did.v1.Msg/SyncVault"
|
||||||
Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController"
|
Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController"
|
||||||
Msg_RegisterService_FullMethodName = "/did.v1.Msg/RegisterService"
|
Msg_RegisterService_FullMethodName = "/did.v1.Msg/RegisterService"
|
||||||
)
|
)
|
||||||
@ -35,6 +37,10 @@ type MsgClient interface {
|
|||||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||||
// Authenticate asserts the given controller is the owner of the given address.
|
// Authenticate asserts the given controller is the owner of the given address.
|
||||||
Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error)
|
Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error)
|
||||||
|
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators.
|
||||||
|
ProveWitness(ctx context.Context, in *MsgProveWitness, opts ...grpc.CallOption) (*MsgProveWitnessResponse, error)
|
||||||
|
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
|
||||||
|
SyncVault(ctx context.Context, in *MsgSyncVault, opts ...grpc.CallOption) (*MsgSyncVaultResponse, error)
|
||||||
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
|
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
|
||||||
RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error)
|
RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error)
|
||||||
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
|
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
|
||||||
@ -67,6 +73,24 @@ func (c *msgClient) Authenticate(ctx context.Context, in *MsgAuthenticate, opts
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *msgClient) ProveWitness(ctx context.Context, in *MsgProveWitness, opts ...grpc.CallOption) (*MsgProveWitnessResponse, error) {
|
||||||
|
out := new(MsgProveWitnessResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Msg_ProveWitness_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *msgClient) SyncVault(ctx context.Context, in *MsgSyncVault, opts ...grpc.CallOption) (*MsgSyncVaultResponse, error) {
|
||||||
|
out := new(MsgSyncVaultResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Msg_SyncVault_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *msgClient) RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error) {
|
func (c *msgClient) RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error) {
|
||||||
out := new(MsgRegisterControllerResponse)
|
out := new(MsgRegisterControllerResponse)
|
||||||
err := c.cc.Invoke(ctx, Msg_RegisterController_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, Msg_RegisterController_FullMethodName, in, out, opts...)
|
||||||
@ -95,6 +119,10 @@ type MsgServer interface {
|
|||||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||||
// Authenticate asserts the given controller is the owner of the given address.
|
// Authenticate asserts the given controller is the owner of the given address.
|
||||||
Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error)
|
Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error)
|
||||||
|
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators.
|
||||||
|
ProveWitness(context.Context, *MsgProveWitness) (*MsgProveWitnessResponse, error)
|
||||||
|
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
|
||||||
|
SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error)
|
||||||
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
|
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
|
||||||
RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error)
|
RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error)
|
||||||
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
|
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
|
||||||
@ -112,6 +140,12 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*
|
|||||||
func (UnimplementedMsgServer) Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) {
|
func (UnimplementedMsgServer) Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedMsgServer) ProveWitness(context.Context, *MsgProveWitness) (*MsgProveWitnessResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ProveWitness not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMsgServer) SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method SyncVault not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedMsgServer) RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error) {
|
func (UnimplementedMsgServer) RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method RegisterController not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method RegisterController not implemented")
|
||||||
}
|
}
|
||||||
@ -167,6 +201,42 @@ func _Msg_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(in
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Msg_ProveWitness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MsgProveWitness)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MsgServer).ProveWitness(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Msg_ProveWitness_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MsgServer).ProveWitness(ctx, req.(*MsgProveWitness))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Msg_SyncVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MsgSyncVault)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MsgServer).SyncVault(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Msg_SyncVault_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MsgServer).SyncVault(ctx, req.(*MsgSyncVault))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _Msg_RegisterController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Msg_RegisterController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(MsgRegisterController)
|
in := new(MsgRegisterController)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -218,6 +288,14 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "Authenticate",
|
MethodName: "Authenticate",
|
||||||
Handler: _Msg_Authenticate_Handler,
|
Handler: _Msg_Authenticate_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ProveWitness",
|
||||||
|
Handler: _Msg_ProveWitness_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "SyncVault",
|
||||||
|
Handler: _Msg_SyncVault_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "RegisterController",
|
MethodName: "RegisterController",
|
||||||
Handler: _Msg_RegisterController_Handler,
|
Handler: _Msg_RegisterController_Handler,
|
||||||
|
@ -20,6 +20,12 @@ service Msg {
|
|||||||
// Authenticate asserts the given controller is the owner of the given address.
|
// Authenticate asserts the given controller is the owner of the given address.
|
||||||
rpc Authenticate(MsgAuthenticate) returns (MsgAuthenticateResponse);
|
rpc Authenticate(MsgAuthenticate) returns (MsgAuthenticateResponse);
|
||||||
|
|
||||||
|
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators.
|
||||||
|
rpc ProveWitness(MsgProveWitness) returns (MsgProveWitnessResponse);
|
||||||
|
|
||||||
|
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
|
||||||
|
rpc SyncVault(MsgSyncVault) returns (MsgSyncVaultResponse);
|
||||||
|
|
||||||
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
|
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
|
||||||
rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse);
|
rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse);
|
||||||
|
|
||||||
@ -68,6 +74,45 @@ message MsgAuthenticate {
|
|||||||
// MsgAuthenticateResponse is the response type for the Authenticate RPC.
|
// MsgAuthenticateResponse is the response type for the Authenticate RPC.
|
||||||
message MsgAuthenticateResponse {}
|
message MsgAuthenticateResponse {}
|
||||||
|
|
||||||
|
// MsgProveWitness is the message type for the ProveWitness RPC.
|
||||||
|
message MsgProveWitness {
|
||||||
|
option (cosmos.msg.v1.signer) = "authority";
|
||||||
|
|
||||||
|
// authority is the address of the governance account.
|
||||||
|
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||||
|
|
||||||
|
// property is key to prove.
|
||||||
|
string property = 2;
|
||||||
|
|
||||||
|
// Witness Value is the bytes of the witness.
|
||||||
|
bytes witness = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgProveWitnessResponse is the response type for the ProveWitness RPC.
|
||||||
|
message MsgProveWitnessResponse {
|
||||||
|
bool success = 1;
|
||||||
|
string property = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgSyncVault is the message type for the SyncVault RPC.
|
||||||
|
message MsgSyncVault {
|
||||||
|
option (cosmos.msg.v1.signer) = "controller";
|
||||||
|
|
||||||
|
// controller is the address of the controller to sync.
|
||||||
|
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||||
|
|
||||||
|
// cid is the IPFS content identifier.
|
||||||
|
string cid = 2;
|
||||||
|
|
||||||
|
// Macroon is the public token to authenticate the operation.
|
||||||
|
bytes macron = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgSyncVaultResponse is the response type for the SyncVault RPC.
|
||||||
|
message MsgSyncVaultResponse {
|
||||||
|
bool success = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// MsgRegisterController is the message type for the InitializeController RPC.
|
// MsgRegisterController is the message type for the InitializeController RPC.
|
||||||
message MsgRegisterController {
|
message MsgRegisterController {
|
||||||
option (cosmos.msg.v1.signer) = "authority";
|
option (cosmos.msg.v1.signer) = "authority";
|
||||||
|
@ -61,3 +61,15 @@ func (ms msgServer) RegisterService(ctx context.Context, msg *types.MsgRegisterS
|
|||||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
return &types.MsgRegisterServiceResponse{}, nil
|
return &types.MsgRegisterServiceResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProveWitness implements types.MsgServer.
|
||||||
|
func (ms msgServer) ProveWitness(ctx context.Context, msg *types.MsgProveWitness) (*types.MsgProveWitnessResponse, error) {
|
||||||
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
|
return &types.MsgProveWitnessResponse{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SyncVault implements types.MsgServer.
|
||||||
|
func (ms msgServer) SyncVault(ctx context.Context, msg *types.MsgSyncVault) (*types.MsgSyncVaultResponse, error) {
|
||||||
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
|
return &types.MsgSyncVaultResponse{}, nil
|
||||||
|
}
|
||||||
|
1107
x/did/types/tx.pb.go
1107
x/did/types/tx.pb.go
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user