feature/1110 abstract connected wallet operations (#1166)

- **refactor: refactor DID module types and move to controller package**
- **refactor: move controller creation and resolution logic to keeper**
- **refactor: update imports to reflect controller package move**
- **refactor: update protobuf definitions for DID module**
- **docs: update proto README to reflect changes**
- **refactor: move hway to gateway, update node modules, and refactor
pkl generation**
- **build: update pkl-gen task to use new pkl file paths**
- **refactor: refactor DWN WASM build and deployment process**
- **refactor: refactor DID controller implementation to use
account-based storage**
- **refactor: move DID controller interface to base file and update
implementation**
- **chore: migrate to google protobuf**
- **feat: Add v0.52.0 Interfaces for Acc Abstraction**
- **refactor: replace public_key with public_key_hex in Assertion
message**
- **refactor: remove unused PubKey, JSONWebKey, and RawKey message types
and related code**
This commit is contained in:
Prad Nukala
2024-11-18 19:04:10 -05:00
committed by GitHub
parent 01cb37e82e
commit bf94277b0f
190 changed files with 9345 additions and 14038 deletions
+38 -283
View File
@@ -23,38 +23,13 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type URI_Protocol int32
const (
URI_HTTPS URI_Protocol = 0
URI_IPFS URI_Protocol = 1
)
var URI_Protocol_name = map[int32]string{
0: "HTTPS",
1: "IPFS",
}
var URI_Protocol_value = map[string]int32{
"HTTPS": 0,
"IPFS": 1,
}
func (x URI_Protocol) String() string {
return proto.EnumName(URI_Protocol_name, int32(x))
}
func (URI_Protocol) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_ab6e3654a2974847, []int{2, 0}
}
type Metadata struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
Category string `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"`
Icon *URI `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"`
Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"`
Tags []string `protobuf:"bytes,7,rep,name=tags,proto3" json:"tags,omitempty"`
}
@@ -126,11 +101,11 @@ func (m *Metadata) GetCategory() string {
return ""
}
func (m *Metadata) GetIcon() *URI {
func (m *Metadata) GetIcon() string {
if m != nil {
return m.Icon
}
return nil
return ""
}
func (m *Metadata) GetTags() []string {
@@ -213,96 +188,37 @@ func (m *Profile) GetController() string {
return ""
}
type URI struct {
Protocol URI_Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=service.v1.URI_Protocol" json:"protocol,omitempty"`
Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
}
func (m *URI) Reset() { *m = URI{} }
func (m *URI) String() string { return proto.CompactTextString(m) }
func (*URI) ProtoMessage() {}
func (*URI) Descriptor() ([]byte, []int) {
return fileDescriptor_ab6e3654a2974847, []int{2}
}
func (m *URI) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *URI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_URI.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *URI) XXX_Merge(src proto.Message) {
xxx_messageInfo_URI.Merge(m, src)
}
func (m *URI) XXX_Size() int {
return m.Size()
}
func (m *URI) XXX_DiscardUnknown() {
xxx_messageInfo_URI.DiscardUnknown(m)
}
var xxx_messageInfo_URI proto.InternalMessageInfo
func (m *URI) GetProtocol() URI_Protocol {
if m != nil {
return m.Protocol
}
return URI_HTTPS
}
func (m *URI) GetUri() string {
if m != nil {
return m.Uri
}
return ""
}
func init() {
proto.RegisterEnum("service.v1.URI_Protocol", URI_Protocol_name, URI_Protocol_value)
proto.RegisterType((*Metadata)(nil), "service.v1.Metadata")
proto.RegisterType((*Profile)(nil), "service.v1.Profile")
proto.RegisterType((*URI)(nil), "service.v1.URI")
}
func init() { proto.RegisterFile("service/v1/state.proto", fileDescriptor_ab6e3654a2974847) }
var fileDescriptor_ab6e3654a2974847 = []byte{
// 422 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x52, 0xc1, 0x8e, 0xd3, 0x30,
0x14, 0xac, 0x9b, 0x6c, 0x9b, 0xbe, 0x45, 0x25, 0xb2, 0xd0, 0x62, 0xed, 0xc1, 0x44, 0x05, 0xa1,
0x1e, 0x50, 0xa2, 0x5d, 0x38, 0xed, 0x09, 0x71, 0x40, 0xf4, 0x80, 0x54, 0x65, 0x77, 0x2f, 0xdc,
0x52, 0xd7, 0x14, 0xa3, 0xc4, 0xaf, 0xb2, 0xdd, 0x8a, 0xfd, 0x09, 0x04, 0x3f, 0xc0, 0xf7, 0x70,
0x5c, 0x89, 0x0b, 0x17, 0x24, 0xd4, 0xfe, 0x01, 0x5f, 0x80, 0x62, 0x92, 0x12, 0xb8, 0x58, 0xef,
0xcd, 0x8c, 0x3c, 0x33, 0xb2, 0xe1, 0xc4, 0x4a, 0xb3, 0x55, 0x42, 0x66, 0xdb, 0xb3, 0xcc, 0xba,
0xc2, 0xc9, 0x74, 0x6d, 0xd0, 0x21, 0x85, 0x06, 0x4f, 0xb7, 0x67, 0xa7, 0xf7, 0x05, 0xda, 0x0a,
0x6d, 0x86, 0xa6, 0xaa, 0x65, 0x68, 0xaa, 0x3f, 0xa2, 0xc9, 0x0f, 0x02, 0xd1, 0x6b, 0xe9, 0x8a,
0x65, 0xe1, 0x0a, 0x3a, 0x86, 0xbe, 0x5a, 0x32, 0x92, 0x90, 0x69, 0x98, 0xf7, 0xd5, 0x92, 0x9e,
0xc0, 0x00, 0x8d, 0x5a, 0x29, 0xcd, 0xfa, 0x09, 0x99, 0x8e, 0xf2, 0x66, 0xa3, 0x14, 0x42, 0x5d,
0x54, 0x92, 0x05, 0x1e, 0xf5, 0x33, 0x4d, 0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, 0x08,
0x67, 0xf3, 0x97, 0x97, 0x31, 0x79, 0xf1, 0xfc, 0xeb, 0x8e, 0x93, 0xdb, 0x1d, 0x27, 0x3f, 0x77,
0x9c, 0x7c, 0xda, 0xf3, 0xde, 0xed, 0x9e, 0xf7, 0xbe, 0xef, 0x79, 0xef, 0xcd, 0xe3, 0x95, 0x72,
0xef, 0x36, 0x8b, 0x54, 0x60, 0x95, 0xa1, 0xb6, 0xa8, 0x4d, 0xe6, 0x8f, 0x0f, 0x59, 0xfb, 0xa7,
0xdc, 0xcd, 0x5a, 0xda, 0xc5, 0xc0, 0xdb, 0x3f, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xad,
0x51, 0x19, 0x6b, 0x02, 0x00, 0x00,
// 348 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x6a, 0xe3, 0x30,
0x10, 0x86, 0x23, 0xdb, 0xeb, 0x24, 0xb3, 0x4b, 0x08, 0x62, 0xc9, 0x8a, 0x1c, 0x84, 0x09, 0xcb,
0x92, 0xc3, 0x12, 0x13, 0xf6, 0x96, 0xd3, 0xd2, 0x7b, 0xa1, 0xe4, 0xd8, 0x9b, 0x23, 0xab, 0xae,
0x4a, 0xec, 0x09, 0x92, 0x12, 0x9a, 0x97, 0x28, 0xed, 0x0b, 0xf4, 0x79, 0x7a, 0xe8, 0x21, 0xd0,
0x4b, 0x8f, 0x25, 0x79, 0x83, 0x3e, 0x41, 0x91, 0xe2, 0x14, 0xf7, 0x22, 0x66, 0xfe, 0x19, 0x7e,
0xfd, 0x1f, 0x03, 0x03, 0x23, 0xf5, 0x46, 0x09, 0x99, 0x6e, 0xa6, 0xa9, 0xb1, 0x99, 0x95, 0x93,
0x95, 0x46, 0x8b, 0x14, 0x6a, 0x7d, 0xb2, 0x99, 0x0e, 0x7f, 0x09, 0x34, 0x25, 0x9a, 0x14, 0x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0x6f, 0xed, 0x0e, 0xbc, 0xf5, 0x7a,
0xe0, 0xad, 0xcb, 0x3f, 0x85, 0xb2, 0xd7, 0xeb, 0xc5, 0x44, 0x60, 0x99, 0x62, 0x65, 0xb0, 0xd2,
0xa9, 0x7f, 0x6e, 0xd3, 0xd3, 0x49, 0xed, 0x76, 0x25, 0xcd, 0x22, 0xf6, 0xb7, 0xfa, 0xf7, 0x11,
0x00, 0x00, 0xff, 0xff, 0x81, 0xa0, 0xdf, 0xce, 0xea, 0x01, 0x00, 0x00,
}
func (m *Metadata) Marshal() (dAtA []byte, err error) {
@@ -334,15 +250,10 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
dAtA[i] = 0x3a
}
}
if m.Icon != nil {
{
size, err := m.Icon.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintState(dAtA, i, uint64(size))
}
if len(m.Icon) > 0 {
i -= len(m.Icon)
copy(dAtA[i:], m.Icon)
i = encodeVarintState(dAtA, i, uint64(len(m.Icon)))
i--
dAtA[i] = 0x32
}
@@ -433,41 +344,6 @@ func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *URI) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *URI) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *URI) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Uri) > 0 {
i -= len(m.Uri)
copy(dAtA[i:], m.Uri)
i = encodeVarintState(dAtA, i, uint64(len(m.Uri)))
i--
dAtA[i] = 0x12
}
if m.Protocol != 0 {
i = encodeVarintState(dAtA, i, uint64(m.Protocol))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintState(dAtA []byte, offset int, v uint64) int {
offset -= sovState(v)
base := offset
@@ -504,8 +380,8 @@ func (m *Metadata) Size() (n int) {
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
if m.Icon != nil {
l = m.Icon.Size()
l = len(m.Icon)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
if len(m.Tags) > 0 {
@@ -542,22 +418,6 @@ func (m *Profile) Size() (n int) {
return n
}
func (m *URI) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Protocol != 0 {
n += 1 + sovState(uint64(m.Protocol))
}
l = len(m.Uri)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
return n
}
func sovState(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -744,7 +604,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error {
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType)
}
var msglen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
@@ -754,27 +614,23 @@ func (m *Metadata) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthState
}
postIndex := iNdEx + msglen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Icon == nil {
m.Icon = &URI{}
}
if err := m.Icon.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
m.Icon = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 2 {
@@ -1007,107 +863,6 @@ func (m *Profile) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *URI) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: URI: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: URI: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType)
}
m.Protocol = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Protocol |= URI_Protocol(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Uri = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipState(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthState
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipState(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0