diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..daf54b777 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,15 @@ +FROM jetpackio/devbox:latest + +# Installing your devbox project +WORKDIR /code +USER root:root +RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code +USER ${DEVBOX_USER}:${DEVBOX_USER} +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock + + + +RUN devbox run -- echo "Installed Packages." + +RUN devbox shellenv --init-hook >> ~/.profile diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..e7ae9f11f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,16 @@ +{ + "name": "Devbox Remote Container", + "build": { + "dockerfile": "./Dockerfile", + "context": ".." + }, + "customizations": { + "vscode": { + "settings": {}, + "extensions": [ + "jetpack-io.devbox" + ] + } + }, + "remoteUser": "devbox" +} \ No newline at end of file diff --git a/.github/workflows/testnet-self-hosted.yml.optional b/.github/workflows/testnet-self-hosted.yml.optional deleted file mode 100644 index c1ea3cf56..000000000 --- a/.github/workflows/testnet-self-hosted.yml.optional +++ /dev/null @@ -1,65 +0,0 @@ -name: self-hosted testnet - -# -# Setup a runner on your own hardware or in a public cloud like GCP, Hetzner, etc. -# This is required if your chain is closed source but you want a dev/semi-public testnet -# - https://github.com///settings/actions/runners/new?arch=x64&os=linux -# - -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc - -env: - GO_VERSION: 1.21.0 - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - LOCALIC_PORT: 8080 - LOCALIC_AUTH_KEY: "" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - launch-testnet: - runs-on: self-hosted - steps: - - uses: actions/checkout@v3 - - - name: Setup System - run: | - sudo apt-get update - sudo DEBIAN_FRONTEND=noninteractive apt -y install make gcc jq bison ca-certificates curl - - wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz - sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz - echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc - export PATH=$PATH:/usr/local/go/bin - - sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y containerd.io || true - sudo DEBIAN_FRONTEND=noninteractive apt-get -y install docker.io docker-compose - sudo apt-get update - - wget https://github.com/strangelove-ventures/interchaintest/releases/download/v8.2.0/local-ic && chmod +x local-ic - sudo mv local-ic /usr/local/bin - - git clone https://github.com/strangelove-ventures/heighliner.git && cd heighliner - go build && chmod +x heighliner - sudo mv heighliner /usr/local/bin - cd .. && rm -rf heighliner - - - name: Build + Run Testnet - run: | - killall local-ic || true - docker kill $(docker ps -q) || true - - export PATH=$PATH:/usr/local/go/bin - - make local-image - - sudo screen -S testnet-${{ github.ref_name }} -d -m local-ic start ibc-testnet --api-address=0.0.0.0 --api-port=${{ env.LOCALIC_PORT }} --auth-key=${{ env.LOCALIC_AUTH_KEY }} - - # Add other commands here you perform for setup once local-ic has started (poll on LOCALIC_PORT) such as contract upload. - diff --git a/Makefile b/Makefile index 99733b555..80290c607 100644 --- a/Makefile +++ b/Makefile @@ -301,11 +301,7 @@ sh-testnet: mod-tidy dwn: @echo "(dwn) Building dwn.wasm -> IPFS Vault" - GOOS=js GOARCH=wasm go build -o ./pkg/vault/app.wasm ./internal/dwn/main.go - -motr: - @echo "(web) Building app.wasm -> Deploy to Cloudflare Workers" - GOOS=js GOARCH=wasm go build -o ./pkg/proxy/build/app.wasm ./pkg/proxy/main.go + GOOS=js GOARCH=wasm go build -o ./x/vault/internal/app.wasm ./x/vault/client/dwn/main.go templ: @echo "(templ) Generating templ files" @@ -316,8 +312,6 @@ pkl: @echo "(pkl) Building PKL" go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/dwn.pkl go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/orm.pkl - go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/web.pkl - go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/txns.pkl air: @echo "(air) Building air" diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index 2185cd597..e8adfa436 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -591,60 +591,58 @@ func (x *_Params_2_map) IsValid() bool { return x.m != nil } -var _ protoreflect.List = (*_Params_6_list)(nil) +var _ protoreflect.List = (*_Params_4_list)(nil) -type _Params_6_list struct { +type _Params_4_list struct { list *[]string } -func (x *_Params_6_list) Len() int { +func (x *_Params_4_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Params_6_list) Get(i int) protoreflect.Value { +func (x *_Params_4_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Params_6_list) Set(i int, value protoreflect.Value) { +func (x *_Params_4_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Params_6_list) Append(value protoreflect.Value) { +func (x *_Params_4_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Params_6_list) AppendMutable() protoreflect.Value { +func (x *_Params_4_list) AppendMutable() protoreflect.Value { panic(fmt.Errorf("AppendMutable can not be called on message Params at list field AttestationFormats as it is not of Message kind")) } -func (x *_Params_6_list) Truncate(n int) { +func (x *_Params_4_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Params_6_list) NewElement() protoreflect.Value { +func (x *_Params_4_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_Params_6_list) IsValid() bool { +func (x *_Params_4_list) IsValid() bool { return x.list != nil } var ( - md_Params protoreflect.MessageDescriptor - fd_Params_whitelisted_assets protoreflect.FieldDescriptor - fd_Params_allowed_public_keys protoreflect.FieldDescriptor - fd_Params_ipfs_active protoreflect.FieldDescriptor - fd_Params_localhost_registration_enabled protoreflect.FieldDescriptor - fd_Params_conveyance_preference protoreflect.FieldDescriptor - fd_Params_attestation_formats protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_whitelisted_assets protoreflect.FieldDescriptor + fd_Params_allowed_public_keys protoreflect.FieldDescriptor + fd_Params_conveyance_preference protoreflect.FieldDescriptor + fd_Params_attestation_formats protoreflect.FieldDescriptor ) func init() { @@ -652,8 +650,6 @@ func init() { md_Params = File_did_v1_genesis_proto.Messages().ByName("Params") fd_Params_whitelisted_assets = md_Params.Fields().ByName("whitelisted_assets") fd_Params_allowed_public_keys = md_Params.Fields().ByName("allowed_public_keys") - fd_Params_ipfs_active = md_Params.Fields().ByName("ipfs_active") - fd_Params_localhost_registration_enabled = md_Params.Fields().ByName("localhost_registration_enabled") fd_Params_conveyance_preference = md_Params.Fields().ByName("conveyance_preference") fd_Params_attestation_formats = md_Params.Fields().ByName("attestation_formats") } @@ -735,18 +731,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if x.IpfsActive != false { - value := protoreflect.ValueOfBool(x.IpfsActive) - if !f(fd_Params_ipfs_active, value) { - return - } - } - if x.LocalhostRegistrationEnabled != false { - value := protoreflect.ValueOfBool(x.LocalhostRegistrationEnabled) - if !f(fd_Params_localhost_registration_enabled, value) { - return - } - } if x.ConveyancePreference != "" { value := protoreflect.ValueOfString(x.ConveyancePreference) if !f(fd_Params_conveyance_preference, value) { @@ -754,7 +738,7 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto } } if len(x.AttestationFormats) != 0 { - value := protoreflect.ValueOfList(&_Params_6_list{list: &x.AttestationFormats}) + value := protoreflect.ValueOfList(&_Params_4_list{list: &x.AttestationFormats}) if !f(fd_Params_attestation_formats, value) { return } @@ -778,10 +762,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return len(x.WhitelistedAssets) != 0 case "did.v1.Params.allowed_public_keys": return len(x.AllowedPublicKeys) != 0 - case "did.v1.Params.ipfs_active": - return x.IpfsActive != false - case "did.v1.Params.localhost_registration_enabled": - return x.LocalhostRegistrationEnabled != false case "did.v1.Params.conveyance_preference": return x.ConveyancePreference != "" case "did.v1.Params.attestation_formats": @@ -806,10 +786,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.WhitelistedAssets = nil case "did.v1.Params.allowed_public_keys": x.AllowedPublicKeys = nil - case "did.v1.Params.ipfs_active": - x.IpfsActive = false - case "did.v1.Params.localhost_registration_enabled": - x.LocalhostRegistrationEnabled = false case "did.v1.Params.conveyance_preference": x.ConveyancePreference = "" case "did.v1.Params.attestation_formats": @@ -842,20 +818,14 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro } mapValue := &_Params_2_map{m: &x.AllowedPublicKeys} return protoreflect.ValueOfMap(mapValue) - case "did.v1.Params.ipfs_active": - value := x.IpfsActive - return protoreflect.ValueOfBool(value) - case "did.v1.Params.localhost_registration_enabled": - value := x.LocalhostRegistrationEnabled - return protoreflect.ValueOfBool(value) case "did.v1.Params.conveyance_preference": value := x.ConveyancePreference return protoreflect.ValueOfString(value) case "did.v1.Params.attestation_formats": if len(x.AttestationFormats) == 0 { - return protoreflect.ValueOfList(&_Params_6_list{}) + return protoreflect.ValueOfList(&_Params_4_list{}) } - listValue := &_Params_6_list{list: &x.AttestationFormats} + listValue := &_Params_4_list{list: &x.AttestationFormats} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -885,15 +855,11 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto mv := value.Map() cmv := mv.(*_Params_2_map) x.AllowedPublicKeys = *cmv.m - case "did.v1.Params.ipfs_active": - x.IpfsActive = value.Bool() - case "did.v1.Params.localhost_registration_enabled": - x.LocalhostRegistrationEnabled = value.Bool() case "did.v1.Params.conveyance_preference": x.ConveyancePreference = value.Interface().(string) case "did.v1.Params.attestation_formats": lv := value.List() - clv := lv.(*_Params_6_list) + clv := lv.(*_Params_4_list) x.AttestationFormats = *clv.list default: if fd.IsExtension() { @@ -931,12 +897,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore if x.AttestationFormats == nil { x.AttestationFormats = []string{} } - value := &_Params_6_list{list: &x.AttestationFormats} + value := &_Params_4_list{list: &x.AttestationFormats} return protoreflect.ValueOfList(value) - case "did.v1.Params.ipfs_active": - panic(fmt.Errorf("field ipfs_active of message did.v1.Params is not mutable")) - case "did.v1.Params.localhost_registration_enabled": - panic(fmt.Errorf("field localhost_registration_enabled of message did.v1.Params is not mutable")) case "did.v1.Params.conveyance_preference": panic(fmt.Errorf("field conveyance_preference of message did.v1.Params is not mutable")) default: @@ -958,15 +920,11 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor case "did.v1.Params.allowed_public_keys": m := make(map[string]*KeyInfo) return protoreflect.ValueOfMap(&_Params_2_map{m: &m}) - case "did.v1.Params.ipfs_active": - return protoreflect.ValueOfBool(false) - case "did.v1.Params.localhost_registration_enabled": - return protoreflect.ValueOfBool(false) case "did.v1.Params.conveyance_preference": return protoreflect.ValueOfString("") case "did.v1.Params.attestation_formats": list := []string{} - return protoreflect.ValueOfList(&_Params_6_list{list: &list}) + return protoreflect.ValueOfList(&_Params_4_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -1068,12 +1026,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } } - if x.IpfsActive { - n += 2 - } - if x.LocalhostRegistrationEnabled { - n += 2 - } l = len(x.ConveyancePreference) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -1119,7 +1071,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.AttestationFormats[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationFormats[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x22 } } if len(x.ConveyancePreference) > 0 { @@ -1127,27 +1079,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.ConveyancePreference) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConveyancePreference))) i-- - dAtA[i] = 0x2a - } - if x.LocalhostRegistrationEnabled { - i-- - if x.LocalhostRegistrationEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if x.IpfsActive { - i-- - if x.IpfsActive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } if len(x.AllowedPublicKeys) > 0 { MaRsHaLmAp := func(k string, v *KeyInfo) (protoiface.MarshalOutput, error) { @@ -1428,46 +1360,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { x.AllowedPublicKeys[mapkey] = mapvalue iNdEx = postIndex case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.IpfsActive = bool(v != 0) - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.LocalhostRegistrationEnabled = bool(v != 0) - case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) } @@ -1499,7 +1391,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.ConveyancePreference = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType) } @@ -6975,14 +6867,10 @@ type Params struct { WhitelistedAssets []*AssetInfo `protobuf:"bytes,1,rep,name=whitelisted_assets,json=whitelistedAssets,proto3" json:"whitelisted_assets,omitempty"` // Whitelisted Key Types AllowedPublicKeys map[string]*KeyInfo `protobuf:"bytes,2,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // IpfsActive is a flag to enable/disable ipfs - IpfsActive bool `protobuf:"varint,3,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` - // Localhost Registration Enabled - LocalhostRegistrationEnabled bool `protobuf:"varint,4,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` // ConveyancePreference defines the conveyance preference - ConveyancePreference string `protobuf:"bytes,5,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + ConveyancePreference string `protobuf:"bytes,3,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` // AttestationFormats defines the attestation formats - AttestationFormats []string `protobuf:"bytes,6,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` + AttestationFormats []string `protobuf:"bytes,4,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` } func (x *Params) Reset() { @@ -7019,20 +6907,6 @@ func (x *Params) GetAllowedPublicKeys() map[string]*KeyInfo { return nil } -func (x *Params) GetIpfsActive() bool { - if x != nil { - return x.IpfsActive - } - return false -} - -func (x *Params) GetLocalhostRegistrationEnabled() bool { - if x != nil { - return x.LocalhostRegistrationEnabled - } - return false -} - func (x *Params) GetConveyancePreference() string { if x != nil { return x.ConveyancePreference @@ -7222,8 +7096,9 @@ type KeyInfo struct { Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` // e.g., "ES256", "EdDSA", "ES256K" Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` // e.g., "hex", "base64", "multibase" - Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" - Type_ string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" + Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448", + // "Ed25519", "Ed448", "secp256k1" + Type_ string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" } func (x *KeyInfo) Reset() { @@ -7536,7 +7411,7 @@ var file_did_v1_genesis_proto_rawDesc = []byte{ 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xde, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf7, 0x02, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, @@ -7546,116 +7421,110 @@ var file_did_v1_genesis_proto_rawDesc = []byte{ 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x70, 0x66, - 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, 0x0a, 0x1e, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x1c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x12, 0x33, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x14, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x1a, 0x55, 0x0a, 0x16, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, - 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x6f, 0x6e, + 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, + 0x0a, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x1a, + 0x55, 0x0a, 0x16, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, + 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0x99, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x72, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x68, 0x72, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1d, 0x0a, + 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x22, 0x91, 0x02, 0x0a, 0x08, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, + 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, + 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, + 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, + 0x81, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x72, + 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, + 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, + 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, + 0x76, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, + 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x2e, 0x4a, 0x57, 0x4b, + 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03, 0x4a, 0x57, 0x4b, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x76, + 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, + 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0xb1, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x17, 0x98, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x64, 0x69, 0x64, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x72, - 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x72, 0x70, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, - 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, - 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, - 0x72, 0x6c, 0x22, 0x91, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, - 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, - 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x06, 0x50, - 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, - 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, - 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, - 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, - 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, - 0x4b, 0x65, 0x79, 0x2e, 0x4a, 0x57, 0x4b, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03, - 0x4a, 0x57, 0x4b, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, - 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, - 0xb1, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0b, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x43, - 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, - 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, - 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, - 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x7c, 0x0a, 0x0a, + 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, + 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, + 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, + 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index 1a3a88011..a41f9f858 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -625,638 +625,6 @@ func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { } } -var ( - md_QueryResponse protoreflect.MessageDescriptor - fd_QueryResponse_success protoreflect.FieldDescriptor - fd_QueryResponse_query protoreflect.FieldDescriptor - fd_QueryResponse_document protoreflect.FieldDescriptor - fd_QueryResponse_params protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryResponse = File_did_v1_query_proto.Messages().ByName("QueryResponse") - fd_QueryResponse_success = md_QueryResponse.Fields().ByName("success") - fd_QueryResponse_query = md_QueryResponse.Fields().ByName("query") - fd_QueryResponse_document = md_QueryResponse.Fields().ByName("document") - fd_QueryResponse_params = md_QueryResponse.Fields().ByName("params") -} - -var _ protoreflect.Message = (*fastReflection_QueryResponse)(nil) - -type fastReflection_QueryResponse QueryResponse - -func (x *QueryResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryResponse)(x) -} - -func (x *QueryResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryResponse_messageType fastReflection_QueryResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryResponse_messageType{} - -type fastReflection_QueryResponse_messageType struct{} - -func (x fastReflection_QueryResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryResponse)(nil) -} -func (x fastReflection_QueryResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryResponse) -} -func (x fastReflection_QueryResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryResponse) New() protoreflect.Message { - return new(fastReflection_QueryResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryResponse) Interface() protoreflect.ProtoMessage { - return (*QueryResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Success != false { - value := protoreflect.ValueOfBool(x.Success) - if !f(fd_QueryResponse_success, value) { - return - } - } - if x.Query != "" { - value := protoreflect.ValueOfString(x.Query) - if !f(fd_QueryResponse_query, value) { - return - } - } - if x.Document != nil { - value := protoreflect.ValueOfMessage(x.Document.ProtoReflect()) - if !f(fd_QueryResponse_document, value) { - return - } - } - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_QueryResponse_params, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryResponse.success": - return x.Success != false - case "did.v1.QueryResponse.query": - return x.Query != "" - case "did.v1.QueryResponse.document": - return x.Document != nil - case "did.v1.QueryResponse.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) - } - panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryResponse.success": - x.Success = false - case "did.v1.QueryResponse.query": - x.Query = "" - case "did.v1.QueryResponse.document": - x.Document = nil - case "did.v1.QueryResponse.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) - } - panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryResponse.success": - value := x.Success - return protoreflect.ValueOfBool(value) - case "did.v1.QueryResponse.query": - value := x.Query - return protoreflect.ValueOfString(value) - case "did.v1.QueryResponse.document": - value := x.Document - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.QueryResponse.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) - } - panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryResponse.success": - x.Success = value.Bool() - case "did.v1.QueryResponse.query": - x.Query = value.Interface().(string) - case "did.v1.QueryResponse.document": - x.Document = value.Message().Interface().(*Document) - case "did.v1.QueryResponse.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) - } - panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryResponse.document": - if x.Document == nil { - x.Document = new(Document) - } - return protoreflect.ValueOfMessage(x.Document.ProtoReflect()) - case "did.v1.QueryResponse.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "did.v1.QueryResponse.success": - panic(fmt.Errorf("field success of message did.v1.QueryResponse is not mutable")) - case "did.v1.QueryResponse.query": - panic(fmt.Errorf("field query of message did.v1.QueryResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) - } - panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryResponse.success": - return protoreflect.ValueOfBool(false) - case "did.v1.QueryResponse.query": - return protoreflect.ValueOfString("") - case "did.v1.QueryResponse.document": - m := new(Document) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.QueryResponse.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) - } - panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Success { - n += 2 - } - l = len(x.Query) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Document != nil { - l = options.Size(x.Document) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x2a - } - if x.Document != nil { - encoded, err := options.Marshal(x.Document) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - if len(x.Query) > 0 { - i -= len(x.Query) - copy(dAtA[i:], x.Query) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Query))) - i-- - dAtA[i] = 0x12 - } - if x.Success { - i-- - if x.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Success = bool(v != 0) - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Document == nil { - x.Document = &Document{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Document); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - var ( md_QueryParamsResponse protoreflect.MessageDescriptor fd_QueryParamsResponse_params protoreflect.FieldDescriptor @@ -1277,7 +645,7 @@ func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { } func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[2] + mi := &file_did_v1_query_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1712,7 +1080,7 @@ func (x *QueryResolveResponse) ProtoReflect() protoreflect.Message { } func (x *QueryResolveResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[3] + mi := &file_did_v1_query_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2127,836 +1495,6 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } } -var ( - md_SyncRequest protoreflect.MessageDescriptor - fd_SyncRequest_did protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_SyncRequest = File_did_v1_query_proto.Messages().ByName("SyncRequest") - fd_SyncRequest_did = md_SyncRequest.Fields().ByName("did") -} - -var _ protoreflect.Message = (*fastReflection_SyncRequest)(nil) - -type fastReflection_SyncRequest SyncRequest - -func (x *SyncRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_SyncRequest)(x) -} - -func (x *SyncRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_SyncRequest_messageType fastReflection_SyncRequest_messageType -var _ protoreflect.MessageType = fastReflection_SyncRequest_messageType{} - -type fastReflection_SyncRequest_messageType struct{} - -func (x fastReflection_SyncRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_SyncRequest)(nil) -} -func (x fastReflection_SyncRequest_messageType) New() protoreflect.Message { - return new(fastReflection_SyncRequest) -} -func (x fastReflection_SyncRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_SyncRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_SyncRequest) Descriptor() protoreflect.MessageDescriptor { - return md_SyncRequest -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_SyncRequest) Type() protoreflect.MessageType { - return _fastReflection_SyncRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_SyncRequest) New() protoreflect.Message { - return new(fastReflection_SyncRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_SyncRequest) Interface() protoreflect.ProtoMessage { - return (*SyncRequest)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_SyncRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_SyncRequest_did, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_SyncRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.SyncRequest.did": - return x.Did != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncRequest")) - } - panic(fmt.Errorf("message did.v1.SyncRequest does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SyncRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.SyncRequest.did": - x.Did = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncRequest")) - } - panic(fmt.Errorf("message did.v1.SyncRequest does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_SyncRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.SyncRequest.did": - value := x.Did - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncRequest")) - } - panic(fmt.Errorf("message did.v1.SyncRequest does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SyncRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.SyncRequest.did": - x.Did = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncRequest")) - } - panic(fmt.Errorf("message did.v1.SyncRequest does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SyncRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.SyncRequest.did": - panic(fmt.Errorf("field did of message did.v1.SyncRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncRequest")) - } - panic(fmt.Errorf("message did.v1.SyncRequest does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_SyncRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.SyncRequest.did": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncRequest")) - } - panic(fmt.Errorf("message did.v1.SyncRequest does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_SyncRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.SyncRequest", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_SyncRequest) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SyncRequest) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_SyncRequest) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_SyncRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*SyncRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Did) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*SyncRequest) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Did) > 0 { - i -= len(x.Did) - copy(dAtA[i:], x.Did) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*SyncRequest) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SyncRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SyncRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Did = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_SyncResponse protoreflect.MessageDescriptor - fd_SyncResponse_success protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_SyncResponse = File_did_v1_query_proto.Messages().ByName("SyncResponse") - fd_SyncResponse_success = md_SyncResponse.Fields().ByName("success") -} - -var _ protoreflect.Message = (*fastReflection_SyncResponse)(nil) - -type fastReflection_SyncResponse SyncResponse - -func (x *SyncResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_SyncResponse)(x) -} - -func (x *SyncResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_SyncResponse_messageType fastReflection_SyncResponse_messageType -var _ protoreflect.MessageType = fastReflection_SyncResponse_messageType{} - -type fastReflection_SyncResponse_messageType struct{} - -func (x fastReflection_SyncResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_SyncResponse)(nil) -} -func (x fastReflection_SyncResponse_messageType) New() protoreflect.Message { - return new(fastReflection_SyncResponse) -} -func (x fastReflection_SyncResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_SyncResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_SyncResponse) Descriptor() protoreflect.MessageDescriptor { - return md_SyncResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_SyncResponse) Type() protoreflect.MessageType { - return _fastReflection_SyncResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_SyncResponse) New() protoreflect.Message { - return new(fastReflection_SyncResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_SyncResponse) Interface() protoreflect.ProtoMessage { - return (*SyncResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_SyncResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Success != false { - value := protoreflect.ValueOfBool(x.Success) - if !f(fd_SyncResponse_success, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_SyncResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.SyncResponse.success": - return x.Success != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncResponse")) - } - panic(fmt.Errorf("message did.v1.SyncResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SyncResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.SyncResponse.success": - x.Success = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncResponse")) - } - panic(fmt.Errorf("message did.v1.SyncResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_SyncResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.SyncResponse.success": - value := x.Success - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncResponse")) - } - panic(fmt.Errorf("message did.v1.SyncResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SyncResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.SyncResponse.success": - x.Success = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncResponse")) - } - panic(fmt.Errorf("message did.v1.SyncResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SyncResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.SyncResponse.success": - panic(fmt.Errorf("field success of message did.v1.SyncResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncResponse")) - } - panic(fmt.Errorf("message did.v1.SyncResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_SyncResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.SyncResponse.success": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.SyncResponse")) - } - panic(fmt.Errorf("message did.v1.SyncResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_SyncResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.SyncResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_SyncResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SyncResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_SyncResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_SyncResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*SyncResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Success { - n += 2 - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*SyncResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Success { - i-- - if x.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*SyncResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SyncResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SyncResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Success = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -3030,66 +1568,6 @@ func (x *QueryRequest) GetAsset() string { return "" } -// QueryResolveResponse is the response type for the Query/Resolve RPC method. -type QueryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - Document *Document `protobuf:"bytes,3,opt,name=document,proto3" json:"document,omitempty"` - Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *QueryResponse) Reset() { - *x = QueryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryResponse) ProtoMessage() {} - -// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. -func (*QueryResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{1} -} - -func (x *QueryResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *QueryResponse) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *QueryResponse) GetDocument() *Document { - if x != nil { - return x.Document - } - return nil -} - -func (x *QueryResponse) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - // QueryParamsResponse is the response type for the Query/Params RPC method. type QueryParamsResponse struct { state protoimpl.MessageState @@ -3103,7 +1581,7 @@ type QueryParamsResponse struct { func (x *QueryParamsResponse) Reset() { *x = QueryParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[2] + mi := &file_did_v1_query_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3117,7 +1595,7 @@ func (*QueryParamsResponse) ProtoMessage() {} // Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{2} + return file_did_v1_query_proto_rawDescGZIP(), []int{1} } func (x *QueryParamsResponse) GetParams() *Params { @@ -3140,7 +1618,7 @@ type QueryResolveResponse struct { func (x *QueryResolveResponse) Reset() { *x = QueryResolveResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[3] + mi := &file_did_v1_query_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3154,7 +1632,7 @@ func (*QueryResolveResponse) ProtoMessage() {} // Deprecated: Use QueryResolveResponse.ProtoReflect.Descriptor instead. func (*QueryResolveResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{3} + return file_did_v1_query_proto_rawDescGZIP(), []int{2} } func (x *QueryResolveResponse) GetDocument() *Document { @@ -3164,78 +1642,6 @@ func (x *QueryResolveResponse) GetDocument() *Document { return nil } -// SyncRequest is the request type for the Sync RPC method. -type SyncRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` -} - -func (x *SyncRequest) Reset() { - *x = SyncRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SyncRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncRequest) ProtoMessage() {} - -// Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead. -func (*SyncRequest) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{4} -} - -func (x *SyncRequest) GetDid() string { - if x != nil { - return x.Did - } - return "" -} - -// SyncResponse is the response type for the Sync RPC method. -type SyncResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` -} - -func (x *SyncResponse) Reset() { - *x = SyncResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SyncResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncResponse) ProtoMessage() {} - -// Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead. -func (*SyncResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{5} -} - -func (x *SyncResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - var File_did_v1_query_proto protoreflect.FileDescriptor var file_did_v1_query_proto_rawDesc = []byte{ @@ -3250,52 +1656,34 @@ var file_did_v1_query_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, - 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x3d, 0x0a, 0x13, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x44, 0x0a, 0x14, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, - 0x1f, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, - 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, - 0x22, 0x28, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xea, 0x01, 0x0a, 0x05, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x4c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x51, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x64, 0x69, 0x64, 0x2f, - 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x13, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, - 0x22, 0x05, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, - 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, - 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x22, 0x3d, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x22, 0x44, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0xa8, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x4c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x51, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x7b, 0x64, 0x69, + 0x64, 0x7d, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, + 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, + 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, + 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3310,33 +1698,26 @@ func file_did_v1_query_proto_rawDescGZIP() []byte { return file_did_v1_query_proto_rawDescData } -var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_did_v1_query_proto_goTypes = []interface{}{ (*QueryRequest)(nil), // 0: did.v1.QueryRequest - (*QueryResponse)(nil), // 1: did.v1.QueryResponse - (*QueryParamsResponse)(nil), // 2: did.v1.QueryParamsResponse - (*QueryResolveResponse)(nil), // 3: did.v1.QueryResolveResponse - (*SyncRequest)(nil), // 4: did.v1.SyncRequest - (*SyncResponse)(nil), // 5: did.v1.SyncResponse - (*Document)(nil), // 6: did.v1.Document - (*Params)(nil), // 7: did.v1.Params + (*QueryParamsResponse)(nil), // 1: did.v1.QueryParamsResponse + (*QueryResolveResponse)(nil), // 2: did.v1.QueryResolveResponse + (*Params)(nil), // 3: did.v1.Params + (*Document)(nil), // 4: did.v1.Document } var file_did_v1_query_proto_depIdxs = []int32{ - 6, // 0: did.v1.QueryResponse.document:type_name -> did.v1.Document - 7, // 1: did.v1.QueryResponse.params:type_name -> did.v1.Params - 7, // 2: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params - 6, // 3: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document - 0, // 4: did.v1.Query.Params:input_type -> did.v1.QueryRequest - 0, // 5: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest - 4, // 6: did.v1.Query.Sync:input_type -> did.v1.SyncRequest - 2, // 7: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse - 3, // 8: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse - 5, // 9: did.v1.Query.Sync:output_type -> did.v1.SyncResponse - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 3, // 0: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params + 4, // 1: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document + 0, // 2: did.v1.Query.Params:input_type -> did.v1.QueryRequest + 0, // 3: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest + 1, // 4: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse + 2, // 5: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_did_v1_query_proto_init() } @@ -3359,18 +1740,6 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsResponse); i { case 0: return &v.state @@ -3382,7 +1751,7 @@ func file_did_v1_query_proto_init() { return nil } } - file_did_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryResolveResponse); i { case 0: return &v.state @@ -3394,30 +1763,6 @@ func file_did_v1_query_proto_init() { return nil } } - file_did_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3425,7 +1770,7 @@ func file_did_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 3, NumExtensions: 0, NumServices: 1, }, diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index 77258f332..60ab53114 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -21,7 +21,6 @@ const _ = grpc.SupportPackageIsVersion7 const ( Query_Params_FullMethodName = "/did.v1.Query/Params" Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" - Query_Sync_FullMethodName = "/did.v1.Query/Sync" ) // QueryClient is the client API for Query service. @@ -32,8 +31,6 @@ type QueryClient interface { Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) - // Sync queries the DID document by its id. And returns the required PKL information - Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) } type queryClient struct { @@ -62,15 +59,6 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } -func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) { - out := new(SyncResponse) - err := c.cc.Invoke(ctx, Query_Sync_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -79,8 +67,6 @@ type QueryServer interface { Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) - // Sync queries the DID document by its id. And returns the required PKL information - Sync(context.Context, *SyncRequest) (*SyncResponse, error) mustEmbedUnimplementedQueryServer() } @@ -94,9 +80,6 @@ func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryPa func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } -func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") -} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -146,24 +129,6 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SyncRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Sync(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Sync_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Sync(ctx, req.(*SyncRequest)) - } - return interceptor(ctx, in, info, handler) -} - // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -179,10 +144,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Resolve", Handler: _Query_Resolve_Handler, }, - { - MethodName: "Sync", - Handler: _Query_Sync_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "did/v1/query.proto", diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index e7589f1e8..bc858ea6c 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -168,12 +168,14 @@ func NewAliasTable(db ormtable.Schema) (AliasTable, error) { type ControllerTable interface { Insert(ctx context.Context, controller *Controller) error + InsertReturningNumber(ctx context.Context, controller *Controller) (uint64, error) + LastInsertedSequence(ctx context.Context) (uint64, error) Update(ctx context.Context, controller *Controller) error Save(ctx context.Context, controller *Controller) error Delete(ctx context.Context, controller *Controller) error - Has(ctx context.Context, id string) (found bool, err error) + Has(ctx context.Context, number uint64) (found bool, err error) // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id string) (*Controller, error) + Get(ctx context.Context, number uint64) (*Controller, error) HasBySonrAddress(ctx context.Context, sonr_address string) (found bool, err error) // GetBySonrAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. GetBySonrAddress(ctx context.Context, sonr_address string) (*Controller, error) @@ -183,12 +185,9 @@ type ControllerTable interface { HasByBtcAddress(ctx context.Context, btc_address string) (found bool, err error) // GetByBtcAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. GetByBtcAddress(ctx context.Context, btc_address string) (*Controller, error) - HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) - // GetByVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) - HasByStatusVaultCid(ctx context.Context, status string, vault_cid string) (found bool, err error) - // GetByStatusVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByStatusVaultCid(ctx context.Context, status string, vault_cid string) (*Controller, error) + HasByDid(ctx context.Context, did string) (found bool, err error) + // GetByDid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByDid(ctx context.Context, did string) (*Controller, error) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) ListRange(ctx context.Context, from, to ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) DeleteBy(ctx context.Context, prefixKey ControllerIndexKey) error @@ -214,18 +213,18 @@ type ControllerIndexKey interface { } // primary key starting index.. -type ControllerPrimaryKey = ControllerIdIndexKey +type ControllerPrimaryKey = ControllerNumberIndexKey -type ControllerIdIndexKey struct { +type ControllerNumberIndexKey struct { vs []interface{} } -func (x ControllerIdIndexKey) id() uint32 { return 0 } -func (x ControllerIdIndexKey) values() []interface{} { return x.vs } -func (x ControllerIdIndexKey) controllerIndexKey() {} +func (x ControllerNumberIndexKey) id() uint32 { return 0 } +func (x ControllerNumberIndexKey) values() []interface{} { return x.vs } +func (x ControllerNumberIndexKey) controllerIndexKey() {} -func (this ControllerIdIndexKey) WithId(id string) ControllerIdIndexKey { - this.vs = []interface{}{id} +func (this ControllerNumberIndexKey) WithNumber(number uint64) ControllerNumberIndexKey { + this.vs = []interface{}{number} return this } @@ -268,39 +267,21 @@ func (this ControllerBtcAddressIndexKey) WithBtcAddress(btc_address string) Cont return this } -type ControllerVaultCidIndexKey struct { +type ControllerDidIndexKey struct { vs []interface{} } -func (x ControllerVaultCidIndexKey) id() uint32 { return 4 } -func (x ControllerVaultCidIndexKey) values() []interface{} { return x.vs } -func (x ControllerVaultCidIndexKey) controllerIndexKey() {} +func (x ControllerDidIndexKey) id() uint32 { return 4 } +func (x ControllerDidIndexKey) values() []interface{} { return x.vs } +func (x ControllerDidIndexKey) controllerIndexKey() {} -func (this ControllerVaultCidIndexKey) WithVaultCid(vault_cid string) ControllerVaultCidIndexKey { - this.vs = []interface{}{vault_cid} - return this -} - -type ControllerStatusVaultCidIndexKey struct { - vs []interface{} -} - -func (x ControllerStatusVaultCidIndexKey) id() uint32 { return 5 } -func (x ControllerStatusVaultCidIndexKey) values() []interface{} { return x.vs } -func (x ControllerStatusVaultCidIndexKey) controllerIndexKey() {} - -func (this ControllerStatusVaultCidIndexKey) WithStatus(status string) ControllerStatusVaultCidIndexKey { - this.vs = []interface{}{status} - return this -} - -func (this ControllerStatusVaultCidIndexKey) WithStatusVaultCid(status string, vault_cid string) ControllerStatusVaultCidIndexKey { - this.vs = []interface{}{status, vault_cid} +func (this ControllerDidIndexKey) WithDid(did string) ControllerDidIndexKey { + this.vs = []interface{}{did} return this } type controllerTable struct { - table ormtable.Table + table ormtable.AutoIncrementTable } func (this controllerTable) Insert(ctx context.Context, controller *Controller) error { @@ -319,13 +300,21 @@ func (this controllerTable) Delete(ctx context.Context, controller *Controller) return this.table.Delete(ctx, controller) } -func (this controllerTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) +func (this controllerTable) InsertReturningNumber(ctx context.Context, controller *Controller) (uint64, error) { + return this.table.InsertReturningPKey(ctx, controller) } -func (this controllerTable) Get(ctx context.Context, id string) (*Controller, error) { +func (this controllerTable) LastInsertedSequence(ctx context.Context) (uint64, error) { + return this.table.LastInsertedSequence(ctx) +} + +func (this controllerTable) Has(ctx context.Context, number uint64) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, number) +} + +func (this controllerTable) Get(ctx context.Context, number uint64) (*Controller, error) { var controller Controller - found, err := this.table.PrimaryKey().Get(ctx, &controller, id) + found, err := this.table.PrimaryKey().Get(ctx, &controller, number) if err != nil { return nil, err } @@ -395,38 +384,16 @@ func (this controllerTable) GetByBtcAddress(ctx context.Context, btc_address str return &controller, nil } -func (this controllerTable) HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) { +func (this controllerTable) HasByDid(ctx context.Context, did string) (found bool, err error) { return this.table.GetIndexByID(4).(ormtable.UniqueIndex).Has(ctx, - vault_cid, + did, ) } -func (this controllerTable) GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) { +func (this controllerTable) GetByDid(ctx context.Context, did string) (*Controller, error) { var controller Controller found, err := this.table.GetIndexByID(4).(ormtable.UniqueIndex).Get(ctx, &controller, - vault_cid, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &controller, nil -} - -func (this controllerTable) HasByStatusVaultCid(ctx context.Context, status string, vault_cid string) (found bool, err error) { - return this.table.GetIndexByID(5).(ormtable.UniqueIndex).Has(ctx, - status, - vault_cid, - ) -} - -func (this controllerTable) GetByStatusVaultCid(ctx context.Context, status string, vault_cid string) (*Controller, error) { - var controller Controller - found, err := this.table.GetIndexByID(5).(ormtable.UniqueIndex).Get(ctx, &controller, - status, - vault_cid, + did, ) if err != nil { return nil, err @@ -464,7 +431,7 @@ func NewControllerTable(db ormtable.Schema) (ControllerTable, error) { if table == nil { return nil, ormerrors.TableNotFound.Wrap(string((&Controller{}).ProtoReflect().Descriptor().FullName())) } - return controllerTable{table}, nil + return controllerTable{table.(ormtable.AutoIncrementTable)}, nil } type VerificationTable interface { @@ -472,9 +439,9 @@ type VerificationTable interface { Update(ctx context.Context, verification *Verification) error Save(ctx context.Context, verification *Verification) error Delete(ctx context.Context, verification *Verification) error - Has(ctx context.Context, id string) (found bool, err error) + Has(ctx context.Context, did string) (found bool, err error) // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id string) (*Verification, error) + Get(ctx context.Context, did string) (*Verification, error) HasByIssuerSubject(ctx context.Context, issuer string, subject string) (found bool, err error) // GetByIssuerSubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. GetByIssuerSubject(ctx context.Context, issuer string, subject string) (*Verification, error) @@ -509,18 +476,18 @@ type VerificationIndexKey interface { } // primary key starting index.. -type VerificationPrimaryKey = VerificationIdIndexKey +type VerificationPrimaryKey = VerificationDidIndexKey -type VerificationIdIndexKey struct { +type VerificationDidIndexKey struct { vs []interface{} } -func (x VerificationIdIndexKey) id() uint32 { return 0 } -func (x VerificationIdIndexKey) values() []interface{} { return x.vs } -func (x VerificationIdIndexKey) verificationIndexKey() {} +func (x VerificationDidIndexKey) id() uint32 { return 0 } +func (x VerificationDidIndexKey) values() []interface{} { return x.vs } +func (x VerificationDidIndexKey) verificationIndexKey() {} -func (this VerificationIdIndexKey) WithId(id string) VerificationIdIndexKey { - this.vs = []interface{}{id} +func (this VerificationDidIndexKey) WithDid(did string) VerificationDidIndexKey { + this.vs = []interface{}{did} return this } @@ -608,13 +575,13 @@ func (this verificationTable) Delete(ctx context.Context, verification *Verifica return this.table.Delete(ctx, verification) } -func (this verificationTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) +func (this verificationTable) Has(ctx context.Context, did string) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, did) } -func (this verificationTable) Get(ctx context.Context, id string) (*Verification, error) { +func (this verificationTable) Get(ctx context.Context, did string) (*Verification, error) { var verification Verification - found, err := this.table.PrimaryKey().Get(ctx, &verification, id) + found, err := this.table.PrimaryKey().Get(ctx, &verification, did) if err != nil { return nil, err } diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index 3d0e07460..169e13e73 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -561,123 +561,29 @@ func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_Controller_5_list)(nil) - -type _Controller_5_list struct { - list *[]string -} - -func (x *_Controller_5_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Controller_5_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Controller_5_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Controller_5_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Controller_5_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Controller at list field Aliases as it is not of Message kind")) -} - -func (x *_Controller_5_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Controller_5_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Controller_5_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Controller_8_list)(nil) - -type _Controller_8_list struct { - list *[]string -} - -func (x *_Controller_8_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Controller_8_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Controller_8_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Controller_8_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Controller_8_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Controller at list field Authentication as it is not of Message kind")) -} - -func (x *_Controller_8_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Controller_8_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Controller_8_list) IsValid() bool { - return x.list != nil -} - var ( - md_Controller protoreflect.MessageDescriptor - fd_Controller_id protoreflect.FieldDescriptor - fd_Controller_sonr_address protoreflect.FieldDescriptor - fd_Controller_eth_address protoreflect.FieldDescriptor - fd_Controller_btc_address protoreflect.FieldDescriptor - fd_Controller_aliases protoreflect.FieldDescriptor - fd_Controller_public_key protoreflect.FieldDescriptor - fd_Controller_vault_cid protoreflect.FieldDescriptor - fd_Controller_authentication protoreflect.FieldDescriptor - fd_Controller_status protoreflect.FieldDescriptor + md_Controller protoreflect.MessageDescriptor + fd_Controller_number protoreflect.FieldDescriptor + fd_Controller_did protoreflect.FieldDescriptor + fd_Controller_sonr_address protoreflect.FieldDescriptor + fd_Controller_eth_address protoreflect.FieldDescriptor + fd_Controller_btc_address protoreflect.FieldDescriptor + fd_Controller_public_key protoreflect.FieldDescriptor + fd_Controller_ks_val protoreflect.FieldDescriptor + fd_Controller_claimed protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() md_Controller = File_did_v1_state_proto.Messages().ByName("Controller") - fd_Controller_id = md_Controller.Fields().ByName("id") + fd_Controller_number = md_Controller.Fields().ByName("number") + fd_Controller_did = md_Controller.Fields().ByName("did") fd_Controller_sonr_address = md_Controller.Fields().ByName("sonr_address") fd_Controller_eth_address = md_Controller.Fields().ByName("eth_address") fd_Controller_btc_address = md_Controller.Fields().ByName("btc_address") - fd_Controller_aliases = md_Controller.Fields().ByName("aliases") fd_Controller_public_key = md_Controller.Fields().ByName("public_key") - fd_Controller_vault_cid = md_Controller.Fields().ByName("vault_cid") - fd_Controller_authentication = md_Controller.Fields().ByName("authentication") - fd_Controller_status = md_Controller.Fields().ByName("status") + fd_Controller_ks_val = md_Controller.Fields().ByName("ks_val") + fd_Controller_claimed = md_Controller.Fields().ByName("claimed") } var _ protoreflect.Message = (*fastReflection_Controller)(nil) @@ -745,9 +651,15 @@ func (x *fastReflection_Controller) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Controller_id, value) { + if x.Number != uint64(0) { + value := protoreflect.ValueOfUint64(x.Number) + if !f(fd_Controller_number, value) { + return + } + } + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_Controller_did, value) { return } } @@ -769,33 +681,21 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p return } } - if len(x.Aliases) != 0 { - value := protoreflect.ValueOfList(&_Controller_5_list{list: &x.Aliases}) - if !f(fd_Controller_aliases, value) { - return - } - } - if x.PublicKey != nil { - value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) if !f(fd_Controller_public_key, value) { return } } - if x.VaultCid != "" { - value := protoreflect.ValueOfString(x.VaultCid) - if !f(fd_Controller_vault_cid, value) { + if x.KsVal != "" { + value := protoreflect.ValueOfString(x.KsVal) + if !f(fd_Controller_ks_val, value) { return } } - if len(x.Authentication) != 0 { - value := protoreflect.ValueOfList(&_Controller_8_list{list: &x.Authentication}) - if !f(fd_Controller_authentication, value) { - return - } - } - if x.Status != "" { - value := protoreflect.ValueOfString(x.Status) - if !f(fd_Controller_status, value) { + if x.Claimed != false { + value := protoreflect.ValueOfBool(x.Claimed) + if !f(fd_Controller_claimed, value) { return } } @@ -814,24 +714,22 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p // a repeated field is populated if it is non-empty. func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Controller.id": - return x.Id != "" + case "did.v1.Controller.number": + return x.Number != uint64(0) + case "did.v1.Controller.did": + return x.Did != "" case "did.v1.Controller.sonr_address": return x.SonrAddress != "" case "did.v1.Controller.eth_address": return x.EthAddress != "" case "did.v1.Controller.btc_address": return x.BtcAddress != "" - case "did.v1.Controller.aliases": - return len(x.Aliases) != 0 case "did.v1.Controller.public_key": - return x.PublicKey != nil - case "did.v1.Controller.vault_cid": - return x.VaultCid != "" - case "did.v1.Controller.authentication": - return len(x.Authentication) != 0 - case "did.v1.Controller.status": - return x.Status != "" + return len(x.PublicKey) != 0 + case "did.v1.Controller.ks_val": + return x.KsVal != "" + case "did.v1.Controller.claimed": + return x.Claimed != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -848,24 +746,22 @@ func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Controller.id": - x.Id = "" + case "did.v1.Controller.number": + x.Number = uint64(0) + case "did.v1.Controller.did": + x.Did = "" case "did.v1.Controller.sonr_address": x.SonrAddress = "" case "did.v1.Controller.eth_address": x.EthAddress = "" case "did.v1.Controller.btc_address": x.BtcAddress = "" - case "did.v1.Controller.aliases": - x.Aliases = nil case "did.v1.Controller.public_key": x.PublicKey = nil - case "did.v1.Controller.vault_cid": - x.VaultCid = "" - case "did.v1.Controller.authentication": - x.Authentication = nil - case "did.v1.Controller.status": - x.Status = "" + case "did.v1.Controller.ks_val": + x.KsVal = "" + case "did.v1.Controller.claimed": + x.Claimed = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -882,8 +778,11 @@ func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Controller.id": - value := x.Id + case "did.v1.Controller.number": + value := x.Number + return protoreflect.ValueOfUint64(value) + case "did.v1.Controller.did": + value := x.Did return protoreflect.ValueOfString(value) case "did.v1.Controller.sonr_address": value := x.SonrAddress @@ -894,27 +793,15 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) case "did.v1.Controller.btc_address": value := x.BtcAddress return protoreflect.ValueOfString(value) - case "did.v1.Controller.aliases": - if len(x.Aliases) == 0 { - return protoreflect.ValueOfList(&_Controller_5_list{}) - } - listValue := &_Controller_5_list{list: &x.Aliases} - return protoreflect.ValueOfList(listValue) case "did.v1.Controller.public_key": value := x.PublicKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.Controller.vault_cid": - value := x.VaultCid - return protoreflect.ValueOfString(value) - case "did.v1.Controller.authentication": - if len(x.Authentication) == 0 { - return protoreflect.ValueOfList(&_Controller_8_list{}) - } - listValue := &_Controller_8_list{list: &x.Authentication} - return protoreflect.ValueOfList(listValue) - case "did.v1.Controller.status": - value := x.Status + return protoreflect.ValueOfBytes(value) + case "did.v1.Controller.ks_val": + value := x.KsVal return protoreflect.ValueOfString(value) + case "did.v1.Controller.claimed": + value := x.Claimed + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -935,28 +822,22 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Controller.id": - x.Id = value.Interface().(string) + case "did.v1.Controller.number": + x.Number = value.Uint() + case "did.v1.Controller.did": + x.Did = value.Interface().(string) case "did.v1.Controller.sonr_address": x.SonrAddress = value.Interface().(string) case "did.v1.Controller.eth_address": x.EthAddress = value.Interface().(string) case "did.v1.Controller.btc_address": x.BtcAddress = value.Interface().(string) - case "did.v1.Controller.aliases": - lv := value.List() - clv := lv.(*_Controller_5_list) - x.Aliases = *clv.list case "did.v1.Controller.public_key": - x.PublicKey = value.Message().Interface().(*PubKey) - case "did.v1.Controller.vault_cid": - x.VaultCid = value.Interface().(string) - case "did.v1.Controller.authentication": - lv := value.List() - clv := lv.(*_Controller_8_list) - x.Authentication = *clv.list - case "did.v1.Controller.status": - x.Status = value.Interface().(string) + x.PublicKey = value.Bytes() + case "did.v1.Controller.ks_val": + x.KsVal = value.Interface().(string) + case "did.v1.Controller.claimed": + x.Claimed = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -977,35 +858,22 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Controller.aliases": - if x.Aliases == nil { - x.Aliases = []string{} - } - value := &_Controller_5_list{list: &x.Aliases} - return protoreflect.ValueOfList(value) - case "did.v1.Controller.public_key": - if x.PublicKey == nil { - x.PublicKey = new(PubKey) - } - return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - case "did.v1.Controller.authentication": - if x.Authentication == nil { - x.Authentication = []string{} - } - value := &_Controller_8_list{list: &x.Authentication} - return protoreflect.ValueOfList(value) - case "did.v1.Controller.id": - panic(fmt.Errorf("field id of message did.v1.Controller is not mutable")) + case "did.v1.Controller.number": + panic(fmt.Errorf("field number of message did.v1.Controller is not mutable")) + case "did.v1.Controller.did": + panic(fmt.Errorf("field did of message did.v1.Controller is not mutable")) case "did.v1.Controller.sonr_address": panic(fmt.Errorf("field sonr_address of message did.v1.Controller is not mutable")) case "did.v1.Controller.eth_address": panic(fmt.Errorf("field eth_address of message did.v1.Controller is not mutable")) case "did.v1.Controller.btc_address": panic(fmt.Errorf("field btc_address of message did.v1.Controller is not mutable")) - case "did.v1.Controller.vault_cid": - panic(fmt.Errorf("field vault_cid of message did.v1.Controller is not mutable")) - case "did.v1.Controller.status": - panic(fmt.Errorf("field status of message did.v1.Controller is not mutable")) + case "did.v1.Controller.public_key": + panic(fmt.Errorf("field public_key of message did.v1.Controller is not mutable")) + case "did.v1.Controller.ks_val": + panic(fmt.Errorf("field ks_val of message did.v1.Controller is not mutable")) + case "did.v1.Controller.claimed": + panic(fmt.Errorf("field claimed of message did.v1.Controller is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1019,7 +887,9 @@ func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) pro // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Controller) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Controller.id": + case "did.v1.Controller.number": + return protoreflect.ValueOfUint64(uint64(0)) + case "did.v1.Controller.did": return protoreflect.ValueOfString("") case "did.v1.Controller.sonr_address": return protoreflect.ValueOfString("") @@ -1027,19 +897,12 @@ func (x *fastReflection_Controller) NewField(fd protoreflect.FieldDescriptor) pr return protoreflect.ValueOfString("") case "did.v1.Controller.btc_address": return protoreflect.ValueOfString("") - case "did.v1.Controller.aliases": - list := []string{} - return protoreflect.ValueOfList(&_Controller_5_list{list: &list}) case "did.v1.Controller.public_key": - m := new(PubKey) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.Controller.vault_cid": - return protoreflect.ValueOfString("") - case "did.v1.Controller.authentication": - list := []string{} - return protoreflect.ValueOfList(&_Controller_8_list{list: &list}) - case "did.v1.Controller.status": + return protoreflect.ValueOfBytes(nil) + case "did.v1.Controller.ks_val": return protoreflect.ValueOfString("") + case "did.v1.Controller.claimed": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1109,7 +972,10 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Id) + if x.Number != 0 { + n += 1 + runtime.Sov(uint64(x.Number)) + } + l = len(x.Did) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1125,30 +991,17 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Aliases) > 0 { - for _, s := range x.Aliases { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.PublicKey != nil { - l = options.Size(x.PublicKey) - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.VaultCid) + l = len(x.PublicKey) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Authentication) > 0 { - for _, s := range x.Authentication { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.Status) + l = len(x.KsVal) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.Claimed { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1178,79 +1031,62 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Status) > 0 { - i -= len(x.Status) - copy(dAtA[i:], x.Status) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Status))) + if x.Claimed { i-- - dAtA[i] = 0x4a - } - if len(x.Authentication) > 0 { - for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Authentication[iNdEx]) - copy(dAtA[i:], x.Authentication[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authentication[iNdEx]))) - i-- - dAtA[i] = 0x42 + if x.Claimed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x40 } - if len(x.VaultCid) > 0 { - i -= len(x.VaultCid) - copy(dAtA[i:], x.VaultCid) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VaultCid))) + if len(x.KsVal) > 0 { + i -= len(x.KsVal) + copy(dAtA[i:], x.KsVal) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KsVal))) i-- dAtA[i] = 0x3a } - if x.PublicKey != nil { - encoded, err := options.Marshal(x.PublicKey) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) i-- dAtA[i] = 0x32 } - if len(x.Aliases) > 0 { - for iNdEx := len(x.Aliases) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Aliases[iNdEx]) - copy(dAtA[i:], x.Aliases[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Aliases[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } if len(x.BtcAddress) > 0 { i -= len(x.BtcAddress) copy(dAtA[i:], x.BtcAddress) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BtcAddress))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } if len(x.EthAddress) > 0 { i -= len(x.EthAddress) copy(dAtA[i:], x.EthAddress) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthAddress))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(x.SonrAddress) > 0 { i -= len(x.SonrAddress) copy(dAtA[i:], x.SonrAddress) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SonrAddress))) i-- + dAtA[i] = 0x1a + } + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + i-- dAtA[i] = 0x12 } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + if x.Number != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Number)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -1302,8 +1138,27 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + x.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Number |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1331,9 +1186,9 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Id = string(dAtA[iNdEx:postIndex]) + x.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SonrAddress", wireType) } @@ -1365,7 +1220,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } x.SonrAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthAddress", wireType) } @@ -1397,7 +1252,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } x.EthAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BtcAddress", wireType) } @@ -1429,43 +1284,11 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } x.BtcAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Aliases = append(x.Aliases, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1475,31 +1298,29 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } + x.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) if x.PublicKey == nil { - x.PublicKey = &PubKey{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + x.PublicKey = []byte{} } iNdEx = postIndex case 7: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VaultCid", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KsVal", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1527,13 +1348,13 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.VaultCid = string(dAtA[iNdEx:postIndex]) + x.KsVal = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Claimed", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1543,56 +1364,12 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authentication = append(x.Authentication, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 9: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + x.Claimed = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1630,7 +1407,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { var ( md_Verification protoreflect.MessageDescriptor - fd_Verification_id protoreflect.FieldDescriptor + fd_Verification_did protoreflect.FieldDescriptor fd_Verification_controller protoreflect.FieldDescriptor fd_Verification_did_method protoreflect.FieldDescriptor fd_Verification_issuer protoreflect.FieldDescriptor @@ -1642,7 +1419,7 @@ var ( func init() { file_did_v1_state_proto_init() md_Verification = File_did_v1_state_proto.Messages().ByName("Verification") - fd_Verification_id = md_Verification.Fields().ByName("id") + fd_Verification_did = md_Verification.Fields().ByName("did") fd_Verification_controller = md_Verification.Fields().ByName("controller") fd_Verification_did_method = md_Verification.Fields().ByName("did_method") fd_Verification_issuer = md_Verification.Fields().ByName("issuer") @@ -1716,9 +1493,9 @@ func (x *fastReflection_Verification) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Verification) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Verification_id, value) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_Verification_did, value) { return } } @@ -1773,8 +1550,8 @@ func (x *fastReflection_Verification) Range(f func(protoreflect.FieldDescriptor, // a repeated field is populated if it is non-empty. func (x *fastReflection_Verification) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Verification.id": - return x.Id != "" + case "did.v1.Verification.did": + return x.Did != "" case "did.v1.Verification.controller": return x.Controller != "" case "did.v1.Verification.did_method": @@ -1803,8 +1580,8 @@ func (x *fastReflection_Verification) Has(fd protoreflect.FieldDescriptor) bool // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Verification) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Verification.id": - x.Id = "" + case "did.v1.Verification.did": + x.Did = "" case "did.v1.Verification.controller": x.Controller = "" case "did.v1.Verification.did_method": @@ -1833,8 +1610,8 @@ func (x *fastReflection_Verification) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Verification) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Verification.id": - value := x.Id + case "did.v1.Verification.did": + value := x.Did return protoreflect.ValueOfString(value) case "did.v1.Verification.controller": value := x.Controller @@ -1874,8 +1651,8 @@ func (x *fastReflection_Verification) Get(descriptor protoreflect.FieldDescripto // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Verification) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Verification.id": - x.Id = value.Interface().(string) + case "did.v1.Verification.did": + x.Did = value.Interface().(string) case "did.v1.Verification.controller": x.Controller = value.Interface().(string) case "did.v1.Verification.did_method": @@ -1913,8 +1690,8 @@ func (x *fastReflection_Verification) Mutable(fd protoreflect.FieldDescriptor) p x.PublicKey = new(PubKey) } return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - case "did.v1.Verification.id": - panic(fmt.Errorf("field id of message did.v1.Verification is not mutable")) + case "did.v1.Verification.did": + panic(fmt.Errorf("field did of message did.v1.Verification is not mutable")) case "did.v1.Verification.controller": panic(fmt.Errorf("field controller of message did.v1.Verification is not mutable")) case "did.v1.Verification.did_method": @@ -1938,7 +1715,7 @@ func (x *fastReflection_Verification) Mutable(fd protoreflect.FieldDescriptor) p // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Verification) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Verification.id": + case "did.v1.Verification.did": return protoreflect.ValueOfString("") case "did.v1.Verification.controller": return protoreflect.ValueOfString("") @@ -2022,7 +1799,7 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Id) + l = len(x.Did) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -2128,10 +1905,10 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) i-- dAtA[i] = 0xa } @@ -2186,7 +1963,7 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2214,7 +1991,7 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Id = string(dAtA[iNdEx:postIndex]) + x.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -2522,23 +2299,21 @@ type Controller struct { unknownFields protoimpl.UnknownFields // The unique identifier of the controller - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + // The unique identifier of the controller + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` // The DID of the controller - SonrAddress string `protobuf:"bytes,2,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` + SonrAddress string `protobuf:"bytes,3,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` // The DID of the controller - EthAddress string `protobuf:"bytes,3,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` + EthAddress string `protobuf:"bytes,4,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` // The DID of the controller - BtcAddress string `protobuf:"bytes,4,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` - // Aliases of the controller - Aliases []string `protobuf:"bytes,5,rep,name=aliases,proto3" json:"aliases,omitempty"` + BtcAddress string `protobuf:"bytes,5,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The vault address or identifier - VaultCid string `protobuf:"bytes,7,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` - // The Authentications of the controller - Authentication []string `protobuf:"bytes,8,rep,name=authentication,proto3" json:"authentication,omitempty"` + PublicKey []byte `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // Val Keyshare + KsVal string `protobuf:"bytes,7,opt,name=ks_val,json=ksVal,proto3" json:"ks_val,omitempty"` // The Status of the claims for the controller - Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"` + Claimed bool `protobuf:"varint,8,opt,name=claimed,proto3" json:"claimed,omitempty"` } func (x *Controller) Reset() { @@ -2561,9 +2336,16 @@ func (*Controller) Descriptor() ([]byte, []int) { return file_did_v1_state_proto_rawDescGZIP(), []int{1} } -func (x *Controller) GetId() string { +func (x *Controller) GetNumber() uint64 { if x != nil { - return x.Id + return x.Number + } + return 0 +} + +func (x *Controller) GetDid() string { + if x != nil { + return x.Did } return "" } @@ -2589,39 +2371,25 @@ func (x *Controller) GetBtcAddress() string { return "" } -func (x *Controller) GetAliases() []string { - if x != nil { - return x.Aliases - } - return nil -} - -func (x *Controller) GetPublicKey() *PubKey { +func (x *Controller) GetPublicKey() []byte { if x != nil { return x.PublicKey } return nil } -func (x *Controller) GetVaultCid() string { +func (x *Controller) GetKsVal() string { if x != nil { - return x.VaultCid + return x.KsVal } return "" } -func (x *Controller) GetAuthentication() []string { +func (x *Controller) GetClaimed() bool { if x != nil { - return x.Authentication + return x.Claimed } - return nil -} - -func (x *Controller) GetStatus() string { - if x != nil { - return x.Status - } - return "" + return false } // Verification reprsents a method of verifying membership in a DID @@ -2631,7 +2399,7 @@ type Verification struct { unknownFields protoimpl.UnknownFields // The unique identifier of the verification - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` // The controller of the verification Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The DIDNamespace of the verification @@ -2642,7 +2410,8 @@ type Verification struct { Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The Verification Type (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + // The Verification Type (Authentication, Assertion, CapabilityDelegation, + // CapabilityInvocation) VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` } @@ -2666,9 +2435,9 @@ func (*Verification) Descriptor() ([]byte, []int) { return file_did_v1_state_proto_rawDescGZIP(), []int{2} } -func (x *Verification) GetId() string { +func (x *Verification) GetDid() string { if x != nil { - return x.Id + return x.Did } return "" } @@ -2729,63 +2498,58 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x3a, 0x24, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x1e, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0x9a, 0x03, 0x0a, - 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, - 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x6e, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, - 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x1f, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x74, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, - 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, - 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, - 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, - 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x71, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6b, 0x0a, 0x04, - 0x0a, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x02, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x62, - 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x03, 0x18, 0x01, 0x12, 0x0f, - 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x10, 0x04, 0x18, 0x01, 0x12, - 0x16, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2c, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, - 0x63, 0x69, 0x64, 0x10, 0x05, 0x18, 0x01, 0x18, 0x02, 0x22, 0xdd, 0x02, 0x0a, 0x0c, 0x56, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, - 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x64, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x70, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6a, 0x0a, - 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x2c, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x12, 0x22, 0x0a, 0x1c, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x64, 0x69, 0x64, 0x5f, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x02, 0x18, 0x01, 0x12, - 0x26, 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, 0x04, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, - 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, - 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0xc6, 0x02, 0x0a, + 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x6e, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, + 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x74, 0x63, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x62, 0x74, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x73, 0x5f, + 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x73, 0x56, 0x61, 0x6c, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x3a, 0x59, 0xf2, 0x9e, 0xd3, 0x8e, + 0x03, 0x53, 0x0a, 0x0a, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x10, 0x01, 0x12, 0x12, + 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, + 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x10, 0x02, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x10, 0x03, 0x18, 0x01, 0x12, 0x09, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x10, + 0x04, 0x18, 0x01, 0x18, 0x02, 0x22, 0xe0, 0x02, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x64, 0x5f, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, + 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x71, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6b, 0x0a, 0x05, 0x0a, + 0x03, 0x64, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x2c, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x12, 0x22, 0x0a, 0x1c, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x64, 0x69, 0x64, 0x5f, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x02, 0x18, 0x01, 0x12, 0x26, + 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, 0x04, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, + 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2808,13 +2572,12 @@ var file_did_v1_state_proto_goTypes = []interface{}{ (*PubKey)(nil), // 3: did.v1.PubKey } var file_did_v1_state_proto_depIdxs = []int32{ - 3, // 0: did.v1.Controller.public_key:type_name -> did.v1.PubKey - 3, // 1: did.v1.Verification.public_key:type_name -> did.v1.PubKey - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 3, // 0: did.v1.Verification.public_key:type_name -> did.v1.PubKey + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_did_v1_state_proto_init() } diff --git a/api/did/v1/tx.pulsar.go b/api/did/v1/tx.pulsar.go index 0232e6220..e74a86fc2 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -16,1140 +16,6 @@ import ( sync "sync" ) -var ( - md_MsgAllocateVault protoreflect.MessageDescriptor - fd_MsgAllocateVault_authority protoreflect.FieldDescriptor - fd_MsgAllocateVault_subject protoreflect.FieldDescriptor - fd_MsgAllocateVault_origin protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_tx_proto_init() - md_MsgAllocateVault = File_did_v1_tx_proto.Messages().ByName("MsgAllocateVault") - fd_MsgAllocateVault_authority = md_MsgAllocateVault.Fields().ByName("authority") - fd_MsgAllocateVault_subject = md_MsgAllocateVault.Fields().ByName("subject") - fd_MsgAllocateVault_origin = md_MsgAllocateVault.Fields().ByName("origin") -} - -var _ protoreflect.Message = (*fastReflection_MsgAllocateVault)(nil) - -type fastReflection_MsgAllocateVault MsgAllocateVault - -func (x *MsgAllocateVault) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgAllocateVault)(x) -} - -func (x *MsgAllocateVault) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgAllocateVault_messageType fastReflection_MsgAllocateVault_messageType -var _ protoreflect.MessageType = fastReflection_MsgAllocateVault_messageType{} - -type fastReflection_MsgAllocateVault_messageType struct{} - -func (x fastReflection_MsgAllocateVault_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgAllocateVault)(nil) -} -func (x fastReflection_MsgAllocateVault_messageType) New() protoreflect.Message { - return new(fastReflection_MsgAllocateVault) -} -func (x fastReflection_MsgAllocateVault_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAllocateVault -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgAllocateVault) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAllocateVault -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgAllocateVault) Type() protoreflect.MessageType { - return _fastReflection_MsgAllocateVault_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgAllocateVault) New() protoreflect.Message { - return new(fastReflection_MsgAllocateVault) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgAllocateVault) Interface() protoreflect.ProtoMessage { - return (*MsgAllocateVault)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgAllocateVault) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgAllocateVault_authority, value) { - return - } - } - if x.Subject != "" { - value := protoreflect.ValueOfString(x.Subject) - if !f(fd_MsgAllocateVault_subject, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_MsgAllocateVault_origin, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgAllocateVault) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.MsgAllocateVault.authority": - return x.Authority != "" - case "did.v1.MsgAllocateVault.subject": - return x.Subject != "" - case "did.v1.MsgAllocateVault.origin": - return x.Origin != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAllocateVault) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.MsgAllocateVault.authority": - x.Authority = "" - case "did.v1.MsgAllocateVault.subject": - x.Subject = "" - case "did.v1.MsgAllocateVault.origin": - x.Origin = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgAllocateVault) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.MsgAllocateVault.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "did.v1.MsgAllocateVault.subject": - value := x.Subject - return protoreflect.ValueOfString(value) - case "did.v1.MsgAllocateVault.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAllocateVault) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.MsgAllocateVault.authority": - x.Authority = value.Interface().(string) - case "did.v1.MsgAllocateVault.subject": - x.Subject = value.Interface().(string) - case "did.v1.MsgAllocateVault.origin": - x.Origin = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAllocateVault) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.MsgAllocateVault.authority": - panic(fmt.Errorf("field authority of message did.v1.MsgAllocateVault is not mutable")) - case "did.v1.MsgAllocateVault.subject": - panic(fmt.Errorf("field subject of message did.v1.MsgAllocateVault is not mutable")) - case "did.v1.MsgAllocateVault.origin": - panic(fmt.Errorf("field origin of message did.v1.MsgAllocateVault is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgAllocateVault) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.MsgAllocateVault.authority": - return protoreflect.ValueOfString("") - case "did.v1.MsgAllocateVault.subject": - return protoreflect.ValueOfString("") - case "did.v1.MsgAllocateVault.origin": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgAllocateVault) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgAllocateVault", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgAllocateVault) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAllocateVault) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgAllocateVault) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgAllocateVault) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgAllocateVault) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Subject) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Origin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgAllocateVault) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Origin) > 0 { - i -= len(x.Origin) - copy(dAtA[i:], x.Origin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) - i-- - dAtA[i] = 0x1a - } - if len(x.Subject) > 0 { - i -= len(x.Subject) - copy(dAtA[i:], x.Subject) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) - i-- - dAtA[i] = 0x12 - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgAllocateVault) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVault: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVault: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Subject = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgAllocateVaultResponse protoreflect.MessageDescriptor - fd_MsgAllocateVaultResponse_cid protoreflect.FieldDescriptor - fd_MsgAllocateVaultResponse_expiry_block protoreflect.FieldDescriptor - fd_MsgAllocateVaultResponse_token protoreflect.FieldDescriptor - fd_MsgAllocateVaultResponse_localhost protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_tx_proto_init() - md_MsgAllocateVaultResponse = File_did_v1_tx_proto.Messages().ByName("MsgAllocateVaultResponse") - fd_MsgAllocateVaultResponse_cid = md_MsgAllocateVaultResponse.Fields().ByName("cid") - fd_MsgAllocateVaultResponse_expiry_block = md_MsgAllocateVaultResponse.Fields().ByName("expiry_block") - fd_MsgAllocateVaultResponse_token = md_MsgAllocateVaultResponse.Fields().ByName("token") - fd_MsgAllocateVaultResponse_localhost = md_MsgAllocateVaultResponse.Fields().ByName("localhost") -} - -var _ protoreflect.Message = (*fastReflection_MsgAllocateVaultResponse)(nil) - -type fastReflection_MsgAllocateVaultResponse MsgAllocateVaultResponse - -func (x *MsgAllocateVaultResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgAllocateVaultResponse)(x) -} - -func (x *MsgAllocateVaultResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgAllocateVaultResponse_messageType fastReflection_MsgAllocateVaultResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgAllocateVaultResponse_messageType{} - -type fastReflection_MsgAllocateVaultResponse_messageType struct{} - -func (x fastReflection_MsgAllocateVaultResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgAllocateVaultResponse)(nil) -} -func (x fastReflection_MsgAllocateVaultResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgAllocateVaultResponse) -} -func (x fastReflection_MsgAllocateVaultResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAllocateVaultResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgAllocateVaultResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAllocateVaultResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgAllocateVaultResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgAllocateVaultResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgAllocateVaultResponse) New() protoreflect.Message { - return new(fastReflection_MsgAllocateVaultResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgAllocateVaultResponse) Interface() protoreflect.ProtoMessage { - return (*MsgAllocateVaultResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgAllocateVaultResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Cid != "" { - value := protoreflect.ValueOfString(x.Cid) - if !f(fd_MsgAllocateVaultResponse_cid, value) { - return - } - } - if x.ExpiryBlock != int64(0) { - value := protoreflect.ValueOfInt64(x.ExpiryBlock) - if !f(fd_MsgAllocateVaultResponse_expiry_block, value) { - return - } - } - if x.Token != "" { - value := protoreflect.ValueOfString(x.Token) - if !f(fd_MsgAllocateVaultResponse_token, value) { - return - } - } - if x.Localhost != false { - value := protoreflect.ValueOfBool(x.Localhost) - if !f(fd_MsgAllocateVaultResponse_localhost, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgAllocateVaultResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.MsgAllocateVaultResponse.cid": - return x.Cid != "" - case "did.v1.MsgAllocateVaultResponse.expiry_block": - return x.ExpiryBlock != int64(0) - case "did.v1.MsgAllocateVaultResponse.token": - return x.Token != "" - case "did.v1.MsgAllocateVaultResponse.localhost": - return x.Localhost != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAllocateVaultResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.MsgAllocateVaultResponse.cid": - x.Cid = "" - case "did.v1.MsgAllocateVaultResponse.expiry_block": - x.ExpiryBlock = int64(0) - case "did.v1.MsgAllocateVaultResponse.token": - x.Token = "" - case "did.v1.MsgAllocateVaultResponse.localhost": - x.Localhost = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgAllocateVaultResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.MsgAllocateVaultResponse.cid": - value := x.Cid - return protoreflect.ValueOfString(value) - case "did.v1.MsgAllocateVaultResponse.expiry_block": - value := x.ExpiryBlock - return protoreflect.ValueOfInt64(value) - case "did.v1.MsgAllocateVaultResponse.token": - value := x.Token - return protoreflect.ValueOfString(value) - case "did.v1.MsgAllocateVaultResponse.localhost": - value := x.Localhost - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAllocateVaultResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.MsgAllocateVaultResponse.cid": - x.Cid = value.Interface().(string) - case "did.v1.MsgAllocateVaultResponse.expiry_block": - x.ExpiryBlock = value.Int() - case "did.v1.MsgAllocateVaultResponse.token": - x.Token = value.Interface().(string) - case "did.v1.MsgAllocateVaultResponse.localhost": - x.Localhost = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAllocateVaultResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.MsgAllocateVaultResponse.cid": - panic(fmt.Errorf("field cid of message did.v1.MsgAllocateVaultResponse is not mutable")) - case "did.v1.MsgAllocateVaultResponse.expiry_block": - panic(fmt.Errorf("field expiry_block of message did.v1.MsgAllocateVaultResponse is not mutable")) - case "did.v1.MsgAllocateVaultResponse.token": - panic(fmt.Errorf("field token of message did.v1.MsgAllocateVaultResponse is not mutable")) - case "did.v1.MsgAllocateVaultResponse.localhost": - panic(fmt.Errorf("field localhost of message did.v1.MsgAllocateVaultResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgAllocateVaultResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.MsgAllocateVaultResponse.cid": - return protoreflect.ValueOfString("") - case "did.v1.MsgAllocateVaultResponse.expiry_block": - return protoreflect.ValueOfInt64(int64(0)) - case "did.v1.MsgAllocateVaultResponse.token": - return protoreflect.ValueOfString("") - case "did.v1.MsgAllocateVaultResponse.localhost": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) - } - panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgAllocateVaultResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgAllocateVaultResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgAllocateVaultResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAllocateVaultResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgAllocateVaultResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgAllocateVaultResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Cid) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.ExpiryBlock != 0 { - n += 1 + runtime.Sov(uint64(x.ExpiryBlock)) - } - l = len(x.Token) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Localhost { - n += 2 - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgAllocateVaultResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Localhost { - i-- - if x.Localhost { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(x.Token) > 0 { - i -= len(x.Token) - copy(dAtA[i:], x.Token) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) - i-- - dAtA[i] = 0x1a - } - if x.ExpiryBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryBlock)) - i-- - dAtA[i] = 0x10 - } - if len(x.Cid) > 0 { - i -= len(x.Cid) - copy(dAtA[i:], x.Cid) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cid))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgAllocateVaultResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVaultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Cid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpiryBlock", wireType) - } - x.ExpiryBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.ExpiryBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Localhost", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Localhost = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - var _ protoreflect.List = (*_MsgRegisterController_2_list)(nil) type _MsgRegisterController_2_list struct { @@ -1314,7 +180,7 @@ func (x *MsgRegisterController) ProtoReflect() protoreflect.Message { } func (x *MsgRegisterController) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[2] + mi := &file_did_v1_tx_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2048,7 +914,7 @@ func (x *MsgRegisterControllerResponse) ProtoReflect() protoreflect.Message { } func (x *MsgRegisterControllerResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[3] + mi := &file_did_v1_tx_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2826,7 +1692,7 @@ func (x *MsgExecuteTx) ProtoReflect() protoreflect.Message { } func (x *MsgExecuteTx) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[4] + mi := &file_did_v1_tx_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3532,7 +2398,7 @@ func (x *MsgExecuteTxResponse) ProtoReflect() protoreflect.Message { } func (x *MsgExecuteTxResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[5] + mi := &file_did_v1_tx_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4092,7 +2958,7 @@ func (x *MsgAuthorizeService) ProtoReflect() protoreflect.Message { } func (x *MsgAuthorizeService) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[6] + mi := &file_did_v1_tx_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4858,7 +3724,7 @@ func (x *MsgAuthorizeServiceResponse) ProtoReflect() protoreflect.Message { } func (x *MsgAuthorizeServiceResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[7] + mi := &file_did_v1_tx_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5332,7 +4198,7 @@ func (x *MsgRegisterService) ProtoReflect() protoreflect.Message { } func (x *MsgRegisterService) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[8] + mi := &file_did_v1_tx_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5831,7 +4697,7 @@ func (x *MsgRegisterServiceResponse) ProtoReflect() protoreflect.Message { } func (x *MsgRegisterServiceResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[9] + mi := &file_did_v1_tx_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6307,7 +5173,7 @@ func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { } func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[10] + mi := &file_did_v1_tx_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6864,7 +5730,7 @@ func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { } func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[11] + mi := &file_did_v1_tx_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7215,125 +6081,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// MsgAllocateVault is the message type for the AllocateVault RPC. -type MsgAllocateVault struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // authority is the address of the service account. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // subject is a unique human-defined identifier to associate with the vault. - Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` - // origin is the origin of the request in wildcard form. - Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` -} - -func (x *MsgAllocateVault) Reset() { - *x = MsgAllocateVault{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgAllocateVault) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgAllocateVault) ProtoMessage() {} - -// Deprecated: Use MsgAllocateVault.ProtoReflect.Descriptor instead. -func (*MsgAllocateVault) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgAllocateVault) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *MsgAllocateVault) GetSubject() string { - if x != nil { - return x.Subject - } - return "" -} - -func (x *MsgAllocateVault) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. -type MsgAllocateVaultResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // CID is the content identifier of the vault. - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - // ExpiryBlock is the block number at which the vault will expire. - ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` - // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn - Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` - // IsLocalhost is a flag to indicate if the vault is localhost - Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"` -} - -func (x *MsgAllocateVaultResponse) Reset() { - *x = MsgAllocateVaultResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgAllocateVaultResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgAllocateVaultResponse) ProtoMessage() {} - -// Deprecated: Use MsgAllocateVaultResponse.ProtoReflect.Descriptor instead. -func (*MsgAllocateVaultResponse) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{1} -} - -func (x *MsgAllocateVaultResponse) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *MsgAllocateVaultResponse) GetExpiryBlock() int64 { - if x != nil { - return x.ExpiryBlock - } - return 0 -} - -func (x *MsgAllocateVaultResponse) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *MsgAllocateVaultResponse) GetLocalhost() bool { - if x != nil { - return x.Localhost - } - return false -} - // MsgRegisterController is the message type for the InitializeController RPC. type MsgRegisterController struct { state protoimpl.MessageState @@ -7346,14 +6093,15 @@ type MsgRegisterController struct { Assertions [][]byte `protobuf:"bytes,2,rep,name=assertions,proto3" json:"assertions,omitempty"` // Keyshares is the list of keyshares to initialize the controller with. Keyshares [][]byte `protobuf:"bytes,3,rep,name=keyshares,proto3" json:"keyshares,omitempty"` - // Verifications is the list of verifications to initialize the controller with. + // Verifications is the list of verifications to initialize the controller + // with. Verifications [][]byte `protobuf:"bytes,4,rep,name=verifications,proto3" json:"verifications,omitempty"` } func (x *MsgRegisterController) Reset() { *x = MsgRegisterController{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[2] + mi := &file_did_v1_tx_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7367,7 +6115,7 @@ func (*MsgRegisterController) ProtoMessage() {} // Deprecated: Use MsgRegisterController.ProtoReflect.Descriptor instead. func (*MsgRegisterController) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{2} + return file_did_v1_tx_proto_rawDescGZIP(), []int{0} } func (x *MsgRegisterController) GetAuthority() string { @@ -7398,13 +6146,15 @@ func (x *MsgRegisterController) GetVerifications() [][]byte { return nil } -// MsgRegisterControllerResponse is the response type for the InitializeController RPC. +// MsgRegisterControllerResponse is the response type for the +// InitializeController RPC. type MsgRegisterControllerResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Success returns true if the specified cid is valid and not already encrypted. + // Success returns true if the specified cid is valid and not already + // encrypted. Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Controller is the address of the initialized controller. Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` @@ -7415,7 +6165,7 @@ type MsgRegisterControllerResponse struct { func (x *MsgRegisterControllerResponse) Reset() { *x = MsgRegisterControllerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[3] + mi := &file_did_v1_tx_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7429,7 +6179,7 @@ func (*MsgRegisterControllerResponse) ProtoMessage() {} // Deprecated: Use MsgRegisterControllerResponse.ProtoReflect.Descriptor instead. func (*MsgRegisterControllerResponse) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{3} + return file_did_v1_tx_proto_rawDescGZIP(), []int{1} } func (x *MsgRegisterControllerResponse) GetSuccess() bool { @@ -7470,7 +6220,7 @@ type MsgExecuteTx struct { func (x *MsgExecuteTx) Reset() { *x = MsgExecuteTx{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[4] + mi := &file_did_v1_tx_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7484,7 +6234,7 @@ func (*MsgExecuteTx) ProtoMessage() {} // Deprecated: Use MsgExecuteTx.ProtoReflect.Descriptor instead. func (*MsgExecuteTx) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{4} + return file_did_v1_tx_proto_rawDescGZIP(), []int{2} } func (x *MsgExecuteTx) GetController() string { @@ -7521,7 +6271,7 @@ type MsgExecuteTxResponse struct { func (x *MsgExecuteTxResponse) Reset() { *x = MsgExecuteTxResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[5] + mi := &file_did_v1_tx_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7535,7 +6285,7 @@ func (*MsgExecuteTxResponse) ProtoMessage() {} // Deprecated: Use MsgExecuteTxResponse.ProtoReflect.Descriptor instead. func (*MsgExecuteTxResponse) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{5} + return file_did_v1_tx_proto_rawDescGZIP(), []int{3} } func (x *MsgExecuteTxResponse) GetSuccess() bool { @@ -7571,7 +6321,7 @@ type MsgAuthorizeService struct { func (x *MsgAuthorizeService) Reset() { *x = MsgAuthorizeService{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[6] + mi := &file_did_v1_tx_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7585,7 +6335,7 @@ func (*MsgAuthorizeService) ProtoMessage() {} // Deprecated: Use MsgAuthorizeService.ProtoReflect.Descriptor instead. func (*MsgAuthorizeService) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{6} + return file_did_v1_tx_proto_rawDescGZIP(), []int{4} } func (x *MsgAuthorizeService) GetController() string { @@ -7616,7 +6366,8 @@ func (x *MsgAuthorizeService) GetToken() string { return "" } -// MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. +// MsgAuthorizeServiceResponse is the response type for the AuthorizeService +// RPC. type MsgAuthorizeServiceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7629,7 +6380,7 @@ type MsgAuthorizeServiceResponse struct { func (x *MsgAuthorizeServiceResponse) Reset() { *x = MsgAuthorizeServiceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[7] + mi := &file_did_v1_tx_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7643,7 +6394,7 @@ func (*MsgAuthorizeServiceResponse) ProtoMessage() {} // Deprecated: Use MsgAuthorizeServiceResponse.ProtoReflect.Descriptor instead. func (*MsgAuthorizeServiceResponse) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{7} + return file_did_v1_tx_proto_rawDescGZIP(), []int{5} } func (x *MsgAuthorizeServiceResponse) GetSuccess() bool { @@ -7668,14 +6419,15 @@ type MsgRegisterService struct { // authority is the address of the governance account. Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` - // origin is the origin of the request in wildcard form. Requires valid TXT record in DNS. + // origin is the origin of the request in wildcard form. Requires valid TXT + // record in DNS. Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` } func (x *MsgRegisterService) Reset() { *x = MsgRegisterService{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[8] + mi := &file_did_v1_tx_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7689,7 +6441,7 @@ func (*MsgRegisterService) ProtoMessage() {} // Deprecated: Use MsgRegisterService.ProtoReflect.Descriptor instead. func (*MsgRegisterService) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{8} + return file_did_v1_tx_proto_rawDescGZIP(), []int{6} } func (x *MsgRegisterService) GetController() string { @@ -7719,7 +6471,7 @@ type MsgRegisterServiceResponse struct { func (x *MsgRegisterServiceResponse) Reset() { *x = MsgRegisterServiceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[9] + mi := &file_did_v1_tx_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7733,7 +6485,7 @@ func (*MsgRegisterServiceResponse) ProtoMessage() {} // Deprecated: Use MsgRegisterServiceResponse.ProtoReflect.Descriptor instead. func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{9} + return file_did_v1_tx_proto_rawDescGZIP(), []int{7} } func (x *MsgRegisterServiceResponse) GetSuccess() bool { @@ -7769,7 +6521,7 @@ type MsgUpdateParams struct { func (x *MsgUpdateParams) Reset() { *x = MsgUpdateParams{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[10] + mi := &file_did_v1_tx_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7783,7 +6535,7 @@ func (*MsgUpdateParams) ProtoMessage() {} // Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{10} + return file_did_v1_tx_proto_rawDescGZIP(), []int{8} } func (x *MsgUpdateParams) GetAuthority() string { @@ -7820,7 +6572,7 @@ type MsgUpdateParamsResponse struct { func (x *MsgUpdateParamsResponse) Reset() { *x = MsgUpdateParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[11] + mi := &file_did_v1_tx_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7834,7 +6586,7 @@ func (*MsgUpdateParamsResponse) ProtoMessage() {} // Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{11} + return file_did_v1_tx_proto_rawDescGZIP(), []int{9} } var File_did_v1_tx_proto protoreflect.FileDescriptor @@ -7847,161 +6599,138 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4d, 0x73, - 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, - 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x83, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, - 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x79, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, - 0x78, 0x70, 0x69, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x22, 0xc3, - 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0c, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x24, - 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x22, 0x81, 0x02, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfd, 0x01, 0x0a, 0x0c, 0x4d, 0x73, 0x67, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, - 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, - 0x61, 0x73, 0x68, 0x22, 0x9e, 0x02, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x01, 0x0a, 0x15, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, + 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6b, + 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, + 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, + 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, + 0x81, 0x02, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x4e, 0x0a, - 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x1a, 0x3e, 0x0a, 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x4d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, - 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x22, 0x48, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x02, 0x38, 0x01, 0x22, 0xfd, 0x01, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x54, 0x78, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x3e, + 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x25, + 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x9e, + 0x02, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x4e, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x3e, + 0x0a, 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0f, + 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, + 0x4d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, - 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe9, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4b, 0x0a, - 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, - 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x10, 0x41, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1b, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x23, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3f, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x12, 0x14, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x65, 0x54, 0x78, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x5a, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, - 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x22, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x48, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, - 0x01, 0x42, 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, - 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, - 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, - 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8a, + 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, + 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x48, 0x0a, 0x1a, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0x9c, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x54, 0x0a, 0x10, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x23, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, + 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x12, 0x14, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, + 0x78, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5a, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x22, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, + 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x17, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, + 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8016,46 +6745,42 @@ func file_did_v1_tx_proto_rawDescGZIP() []byte { return file_did_v1_tx_proto_rawDescData } -var file_did_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_did_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_did_v1_tx_proto_goTypes = []interface{}{ - (*MsgAllocateVault)(nil), // 0: did.v1.MsgAllocateVault - (*MsgAllocateVaultResponse)(nil), // 1: did.v1.MsgAllocateVaultResponse - (*MsgRegisterController)(nil), // 2: did.v1.MsgRegisterController - (*MsgRegisterControllerResponse)(nil), // 3: did.v1.MsgRegisterControllerResponse - (*MsgExecuteTx)(nil), // 4: did.v1.MsgExecuteTx - (*MsgExecuteTxResponse)(nil), // 5: did.v1.MsgExecuteTxResponse - (*MsgAuthorizeService)(nil), // 6: did.v1.MsgAuthorizeService - (*MsgAuthorizeServiceResponse)(nil), // 7: did.v1.MsgAuthorizeServiceResponse - (*MsgRegisterService)(nil), // 8: did.v1.MsgRegisterService - (*MsgRegisterServiceResponse)(nil), // 9: did.v1.MsgRegisterServiceResponse - (*MsgUpdateParams)(nil), // 10: did.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 11: did.v1.MsgUpdateParamsResponse - nil, // 12: did.v1.MsgRegisterControllerResponse.AccountsEntry - nil, // 13: did.v1.MsgExecuteTx.MessagesEntry - nil, // 14: did.v1.MsgAuthorizeService.PermissionsEntry - (*Service)(nil), // 15: did.v1.Service - (*Params)(nil), // 16: did.v1.Params + (*MsgRegisterController)(nil), // 0: did.v1.MsgRegisterController + (*MsgRegisterControllerResponse)(nil), // 1: did.v1.MsgRegisterControllerResponse + (*MsgExecuteTx)(nil), // 2: did.v1.MsgExecuteTx + (*MsgExecuteTxResponse)(nil), // 3: did.v1.MsgExecuteTxResponse + (*MsgAuthorizeService)(nil), // 4: did.v1.MsgAuthorizeService + (*MsgAuthorizeServiceResponse)(nil), // 5: did.v1.MsgAuthorizeServiceResponse + (*MsgRegisterService)(nil), // 6: did.v1.MsgRegisterService + (*MsgRegisterServiceResponse)(nil), // 7: did.v1.MsgRegisterServiceResponse + (*MsgUpdateParams)(nil), // 8: did.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 9: did.v1.MsgUpdateParamsResponse + nil, // 10: did.v1.MsgRegisterControllerResponse.AccountsEntry + nil, // 11: did.v1.MsgExecuteTx.MessagesEntry + nil, // 12: did.v1.MsgAuthorizeService.PermissionsEntry + (*Service)(nil), // 13: did.v1.Service + (*Params)(nil), // 14: did.v1.Params } var file_did_v1_tx_proto_depIdxs = []int32{ - 12, // 0: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry - 13, // 1: did.v1.MsgExecuteTx.messages:type_name -> did.v1.MsgExecuteTx.MessagesEntry - 14, // 2: did.v1.MsgAuthorizeService.permissions:type_name -> did.v1.MsgAuthorizeService.PermissionsEntry - 15, // 3: did.v1.MsgRegisterService.service:type_name -> did.v1.Service - 16, // 4: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params - 0, // 5: did.v1.Msg.AllocateVault:input_type -> did.v1.MsgAllocateVault - 6, // 6: did.v1.Msg.AuthorizeService:input_type -> did.v1.MsgAuthorizeService - 4, // 7: did.v1.Msg.ExecuteTx:input_type -> did.v1.MsgExecuteTx - 2, // 8: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController - 8, // 9: did.v1.Msg.RegisterService:input_type -> did.v1.MsgRegisterService - 10, // 10: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams - 1, // 11: did.v1.Msg.AllocateVault:output_type -> did.v1.MsgAllocateVaultResponse - 7, // 12: did.v1.Msg.AuthorizeService:output_type -> did.v1.MsgAuthorizeServiceResponse - 5, // 13: did.v1.Msg.ExecuteTx:output_type -> did.v1.MsgExecuteTxResponse - 3, // 14: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse - 9, // 15: did.v1.Msg.RegisterService:output_type -> did.v1.MsgRegisterServiceResponse - 11, // 16: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse - 11, // [11:17] is the sub-list for method output_type - 5, // [5:11] is the sub-list for method input_type + 10, // 0: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry + 11, // 1: did.v1.MsgExecuteTx.messages:type_name -> did.v1.MsgExecuteTx.MessagesEntry + 12, // 2: did.v1.MsgAuthorizeService.permissions:type_name -> did.v1.MsgAuthorizeService.PermissionsEntry + 13, // 3: did.v1.MsgRegisterService.service:type_name -> did.v1.Service + 14, // 4: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params + 4, // 5: did.v1.Msg.AuthorizeService:input_type -> did.v1.MsgAuthorizeService + 2, // 6: did.v1.Msg.ExecuteTx:input_type -> did.v1.MsgExecuteTx + 0, // 7: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController + 6, // 8: did.v1.Msg.RegisterService:input_type -> did.v1.MsgRegisterService + 8, // 9: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams + 5, // 10: did.v1.Msg.AuthorizeService:output_type -> did.v1.MsgAuthorizeServiceResponse + 3, // 11: did.v1.Msg.ExecuteTx:output_type -> did.v1.MsgExecuteTxResponse + 1, // 12: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse + 7, // 13: did.v1.Msg.RegisterService:output_type -> did.v1.MsgRegisterServiceResponse + 9, // 14: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name 5, // [5:5] is the sub-list for extension extendee 0, // [0:5] is the sub-list for field type_name @@ -8069,30 +6794,6 @@ func file_did_v1_tx_proto_init() { file_did_v1_genesis_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgAllocateVault); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgAllocateVaultResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterController); i { case 0: return &v.state @@ -8104,7 +6805,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterControllerResponse); i { case 0: return &v.state @@ -8116,7 +6817,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgExecuteTx); i { case 0: return &v.state @@ -8128,7 +6829,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgExecuteTxResponse); i { case 0: return &v.state @@ -8140,7 +6841,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgAuthorizeService); i { case 0: return &v.state @@ -8152,7 +6853,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgAuthorizeServiceResponse); i { case 0: return &v.state @@ -8164,7 +6865,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterService); i { case 0: return &v.state @@ -8176,7 +6877,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterServiceResponse); i { case 0: return &v.state @@ -8188,7 +6889,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { case 0: return &v.state @@ -8200,7 +6901,7 @@ func file_did_v1_tx_proto_init() { return nil } } - file_did_v1_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParamsResponse); i { case 0: return &v.state @@ -8219,7 +6920,7 @@ func file_did_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 15, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/api/did/v1/tx_grpc.pb.go b/api/did/v1/tx_grpc.pb.go index 8dd2d5d05..1bb32f68a 100644 --- a/api/did/v1/tx_grpc.pb.go +++ b/api/did/v1/tx_grpc.pb.go @@ -19,7 +19,6 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_AllocateVault_FullMethodName = "/did.v1.Msg/AllocateVault" Msg_AuthorizeService_FullMethodName = "/did.v1.Msg/AuthorizeService" Msg_ExecuteTx_FullMethodName = "/did.v1.Msg/ExecuteTx" Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController" @@ -31,16 +30,17 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MsgClient interface { - // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. - // this operation is called by services initiating a controller registration. - AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) - // AuthorizeService asserts the given controller is the owner of the given address. + // AuthorizeService asserts the given controller is the owner of the given + // address. AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) - // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages Macaroon for verification. + // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages + // Macaroon for verification. ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, 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) - // 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. RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error) // UpdateParams defines a governance operation for updating the parameters. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) @@ -54,15 +54,6 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { return &msgClient{cc} } -func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) { - out := new(MsgAllocateVaultResponse) - err := c.cc.Invoke(ctx, Msg_AllocateVault_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) { out := new(MsgAuthorizeServiceResponse) err := c.cc.Invoke(ctx, Msg_AuthorizeService_FullMethodName, in, out, opts...) @@ -112,16 +103,17 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // All implementations must embed UnimplementedMsgServer // for forward compatibility type MsgServer interface { - // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. - // this operation is called by services initiating a controller registration. - AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) - // AuthorizeService asserts the given controller is the owner of the given address. + // AuthorizeService asserts the given controller is the owner of the given + // address. AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) - // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages Macaroon for verification. + // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages + // Macaroon for verification. ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, 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) - // 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. RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error) // UpdateParams defines a governance operation for updating the parameters. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) @@ -132,9 +124,6 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented") -} func (UnimplementedMsgServer) AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") } @@ -163,24 +152,6 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { s.RegisterService(&Msg_ServiceDesc, srv) } -func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAllocateVault) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).AllocateVault(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_AllocateVault_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgAuthorizeService) if err := dec(in); err != nil { @@ -278,10 +249,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ ServiceName: "did.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "AllocateVault", - Handler: _Msg_AllocateVault_Handler, - }, { MethodName: "AuthorizeService", Handler: _Msg_AuthorizeService_Handler, diff --git a/api/vault/module/v1/module.pulsar.go b/api/vault/module/v1/module.pulsar.go new file mode 100644 index 000000000..1789eae62 --- /dev/null +++ b/api/vault/module/v1/module.pulsar.go @@ -0,0 +1,499 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor +) + +func init() { + file_vault_module_v1_module_proto_init() + md_Module = File_vault_module_v1_module_proto.Messages().ByName("Module") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_vault_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) + } + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) + } + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) + } + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) + } + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) + } + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) + } + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.module.v1.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: vault/module/v1/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the app config object of the module. +// Learn more: https://docs.cosmos.network/main/building-modules/depinject +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_vault_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +var File_vault_module_v1_module_proto protoreflect.FileDescriptor + +var file_vault_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xb5, 0x01, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x4d, 0x58, 0xaa, 0x02, 0x0f, + 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x0f, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1b, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x11, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_vault_module_v1_module_proto_rawDescOnce sync.Once + file_vault_module_v1_module_proto_rawDescData = file_vault_module_v1_module_proto_rawDesc +) + +func file_vault_module_v1_module_proto_rawDescGZIP() []byte { + file_vault_module_v1_module_proto_rawDescOnce.Do(func() { + file_vault_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_vault_module_v1_module_proto_rawDescData) + }) + return file_vault_module_v1_module_proto_rawDescData +} + +var file_vault_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_vault_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: vault.module.v1.Module +} +var file_vault_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_vault_module_v1_module_proto_init() } +func file_vault_module_v1_module_proto_init() { + if File_vault_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_vault_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_vault_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_vault_module_v1_module_proto_goTypes, + DependencyIndexes: file_vault_module_v1_module_proto_depIdxs, + MessageInfos: file_vault_module_v1_module_proto_msgTypes, + }.Build() + File_vault_module_v1_module_proto = out.File + file_vault_module_v1_module_proto_rawDesc = nil + file_vault_module_v1_module_proto_goTypes = nil + file_vault_module_v1_module_proto_depIdxs = nil +} diff --git a/api/vault/v1/genesis.pulsar.go b/api/vault/v1/genesis.pulsar.go new file mode 100644 index 000000000..867b1c3e6 --- /dev/null +++ b/api/vault/v1/genesis.pulsar.go @@ -0,0 +1,2324 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package vaultv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_genesis_proto_init() + md_GenesisState = File_vault_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.GenesisState")) + } + panic(fmt.Errorf("message vault.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.GenesisState")) + } + panic(fmt.Errorf("message vault.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.GenesisState")) + } + panic(fmt.Errorf("message vault.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.GenesisState")) + } + panic(fmt.Errorf("message vault.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.GenesisState")) + } + panic(fmt.Errorf("message vault.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.GenesisState")) + } + panic(fmt.Errorf("message vault.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_ipfs_active protoreflect.FieldDescriptor + fd_Params_local_registration_enabled protoreflect.FieldDescriptor + fd_Params_schema protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_genesis_proto_init() + md_Params = File_vault_v1_genesis_proto.Messages().ByName("Params") + fd_Params_ipfs_active = md_Params.Fields().ByName("ipfs_active") + fd_Params_local_registration_enabled = md_Params.Fields().ByName("local_registration_enabled") + fd_Params_schema = md_Params.Fields().ByName("schema") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_genesis_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.IpfsActive != false { + value := protoreflect.ValueOfBool(x.IpfsActive) + if !f(fd_Params_ipfs_active, value) { + return + } + } + if x.LocalRegistrationEnabled != false { + value := protoreflect.ValueOfBool(x.LocalRegistrationEnabled) + if !f(fd_Params_local_registration_enabled, value) { + return + } + } + if x.Schema != nil { + value := protoreflect.ValueOfMessage(x.Schema.ProtoReflect()) + if !f(fd_Params_schema, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.Params.ipfs_active": + return x.IpfsActive != false + case "vault.v1.Params.local_registration_enabled": + return x.LocalRegistrationEnabled != false + case "vault.v1.Params.schema": + return x.Schema != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Params")) + } + panic(fmt.Errorf("message vault.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.Params.ipfs_active": + x.IpfsActive = false + case "vault.v1.Params.local_registration_enabled": + x.LocalRegistrationEnabled = false + case "vault.v1.Params.schema": + x.Schema = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Params")) + } + panic(fmt.Errorf("message vault.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.Params.ipfs_active": + value := x.IpfsActive + return protoreflect.ValueOfBool(value) + case "vault.v1.Params.local_registration_enabled": + value := x.LocalRegistrationEnabled + return protoreflect.ValueOfBool(value) + case "vault.v1.Params.schema": + value := x.Schema + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Params")) + } + panic(fmt.Errorf("message vault.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.Params.ipfs_active": + x.IpfsActive = value.Bool() + case "vault.v1.Params.local_registration_enabled": + x.LocalRegistrationEnabled = value.Bool() + case "vault.v1.Params.schema": + x.Schema = value.Message().Interface().(*Schema) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Params")) + } + panic(fmt.Errorf("message vault.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.Params.schema": + if x.Schema == nil { + x.Schema = new(Schema) + } + return protoreflect.ValueOfMessage(x.Schema.ProtoReflect()) + case "vault.v1.Params.ipfs_active": + panic(fmt.Errorf("field ipfs_active of message vault.v1.Params is not mutable")) + case "vault.v1.Params.local_registration_enabled": + panic(fmt.Errorf("field local_registration_enabled of message vault.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Params")) + } + panic(fmt.Errorf("message vault.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.Params.ipfs_active": + return protoreflect.ValueOfBool(false) + case "vault.v1.Params.local_registration_enabled": + return protoreflect.ValueOfBool(false) + case "vault.v1.Params.schema": + m := new(Schema) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Params")) + } + panic(fmt.Errorf("message vault.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.IpfsActive { + n += 2 + } + if x.LocalRegistrationEnabled { + n += 2 + } + if x.Schema != nil { + l = options.Size(x.Schema) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Schema != nil { + encoded, err := options.Marshal(x.Schema) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.LocalRegistrationEnabled { + i-- + if x.LocalRegistrationEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if x.IpfsActive { + i-- + if x.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.IpfsActive = bool(v != 0) + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LocalRegistrationEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.LocalRegistrationEnabled = bool(v != 0) + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Schema == nil { + x.Schema = &Schema{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Schema); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_Schema protoreflect.MessageDescriptor + fd_Schema_version protoreflect.FieldDescriptor + fd_Schema_account protoreflect.FieldDescriptor + fd_Schema_asset protoreflect.FieldDescriptor + fd_Schema_chain protoreflect.FieldDescriptor + fd_Schema_credential protoreflect.FieldDescriptor + fd_Schema_jwk protoreflect.FieldDescriptor + fd_Schema_grant protoreflect.FieldDescriptor + fd_Schema_keyshare protoreflect.FieldDescriptor + fd_Schema_publicKey protoreflect.FieldDescriptor + fd_Schema_profile protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_genesis_proto_init() + md_Schema = File_vault_v1_genesis_proto.Messages().ByName("Schema") + fd_Schema_version = md_Schema.Fields().ByName("version") + fd_Schema_account = md_Schema.Fields().ByName("account") + fd_Schema_asset = md_Schema.Fields().ByName("asset") + fd_Schema_chain = md_Schema.Fields().ByName("chain") + fd_Schema_credential = md_Schema.Fields().ByName("credential") + fd_Schema_jwk = md_Schema.Fields().ByName("jwk") + fd_Schema_grant = md_Schema.Fields().ByName("grant") + fd_Schema_keyshare = md_Schema.Fields().ByName("keyshare") + fd_Schema_publicKey = md_Schema.Fields().ByName("publicKey") + fd_Schema_profile = md_Schema.Fields().ByName("profile") +} + +var _ protoreflect.Message = (*fastReflection_Schema)(nil) + +type fastReflection_Schema Schema + +func (x *Schema) ProtoReflect() protoreflect.Message { + return (*fastReflection_Schema)(x) +} + +func (x *Schema) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_genesis_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Schema_messageType fastReflection_Schema_messageType +var _ protoreflect.MessageType = fastReflection_Schema_messageType{} + +type fastReflection_Schema_messageType struct{} + +func (x fastReflection_Schema_messageType) Zero() protoreflect.Message { + return (*fastReflection_Schema)(nil) +} +func (x fastReflection_Schema_messageType) New() protoreflect.Message { + return new(fastReflection_Schema) +} +func (x fastReflection_Schema_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Schema +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Schema) Descriptor() protoreflect.MessageDescriptor { + return md_Schema +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Schema) Type() protoreflect.MessageType { + return _fastReflection_Schema_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Schema) New() protoreflect.Message { + return new(fastReflection_Schema) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Schema) Interface() protoreflect.ProtoMessage { + return (*Schema)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Schema) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Version != int32(0) { + value := protoreflect.ValueOfInt32(x.Version) + if !f(fd_Schema_version, value) { + return + } + } + if x.Account != "" { + value := protoreflect.ValueOfString(x.Account) + if !f(fd_Schema_account, value) { + return + } + } + if x.Asset != "" { + value := protoreflect.ValueOfString(x.Asset) + if !f(fd_Schema_asset, value) { + return + } + } + if x.Chain != "" { + value := protoreflect.ValueOfString(x.Chain) + if !f(fd_Schema_chain, value) { + return + } + } + if x.Credential != "" { + value := protoreflect.ValueOfString(x.Credential) + if !f(fd_Schema_credential, value) { + return + } + } + if x.Jwk != "" { + value := protoreflect.ValueOfString(x.Jwk) + if !f(fd_Schema_jwk, value) { + return + } + } + if x.Grant != "" { + value := protoreflect.ValueOfString(x.Grant) + if !f(fd_Schema_grant, value) { + return + } + } + if x.Keyshare != "" { + value := protoreflect.ValueOfString(x.Keyshare) + if !f(fd_Schema_keyshare, value) { + return + } + } + if x.PublicKey != "" { + value := protoreflect.ValueOfString(x.PublicKey) + if !f(fd_Schema_publicKey, value) { + return + } + } + if x.Profile != "" { + value := protoreflect.ValueOfString(x.Profile) + if !f(fd_Schema_profile, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Schema) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.Schema.version": + return x.Version != int32(0) + case "vault.v1.Schema.account": + return x.Account != "" + case "vault.v1.Schema.asset": + return x.Asset != "" + case "vault.v1.Schema.chain": + return x.Chain != "" + case "vault.v1.Schema.credential": + return x.Credential != "" + case "vault.v1.Schema.jwk": + return x.Jwk != "" + case "vault.v1.Schema.grant": + return x.Grant != "" + case "vault.v1.Schema.keyshare": + return x.Keyshare != "" + case "vault.v1.Schema.publicKey": + return x.PublicKey != "" + case "vault.v1.Schema.profile": + return x.Profile != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Schema")) + } + panic(fmt.Errorf("message vault.v1.Schema does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Schema) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.Schema.version": + x.Version = int32(0) + case "vault.v1.Schema.account": + x.Account = "" + case "vault.v1.Schema.asset": + x.Asset = "" + case "vault.v1.Schema.chain": + x.Chain = "" + case "vault.v1.Schema.credential": + x.Credential = "" + case "vault.v1.Schema.jwk": + x.Jwk = "" + case "vault.v1.Schema.grant": + x.Grant = "" + case "vault.v1.Schema.keyshare": + x.Keyshare = "" + case "vault.v1.Schema.publicKey": + x.PublicKey = "" + case "vault.v1.Schema.profile": + x.Profile = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Schema")) + } + panic(fmt.Errorf("message vault.v1.Schema does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Schema) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.Schema.version": + value := x.Version + return protoreflect.ValueOfInt32(value) + case "vault.v1.Schema.account": + value := x.Account + return protoreflect.ValueOfString(value) + case "vault.v1.Schema.asset": + value := x.Asset + return protoreflect.ValueOfString(value) + case "vault.v1.Schema.chain": + value := x.Chain + return protoreflect.ValueOfString(value) + case "vault.v1.Schema.credential": + value := x.Credential + return protoreflect.ValueOfString(value) + case "vault.v1.Schema.jwk": + value := x.Jwk + return protoreflect.ValueOfString(value) + case "vault.v1.Schema.grant": + value := x.Grant + return protoreflect.ValueOfString(value) + case "vault.v1.Schema.keyshare": + value := x.Keyshare + return protoreflect.ValueOfString(value) + case "vault.v1.Schema.publicKey": + value := x.PublicKey + return protoreflect.ValueOfString(value) + case "vault.v1.Schema.profile": + value := x.Profile + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Schema")) + } + panic(fmt.Errorf("message vault.v1.Schema does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Schema) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.Schema.version": + x.Version = int32(value.Int()) + case "vault.v1.Schema.account": + x.Account = value.Interface().(string) + case "vault.v1.Schema.asset": + x.Asset = value.Interface().(string) + case "vault.v1.Schema.chain": + x.Chain = value.Interface().(string) + case "vault.v1.Schema.credential": + x.Credential = value.Interface().(string) + case "vault.v1.Schema.jwk": + x.Jwk = value.Interface().(string) + case "vault.v1.Schema.grant": + x.Grant = value.Interface().(string) + case "vault.v1.Schema.keyshare": + x.Keyshare = value.Interface().(string) + case "vault.v1.Schema.publicKey": + x.PublicKey = value.Interface().(string) + case "vault.v1.Schema.profile": + x.Profile = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Schema")) + } + panic(fmt.Errorf("message vault.v1.Schema does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Schema) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.Schema.version": + panic(fmt.Errorf("field version of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.account": + panic(fmt.Errorf("field account of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.asset": + panic(fmt.Errorf("field asset of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.chain": + panic(fmt.Errorf("field chain of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.credential": + panic(fmt.Errorf("field credential of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.jwk": + panic(fmt.Errorf("field jwk of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.grant": + panic(fmt.Errorf("field grant of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.keyshare": + panic(fmt.Errorf("field keyshare of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.publicKey": + panic(fmt.Errorf("field publicKey of message vault.v1.Schema is not mutable")) + case "vault.v1.Schema.profile": + panic(fmt.Errorf("field profile of message vault.v1.Schema is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Schema")) + } + panic(fmt.Errorf("message vault.v1.Schema does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Schema) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.Schema.version": + return protoreflect.ValueOfInt32(int32(0)) + case "vault.v1.Schema.account": + return protoreflect.ValueOfString("") + case "vault.v1.Schema.asset": + return protoreflect.ValueOfString("") + case "vault.v1.Schema.chain": + return protoreflect.ValueOfString("") + case "vault.v1.Schema.credential": + return protoreflect.ValueOfString("") + case "vault.v1.Schema.jwk": + return protoreflect.ValueOfString("") + case "vault.v1.Schema.grant": + return protoreflect.ValueOfString("") + case "vault.v1.Schema.keyshare": + return protoreflect.ValueOfString("") + case "vault.v1.Schema.publicKey": + return protoreflect.ValueOfString("") + case "vault.v1.Schema.profile": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.Schema")) + } + panic(fmt.Errorf("message vault.v1.Schema does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Schema) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.Schema", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Schema) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Schema) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Schema) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Schema) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Schema) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Version != 0 { + n += 1 + runtime.Sov(uint64(x.Version)) + } + l = len(x.Account) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Asset) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Chain) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Credential) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Jwk) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Grant) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Keyshare) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PublicKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Profile) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Schema) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Profile) > 0 { + i -= len(x.Profile) + copy(dAtA[i:], x.Profile) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Profile))) + i-- + dAtA[i] = 0x52 + } + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + i-- + dAtA[i] = 0x4a + } + if len(x.Keyshare) > 0 { + i -= len(x.Keyshare) + copy(dAtA[i:], x.Keyshare) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Keyshare))) + i-- + dAtA[i] = 0x42 + } + if len(x.Grant) > 0 { + i -= len(x.Grant) + copy(dAtA[i:], x.Grant) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Grant))) + i-- + dAtA[i] = 0x3a + } + if len(x.Jwk) > 0 { + i -= len(x.Jwk) + copy(dAtA[i:], x.Jwk) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Jwk))) + i-- + dAtA[i] = 0x32 + } + if len(x.Credential) > 0 { + i -= len(x.Credential) + copy(dAtA[i:], x.Credential) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Credential))) + i-- + dAtA[i] = 0x2a + } + if len(x.Chain) > 0 { + i -= len(x.Chain) + copy(dAtA[i:], x.Chain) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Chain))) + i-- + dAtA[i] = 0x22 + } + if len(x.Asset) > 0 { + i -= len(x.Asset) + copy(dAtA[i:], x.Asset) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Asset))) + i-- + dAtA[i] = 0x1a + } + if len(x.Account) > 0 { + i -= len(x.Account) + copy(dAtA[i:], x.Account) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Account))) + i-- + dAtA[i] = 0x12 + } + if x.Version != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Version)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Schema) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Schema: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Schema: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + x.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Version |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Account = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Chain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Credential", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Credential = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Jwk = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Grant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Grant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Keyshare", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Keyshare = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.PublicKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Profile = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: vault/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the module genesis state +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Params defines all the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_vault_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// Params defines the set of module parameters. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpfsActive bool `protobuf:"varint,1,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + LocalRegistrationEnabled bool `protobuf:"varint,2,opt,name=local_registration_enabled,json=localRegistrationEnabled,proto3" json:"local_registration_enabled,omitempty"` + Schema *Schema `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_genesis_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_vault_v1_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *Params) GetIpfsActive() bool { + if x != nil { + return x.IpfsActive + } + return false +} + +func (x *Params) GetLocalRegistrationEnabled() bool { + if x != nil { + return x.LocalRegistrationEnabled + } + return false +} + +func (x *Params) GetSchema() *Schema { + if x != nil { + return x.Schema + } + return nil +} + +type Schema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` + Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` + Chain string `protobuf:"bytes,4,opt,name=chain,proto3" json:"chain,omitempty"` + Credential string `protobuf:"bytes,5,opt,name=credential,proto3" json:"credential,omitempty"` + Jwk string `protobuf:"bytes,6,opt,name=jwk,proto3" json:"jwk,omitempty"` + Grant string `protobuf:"bytes,7,opt,name=grant,proto3" json:"grant,omitempty"` + Keyshare string `protobuf:"bytes,8,opt,name=keyshare,proto3" json:"keyshare,omitempty"` + PublicKey string `protobuf:"bytes,9,opt,name=publicKey,proto3" json:"publicKey,omitempty"` + Profile string `protobuf:"bytes,10,opt,name=profile,proto3" json:"profile,omitempty"` +} + +func (x *Schema) Reset() { + *x = Schema{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_genesis_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema) ProtoMessage() {} + +// Deprecated: Use Schema.ProtoReflect.Descriptor instead. +func (*Schema) Descriptor() ([]byte, []int) { + return file_vault_v1_genesis_proto_rawDescGZIP(), []int{2} +} + +func (x *Schema) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *Schema) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +func (x *Schema) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + +func (x *Schema) GetChain() string { + if x != nil { + return x.Chain + } + return "" +} + +func (x *Schema) GetCredential() string { + if x != nil { + return x.Credential + } + return "" +} + +func (x *Schema) GetJwk() string { + if x != nil { + return x.Jwk + } + return "" +} + +func (x *Schema) GetGrant() string { + if x != nil { + return x.Grant + } + return "" +} + +func (x *Schema) GetKeyshare() string { + if x != nil { + return x.Keyshare + } + return "" +} + +func (x *Schema) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +func (x *Schema) GetProfile() string { + if x != nil { + return x.Profile + } + return "" +} + +var File_vault_v1_genesis_proto protoreflect.FileDescriptor + +var file_vault_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, + 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x0c, 0x47, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x61, + 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xac, 0x01, 0x0a, 0x06, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, + 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, + 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x3a, + 0x19, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0c, 0x76, 0x61, + 0x75, 0x6c, 0x74, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x84, 0x02, 0x0a, 0x06, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, + 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x42, 0x8a, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, + 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, + 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_vault_v1_genesis_proto_rawDescOnce sync.Once + file_vault_v1_genesis_proto_rawDescData = file_vault_v1_genesis_proto_rawDesc +) + +func file_vault_v1_genesis_proto_rawDescGZIP() []byte { + file_vault_v1_genesis_proto_rawDescOnce.Do(func() { + file_vault_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_vault_v1_genesis_proto_rawDescData) + }) + return file_vault_v1_genesis_proto_rawDescData +} + +var file_vault_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_vault_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: vault.v1.GenesisState + (*Params)(nil), // 1: vault.v1.Params + (*Schema)(nil), // 2: vault.v1.Schema +} +var file_vault_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: vault.v1.GenesisState.params:type_name -> vault.v1.Params + 2, // 1: vault.v1.Params.schema:type_name -> vault.v1.Schema + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_vault_v1_genesis_proto_init() } +func file_vault_v1_genesis_proto_init() { + if File_vault_v1_genesis_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_vault_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_vault_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_vault_v1_genesis_proto_goTypes, + DependencyIndexes: file_vault_v1_genesis_proto_depIdxs, + MessageInfos: file_vault_v1_genesis_proto_msgTypes, + }.Build() + File_vault_v1_genesis_proto = out.File + file_vault_v1_genesis_proto_rawDesc = nil + file_vault_v1_genesis_proto_goTypes = nil + file_vault_v1_genesis_proto_depIdxs = nil +} diff --git a/api/vault/v1/query.pulsar.go b/api/vault/v1/query.pulsar.go new file mode 100644 index 000000000..7cd917edb --- /dev/null +++ b/api/vault/v1/query.pulsar.go @@ -0,0 +1,3881 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package vaultv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_vault_v1_query_proto_init() + md_QueryParamsRequest = File_vault_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_query_proto_init() + md_QueryParamsResponse = File_vault_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryIPFSRequest protoreflect.MessageDescriptor +) + +func init() { + file_vault_v1_query_proto_init() + md_QueryIPFSRequest = File_vault_v1_query_proto.Messages().ByName("QueryIPFSRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryIPFSRequest)(nil) + +type fastReflection_QueryIPFSRequest QueryIPFSRequest + +func (x *QueryIPFSRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryIPFSRequest)(x) +} + +func (x *QueryIPFSRequest) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryIPFSRequest_messageType fastReflection_QueryIPFSRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryIPFSRequest_messageType{} + +type fastReflection_QueryIPFSRequest_messageType struct{} + +func (x fastReflection_QueryIPFSRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryIPFSRequest)(nil) +} +func (x fastReflection_QueryIPFSRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryIPFSRequest) +} +func (x fastReflection_QueryIPFSRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIPFSRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryIPFSRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIPFSRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryIPFSRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryIPFSRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryIPFSRequest) New() protoreflect.Message { + return new(fastReflection_QueryIPFSRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryIPFSRequest) Interface() protoreflect.ProtoMessage { + return (*QueryIPFSRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryIPFSRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryIPFSRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIPFSRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryIPFSRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIPFSRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIPFSRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryIPFSRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryIPFSRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.QueryIPFSRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryIPFSRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIPFSRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryIPFSRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryIPFSRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryIPFSRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryIPFSRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryIPFSRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIPFSRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIPFSRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryIPFSResponse protoreflect.MessageDescriptor + fd_QueryIPFSResponse_ipfs protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_query_proto_init() + md_QueryIPFSResponse = File_vault_v1_query_proto.Messages().ByName("QueryIPFSResponse") + fd_QueryIPFSResponse_ipfs = md_QueryIPFSResponse.Fields().ByName("ipfs") +} + +var _ protoreflect.Message = (*fastReflection_QueryIPFSResponse)(nil) + +type fastReflection_QueryIPFSResponse QueryIPFSResponse + +func (x *QueryIPFSResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryIPFSResponse)(x) +} + +func (x *QueryIPFSResponse) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryIPFSResponse_messageType fastReflection_QueryIPFSResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryIPFSResponse_messageType{} + +type fastReflection_QueryIPFSResponse_messageType struct{} + +func (x fastReflection_QueryIPFSResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryIPFSResponse)(nil) +} +func (x fastReflection_QueryIPFSResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryIPFSResponse) +} +func (x fastReflection_QueryIPFSResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIPFSResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryIPFSResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIPFSResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryIPFSResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryIPFSResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryIPFSResponse) New() protoreflect.Message { + return new(fastReflection_QueryIPFSResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryIPFSResponse) Interface() protoreflect.ProtoMessage { + return (*QueryIPFSResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryIPFSResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Ipfs != false { + value := protoreflect.ValueOfBool(x.Ipfs) + if !f(fd_QueryIPFSResponse_ipfs, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryIPFSResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.QueryIPFSResponse.ipfs": + return x.Ipfs != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIPFSResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.QueryIPFSResponse.ipfs": + x.Ipfs = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryIPFSResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.QueryIPFSResponse.ipfs": + value := x.Ipfs + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIPFSResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.QueryIPFSResponse.ipfs": + x.Ipfs = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIPFSResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.QueryIPFSResponse.ipfs": + panic(fmt.Errorf("field ipfs of message vault.v1.QueryIPFSResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryIPFSResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.QueryIPFSResponse.ipfs": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + } + panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryIPFSResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.QueryIPFSResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryIPFSResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIPFSResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryIPFSResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryIPFSResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryIPFSResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Ipfs { + n += 2 + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryIPFSResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Ipfs { + i-- + if x.Ipfs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryIPFSResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIPFSResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIPFSResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Ipfs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Ipfs = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_SyncRequest protoreflect.MessageDescriptor + fd_SyncRequest_did protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_query_proto_init() + md_SyncRequest = File_vault_v1_query_proto.Messages().ByName("SyncRequest") + fd_SyncRequest_did = md_SyncRequest.Fields().ByName("did") +} + +var _ protoreflect.Message = (*fastReflection_SyncRequest)(nil) + +type fastReflection_SyncRequest SyncRequest + +func (x *SyncRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_SyncRequest)(x) +} + +func (x *SyncRequest) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_SyncRequest_messageType fastReflection_SyncRequest_messageType +var _ protoreflect.MessageType = fastReflection_SyncRequest_messageType{} + +type fastReflection_SyncRequest_messageType struct{} + +func (x fastReflection_SyncRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_SyncRequest)(nil) +} +func (x fastReflection_SyncRequest_messageType) New() protoreflect.Message { + return new(fastReflection_SyncRequest) +} +func (x fastReflection_SyncRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SyncRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SyncRequest) Descriptor() protoreflect.MessageDescriptor { + return md_SyncRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_SyncRequest) Type() protoreflect.MessageType { + return _fastReflection_SyncRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SyncRequest) New() protoreflect.Message { + return new(fastReflection_SyncRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SyncRequest) Interface() protoreflect.ProtoMessage { + return (*SyncRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_SyncRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_SyncRequest_did, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_SyncRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.SyncRequest.did": + return x.Did != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncRequest")) + } + panic(fmt.Errorf("message vault.v1.SyncRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SyncRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.SyncRequest.did": + x.Did = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncRequest")) + } + panic(fmt.Errorf("message vault.v1.SyncRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_SyncRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.SyncRequest.did": + value := x.Did + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncRequest")) + } + panic(fmt.Errorf("message vault.v1.SyncRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SyncRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.SyncRequest.did": + x.Did = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncRequest")) + } + panic(fmt.Errorf("message vault.v1.SyncRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SyncRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.SyncRequest.did": + panic(fmt.Errorf("field did of message vault.v1.SyncRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncRequest")) + } + panic(fmt.Errorf("message vault.v1.SyncRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_SyncRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.SyncRequest.did": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncRequest")) + } + panic(fmt.Errorf("message vault.v1.SyncRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_SyncRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.SyncRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_SyncRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SyncRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_SyncRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_SyncRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SyncRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Did) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*SyncRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*SyncRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SyncRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SyncRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_SyncResponse protoreflect.MessageDescriptor + fd_SyncResponse_success protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_query_proto_init() + md_SyncResponse = File_vault_v1_query_proto.Messages().ByName("SyncResponse") + fd_SyncResponse_success = md_SyncResponse.Fields().ByName("success") +} + +var _ protoreflect.Message = (*fastReflection_SyncResponse)(nil) + +type fastReflection_SyncResponse SyncResponse + +func (x *SyncResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_SyncResponse)(x) +} + +func (x *SyncResponse) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_SyncResponse_messageType fastReflection_SyncResponse_messageType +var _ protoreflect.MessageType = fastReflection_SyncResponse_messageType{} + +type fastReflection_SyncResponse_messageType struct{} + +func (x fastReflection_SyncResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_SyncResponse)(nil) +} +func (x fastReflection_SyncResponse_messageType) New() protoreflect.Message { + return new(fastReflection_SyncResponse) +} +func (x fastReflection_SyncResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SyncResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SyncResponse) Descriptor() protoreflect.MessageDescriptor { + return md_SyncResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_SyncResponse) Type() protoreflect.MessageType { + return _fastReflection_SyncResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SyncResponse) New() protoreflect.Message { + return new(fastReflection_SyncResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SyncResponse) Interface() protoreflect.ProtoMessage { + return (*SyncResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_SyncResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_SyncResponse_success, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_SyncResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.SyncResponse.success": + return x.Success != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncResponse")) + } + panic(fmt.Errorf("message vault.v1.SyncResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SyncResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.SyncResponse.success": + x.Success = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncResponse")) + } + panic(fmt.Errorf("message vault.v1.SyncResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_SyncResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.SyncResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncResponse")) + } + panic(fmt.Errorf("message vault.v1.SyncResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SyncResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.SyncResponse.success": + x.Success = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncResponse")) + } + panic(fmt.Errorf("message vault.v1.SyncResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SyncResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.SyncResponse.success": + panic(fmt.Errorf("field success of message vault.v1.SyncResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncResponse")) + } + panic(fmt.Errorf("message vault.v1.SyncResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_SyncResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.SyncResponse.success": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.SyncResponse")) + } + panic(fmt.Errorf("message vault.v1.SyncResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_SyncResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.SyncResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_SyncResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SyncResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_SyncResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_SyncResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SyncResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Success { + n += 2 + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*SyncResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Success { + i-- + if x.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*SyncResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SyncResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SyncResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Success = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_BuildTxRequest protoreflect.MessageDescriptor + fd_BuildTxRequest_did protoreflect.FieldDescriptor + fd_BuildTxRequest_pkl protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_query_proto_init() + md_BuildTxRequest = File_vault_v1_query_proto.Messages().ByName("BuildTxRequest") + fd_BuildTxRequest_did = md_BuildTxRequest.Fields().ByName("did") + fd_BuildTxRequest_pkl = md_BuildTxRequest.Fields().ByName("pkl") +} + +var _ protoreflect.Message = (*fastReflection_BuildTxRequest)(nil) + +type fastReflection_BuildTxRequest BuildTxRequest + +func (x *BuildTxRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_BuildTxRequest)(x) +} + +func (x *BuildTxRequest) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_BuildTxRequest_messageType fastReflection_BuildTxRequest_messageType +var _ protoreflect.MessageType = fastReflection_BuildTxRequest_messageType{} + +type fastReflection_BuildTxRequest_messageType struct{} + +func (x fastReflection_BuildTxRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_BuildTxRequest)(nil) +} +func (x fastReflection_BuildTxRequest_messageType) New() protoreflect.Message { + return new(fastReflection_BuildTxRequest) +} +func (x fastReflection_BuildTxRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BuildTxRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BuildTxRequest) Descriptor() protoreflect.MessageDescriptor { + return md_BuildTxRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_BuildTxRequest) Type() protoreflect.MessageType { + return _fastReflection_BuildTxRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BuildTxRequest) New() protoreflect.Message { + return new(fastReflection_BuildTxRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BuildTxRequest) Interface() protoreflect.ProtoMessage { + return (*BuildTxRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_BuildTxRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_BuildTxRequest_did, value) { + return + } + } + if x.Pkl != "" { + value := protoreflect.ValueOfString(x.Pkl) + if !f(fd_BuildTxRequest_pkl, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_BuildTxRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.BuildTxRequest.did": + return x.Did != "" + case "vault.v1.BuildTxRequest.pkl": + return x.Pkl != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) + } + panic(fmt.Errorf("message vault.v1.BuildTxRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BuildTxRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.BuildTxRequest.did": + x.Did = "" + case "vault.v1.BuildTxRequest.pkl": + x.Pkl = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) + } + panic(fmt.Errorf("message vault.v1.BuildTxRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_BuildTxRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.BuildTxRequest.did": + value := x.Did + return protoreflect.ValueOfString(value) + case "vault.v1.BuildTxRequest.pkl": + value := x.Pkl + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) + } + panic(fmt.Errorf("message vault.v1.BuildTxRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BuildTxRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.BuildTxRequest.did": + x.Did = value.Interface().(string) + case "vault.v1.BuildTxRequest.pkl": + x.Pkl = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) + } + panic(fmt.Errorf("message vault.v1.BuildTxRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BuildTxRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.BuildTxRequest.did": + panic(fmt.Errorf("field did of message vault.v1.BuildTxRequest is not mutable")) + case "vault.v1.BuildTxRequest.pkl": + panic(fmt.Errorf("field pkl of message vault.v1.BuildTxRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) + } + panic(fmt.Errorf("message vault.v1.BuildTxRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_BuildTxRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.BuildTxRequest.did": + return protoreflect.ValueOfString("") + case "vault.v1.BuildTxRequest.pkl": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) + } + panic(fmt.Errorf("message vault.v1.BuildTxRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_BuildTxRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.BuildTxRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_BuildTxRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BuildTxRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_BuildTxRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_BuildTxRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BuildTxRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Did) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Pkl) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*BuildTxRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Pkl) > 0 { + i -= len(x.Pkl) + copy(dAtA[i:], x.Pkl) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Pkl))) + i-- + dAtA[i] = 0x12 + } + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*BuildTxRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BuildTxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BuildTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pkl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Pkl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_BuildTxResponse protoreflect.MessageDescriptor + fd_BuildTxResponse_success protoreflect.FieldDescriptor + fd_BuildTxResponse_tx protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_query_proto_init() + md_BuildTxResponse = File_vault_v1_query_proto.Messages().ByName("BuildTxResponse") + fd_BuildTxResponse_success = md_BuildTxResponse.Fields().ByName("success") + fd_BuildTxResponse_tx = md_BuildTxResponse.Fields().ByName("tx") +} + +var _ protoreflect.Message = (*fastReflection_BuildTxResponse)(nil) + +type fastReflection_BuildTxResponse BuildTxResponse + +func (x *BuildTxResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_BuildTxResponse)(x) +} + +func (x *BuildTxResponse) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_query_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_BuildTxResponse_messageType fastReflection_BuildTxResponse_messageType +var _ protoreflect.MessageType = fastReflection_BuildTxResponse_messageType{} + +type fastReflection_BuildTxResponse_messageType struct{} + +func (x fastReflection_BuildTxResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_BuildTxResponse)(nil) +} +func (x fastReflection_BuildTxResponse_messageType) New() protoreflect.Message { + return new(fastReflection_BuildTxResponse) +} +func (x fastReflection_BuildTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BuildTxResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BuildTxResponse) Descriptor() protoreflect.MessageDescriptor { + return md_BuildTxResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_BuildTxResponse) Type() protoreflect.MessageType { + return _fastReflection_BuildTxResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BuildTxResponse) New() protoreflect.Message { + return new(fastReflection_BuildTxResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BuildTxResponse) Interface() protoreflect.ProtoMessage { + return (*BuildTxResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_BuildTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_BuildTxResponse_success, value) { + return + } + } + if x.Tx != "" { + value := protoreflect.ValueOfString(x.Tx) + if !f(fd_BuildTxResponse_tx, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_BuildTxResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.BuildTxResponse.success": + return x.Success != false + case "vault.v1.BuildTxResponse.tx": + return x.Tx != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) + } + panic(fmt.Errorf("message vault.v1.BuildTxResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BuildTxResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.BuildTxResponse.success": + x.Success = false + case "vault.v1.BuildTxResponse.tx": + x.Tx = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) + } + panic(fmt.Errorf("message vault.v1.BuildTxResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_BuildTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.BuildTxResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + case "vault.v1.BuildTxResponse.tx": + value := x.Tx + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) + } + panic(fmt.Errorf("message vault.v1.BuildTxResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BuildTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.BuildTxResponse.success": + x.Success = value.Bool() + case "vault.v1.BuildTxResponse.tx": + x.Tx = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) + } + panic(fmt.Errorf("message vault.v1.BuildTxResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BuildTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.BuildTxResponse.success": + panic(fmt.Errorf("field success of message vault.v1.BuildTxResponse is not mutable")) + case "vault.v1.BuildTxResponse.tx": + panic(fmt.Errorf("field tx of message vault.v1.BuildTxResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) + } + panic(fmt.Errorf("message vault.v1.BuildTxResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_BuildTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.BuildTxResponse.success": + return protoreflect.ValueOfBool(false) + case "vault.v1.BuildTxResponse.tx": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) + } + panic(fmt.Errorf("message vault.v1.BuildTxResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_BuildTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.BuildTxResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_BuildTxResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BuildTxResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_BuildTxResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_BuildTxResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BuildTxResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Success { + n += 2 + } + l = len(x.Tx) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*BuildTxResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Tx) > 0 { + i -= len(x.Tx) + copy(dAtA[i:], x.Tx) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Tx))) + i-- + dAtA[i] = 0x12 + } + if x.Success { + i-- + if x.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*BuildTxResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BuildTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BuildTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Success = bool(v != 0) + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Tx = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: vault/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_vault_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_vault_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// QueryIPFSRequest is the request type for the Query/IPFS RPC method. +type QueryIPFSRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryIPFSRequest) Reset() { + *x = QueryIPFSRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryIPFSRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryIPFSRequest) ProtoMessage() {} + +// Deprecated: Use QueryIPFSRequest.ProtoReflect.Descriptor instead. +func (*QueryIPFSRequest) Descriptor() ([]byte, []int) { + return file_vault_v1_query_proto_rawDescGZIP(), []int{2} +} + +// QueryIPFSResponse is the response type for the Query/IPFS RPC method. +type QueryIPFSResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // IPFS is the IPFS client status. + Ipfs bool `protobuf:"varint,1,opt,name=ipfs,proto3" json:"ipfs,omitempty"` +} + +func (x *QueryIPFSResponse) Reset() { + *x = QueryIPFSResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryIPFSResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryIPFSResponse) ProtoMessage() {} + +// Deprecated: Use QueryIPFSResponse.ProtoReflect.Descriptor instead. +func (*QueryIPFSResponse) Descriptor() ([]byte, []int) { + return file_vault_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryIPFSResponse) GetIpfs() bool { + if x != nil { + return x.Ipfs + } + return false +} + +// SyncRequest is the request type for the Sync RPC method. +type SyncRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` +} + +func (x *SyncRequest) Reset() { + *x = SyncRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncRequest) ProtoMessage() {} + +// Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead. +func (*SyncRequest) Descriptor() ([]byte, []int) { + return file_vault_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *SyncRequest) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +// SyncResponse is the response type for the Sync RPC method. +type SyncResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *SyncResponse) Reset() { + *x = SyncResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncResponse) ProtoMessage() {} + +// Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead. +func (*SyncResponse) Descriptor() ([]byte, []int) { + return file_vault_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *SyncResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +// BuildTxRequest is the request type for the BuildTx RPC method. +type BuildTxRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Pkl string `protobuf:"bytes,2,opt,name=pkl,proto3" json:"pkl,omitempty"` +} + +func (x *BuildTxRequest) Reset() { + *x = BuildTxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BuildTxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuildTxRequest) ProtoMessage() {} + +// Deprecated: Use BuildTxRequest.ProtoReflect.Descriptor instead. +func (*BuildTxRequest) Descriptor() ([]byte, []int) { + return file_vault_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *BuildTxRequest) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +func (x *BuildTxRequest) GetPkl() string { + if x != nil { + return x.Pkl + } + return "" +} + +// BuildTxResponse is the response type for the BuildTx RPC method. +type BuildTxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Tx string `protobuf:"bytes,2,opt,name=tx,proto3" json:"tx,omitempty"` +} + +func (x *BuildTxResponse) Reset() { + *x = BuildTxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BuildTxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuildTxResponse) ProtoMessage() {} + +// Deprecated: Use BuildTxResponse.ProtoReflect.Descriptor instead. +func (*BuildTxResponse) Descriptor() ([]byte, []int) { + return file_vault_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *BuildTxResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *BuildTxResponse) GetTx() string { + if x != nil { + return x.Tx + } + return "" +} + +var File_vault_v1_query_proto protoreflect.FileDescriptor + +var file_vault_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, + 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, + 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x13, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x12, 0x0a, + 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x50, 0x46, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x27, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x50, 0x46, 0x53, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x70, 0x66, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x70, 0x66, 0x73, 0x22, 0x1f, 0x0a, 0x0b, 0x53, 0x79, + 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x0c, 0x53, + 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x34, 0x0a, 0x0e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x78, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6b, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6b, 0x6c, 0x22, 0x3b, 0x0a, 0x0f, 0x42, + 0x75, 0x69, 0x6c, 0x64, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x78, 0x32, 0x92, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x5f, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x76, + 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x61, 0x75, + 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x12, 0x12, 0x10, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x07, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x78, 0x12, 0x18, + 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x54, + 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x76, 0x61, + 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x74, 0x78, 0x12, 0x4d, + 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x15, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, 0x0e, 0x2f, + 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x88, 0x01, + 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, + 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, + 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, + 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, + 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_vault_v1_query_proto_rawDescOnce sync.Once + file_vault_v1_query_proto_rawDescData = file_vault_v1_query_proto_rawDesc +) + +func file_vault_v1_query_proto_rawDescGZIP() []byte { + file_vault_v1_query_proto_rawDescOnce.Do(func() { + file_vault_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_vault_v1_query_proto_rawDescData) + }) + return file_vault_v1_query_proto_rawDescData +} + +var file_vault_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_vault_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: vault.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: vault.v1.QueryParamsResponse + (*QueryIPFSRequest)(nil), // 2: vault.v1.QueryIPFSRequest + (*QueryIPFSResponse)(nil), // 3: vault.v1.QueryIPFSResponse + (*SyncRequest)(nil), // 4: vault.v1.SyncRequest + (*SyncResponse)(nil), // 5: vault.v1.SyncResponse + (*BuildTxRequest)(nil), // 6: vault.v1.BuildTxRequest + (*BuildTxResponse)(nil), // 7: vault.v1.BuildTxResponse + (*Params)(nil), // 8: vault.v1.Params +} +var file_vault_v1_query_proto_depIdxs = []int32{ + 8, // 0: vault.v1.QueryParamsResponse.params:type_name -> vault.v1.Params + 0, // 1: vault.v1.Query.Params:input_type -> vault.v1.QueryParamsRequest + 6, // 2: vault.v1.Query.BuildTx:input_type -> vault.v1.BuildTxRequest + 4, // 3: vault.v1.Query.Sync:input_type -> vault.v1.SyncRequest + 1, // 4: vault.v1.Query.Params:output_type -> vault.v1.QueryParamsResponse + 7, // 5: vault.v1.Query.BuildTx:output_type -> vault.v1.BuildTxResponse + 5, // 6: vault.v1.Query.Sync:output_type -> vault.v1.SyncResponse + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_vault_v1_query_proto_init() } +func file_vault_v1_query_proto_init() { + if File_vault_v1_query_proto != nil { + return + } + file_vault_v1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_vault_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryIPFSRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryIPFSResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BuildTxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BuildTxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_vault_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_vault_v1_query_proto_goTypes, + DependencyIndexes: file_vault_v1_query_proto_depIdxs, + MessageInfos: file_vault_v1_query_proto_msgTypes, + }.Build() + File_vault_v1_query_proto = out.File + file_vault_v1_query_proto_rawDesc = nil + file_vault_v1_query_proto_goTypes = nil + file_vault_v1_query_proto_depIdxs = nil +} diff --git a/api/vault/v1/query_grpc.pb.go b/api/vault/v1/query_grpc.pb.go new file mode 100644 index 000000000..8b371f4f5 --- /dev/null +++ b/api/vault/v1/query_grpc.pb.go @@ -0,0 +1,191 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: vault/v1/query.proto + +package vaultv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Params_FullMethodName = "/vault.v1.Query/Params" + Query_BuildTx_FullMethodName = "/vault.v1.Query/BuildTx" + Query_Sync_FullMethodName = "/vault.v1.Query/Sync" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Params queries all parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // BuildTx builds an unsigned transaction message for the given PKL. + BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) + // Sync queries the DID document by its id. And returns the required PKL + // information + Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) { + out := new(BuildTxResponse) + err := c.cc.Invoke(ctx, Query_BuildTx_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) { + out := new(SyncResponse) + err := c.cc.Invoke(ctx, Query_Sync_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Params queries all parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // BuildTx builds an unsigned transaction message for the given PKL. + BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) + // Sync queries the DID document by its id. And returns the required PKL + // information + Sync(context.Context, *SyncRequest) (*SyncResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuildTx not implemented") +} +func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BuildTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BuildTxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BuildTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_BuildTx_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BuildTx(ctx, req.(*BuildTxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Sync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Sync_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Sync(ctx, req.(*SyncRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "vault.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "BuildTx", + Handler: _Query_BuildTx_Handler, + }, + { + MethodName: "Sync", + Handler: _Query_Sync_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "vault/v1/query.proto", +} diff --git a/api/vault/v1/state.cosmos_orm.go b/api/vault/v1/state.cosmos_orm.go new file mode 100644 index 000000000..0e6141446 --- /dev/null +++ b/api/vault/v1/state.cosmos_orm.go @@ -0,0 +1,166 @@ +// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT. + +package vaultv1 + +import ( + context "context" + ormlist "cosmossdk.io/orm/model/ormlist" + ormtable "cosmossdk.io/orm/model/ormtable" + ormerrors "cosmossdk.io/orm/types/ormerrors" +) + +type DWNTable interface { + Insert(ctx context.Context, dWN *DWN) error + Update(ctx context.Context, dWN *DWN) error + Save(ctx context.Context, dWN *DWN) error + Delete(ctx context.Context, dWN *DWN) error + Has(ctx context.Context, account []byte) (found bool, err error) + // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + Get(ctx context.Context, account []byte) (*DWN, error) + List(ctx context.Context, prefixKey DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error) + ListRange(ctx context.Context, from, to DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error) + DeleteBy(ctx context.Context, prefixKey DWNIndexKey) error + DeleteRange(ctx context.Context, from, to DWNIndexKey) error + + doNotImplement() +} + +type DWNIterator struct { + ormtable.Iterator +} + +func (i DWNIterator) Value() (*DWN, error) { + var dWN DWN + err := i.UnmarshalMessage(&dWN) + return &dWN, err +} + +type DWNIndexKey interface { + id() uint32 + values() []interface{} + dWNIndexKey() +} + +// primary key starting index.. +type DWNPrimaryKey = DWNAccountIndexKey + +type DWNAccountIndexKey struct { + vs []interface{} +} + +func (x DWNAccountIndexKey) id() uint32 { return 0 } +func (x DWNAccountIndexKey) values() []interface{} { return x.vs } +func (x DWNAccountIndexKey) dWNIndexKey() {} + +func (this DWNAccountIndexKey) WithAccount(account []byte) DWNAccountIndexKey { + this.vs = []interface{}{account} + return this +} + +type DWNAmountIndexKey struct { + vs []interface{} +} + +func (x DWNAmountIndexKey) id() uint32 { return 1 } +func (x DWNAmountIndexKey) values() []interface{} { return x.vs } +func (x DWNAmountIndexKey) dWNIndexKey() {} + +func (this DWNAmountIndexKey) WithAmount(amount uint64) DWNAmountIndexKey { + this.vs = []interface{}{amount} + return this +} + +type dWNTable struct { + table ormtable.Table +} + +func (this dWNTable) Insert(ctx context.Context, dWN *DWN) error { + return this.table.Insert(ctx, dWN) +} + +func (this dWNTable) Update(ctx context.Context, dWN *DWN) error { + return this.table.Update(ctx, dWN) +} + +func (this dWNTable) Save(ctx context.Context, dWN *DWN) error { + return this.table.Save(ctx, dWN) +} + +func (this dWNTable) Delete(ctx context.Context, dWN *DWN) error { + return this.table.Delete(ctx, dWN) +} + +func (this dWNTable) Has(ctx context.Context, account []byte) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, account) +} + +func (this dWNTable) Get(ctx context.Context, account []byte) (*DWN, error) { + var dWN DWN + found, err := this.table.PrimaryKey().Get(ctx, &dWN, account) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &dWN, nil +} + +func (this dWNTable) List(ctx context.Context, prefixKey DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error) { + it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) + return DWNIterator{it}, err +} + +func (this dWNTable) ListRange(ctx context.Context, from, to DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error) { + it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) + return DWNIterator{it}, err +} + +func (this dWNTable) DeleteBy(ctx context.Context, prefixKey DWNIndexKey) error { + return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) +} + +func (this dWNTable) DeleteRange(ctx context.Context, from, to DWNIndexKey) error { + return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) +} + +func (this dWNTable) doNotImplement() {} + +var _ DWNTable = dWNTable{} + +func NewDWNTable(db ormtable.Schema) (DWNTable, error) { + table := db.GetTable(&DWN{}) + if table == nil { + return nil, ormerrors.TableNotFound.Wrap(string((&DWN{}).ProtoReflect().Descriptor().FullName())) + } + return dWNTable{table}, nil +} + +type StateStore interface { + DWNTable() DWNTable + + doNotImplement() +} + +type stateStore struct { + dWN DWNTable +} + +func (x stateStore) DWNTable() DWNTable { + return x.dWN +} + +func (stateStore) doNotImplement() {} + +var _ StateStore = stateStore{} + +func NewStateStore(db ormtable.Schema) (StateStore, error) { + dWNTable, err := NewDWNTable(db) + if err != nil { + return nil, err + } + + return stateStore{ + dWNTable, + }, nil +} diff --git a/api/vault/v1/state.pulsar.go b/api/vault/v1/state.pulsar.go new file mode 100644 index 000000000..b99a0cbe6 --- /dev/null +++ b/api/vault/v1/state.pulsar.go @@ -0,0 +1,627 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package vaultv1 + +import ( + _ "cosmossdk.io/api/cosmos/orm/v1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_DWN protoreflect.MessageDescriptor + fd_DWN_account protoreflect.FieldDescriptor + fd_DWN_amount protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_state_proto_init() + md_DWN = File_vault_v1_state_proto.Messages().ByName("DWN") + fd_DWN_account = md_DWN.Fields().ByName("account") + fd_DWN_amount = md_DWN.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_DWN)(nil) + +type fastReflection_DWN DWN + +func (x *DWN) ProtoReflect() protoreflect.Message { + return (*fastReflection_DWN)(x) +} + +func (x *DWN) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_state_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DWN_messageType fastReflection_DWN_messageType +var _ protoreflect.MessageType = fastReflection_DWN_messageType{} + +type fastReflection_DWN_messageType struct{} + +func (x fastReflection_DWN_messageType) Zero() protoreflect.Message { + return (*fastReflection_DWN)(nil) +} +func (x fastReflection_DWN_messageType) New() protoreflect.Message { + return new(fastReflection_DWN) +} +func (x fastReflection_DWN_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DWN +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DWN) Descriptor() protoreflect.MessageDescriptor { + return md_DWN +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DWN) Type() protoreflect.MessageType { + return _fastReflection_DWN_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DWN) New() protoreflect.Message { + return new(fastReflection_DWN) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DWN) Interface() protoreflect.ProtoMessage { + return (*DWN)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DWN) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Account) != 0 { + value := protoreflect.ValueOfBytes(x.Account) + if !f(fd_DWN_account, value) { + return + } + } + if x.Amount != uint64(0) { + value := protoreflect.ValueOfUint64(x.Amount) + if !f(fd_DWN_amount, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DWN) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.DWN.account": + return len(x.Account) != 0 + case "vault.v1.DWN.amount": + return x.Amount != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) + } + panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DWN) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.DWN.account": + x.Account = nil + case "vault.v1.DWN.amount": + x.Amount = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) + } + panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DWN) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.DWN.account": + value := x.Account + return protoreflect.ValueOfBytes(value) + case "vault.v1.DWN.amount": + value := x.Amount + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) + } + panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DWN) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.DWN.account": + x.Account = value.Bytes() + case "vault.v1.DWN.amount": + x.Amount = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) + } + panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DWN) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.DWN.account": + panic(fmt.Errorf("field account of message vault.v1.DWN is not mutable")) + case "vault.v1.DWN.amount": + panic(fmt.Errorf("field amount of message vault.v1.DWN is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) + } + panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DWN) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.DWN.account": + return protoreflect.ValueOfBytes(nil) + case "vault.v1.DWN.amount": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) + } + panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DWN) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.DWN", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DWN) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DWN) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DWN) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DWN) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DWN) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Account) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Amount != 0 { + n += 1 + runtime.Sov(uint64(x.Amount)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DWN) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Amount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Amount)) + i-- + dAtA[i] = 0x10 + } + if len(x.Account) > 0 { + i -= len(x.Account) + copy(dAtA[i:], x.Account) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Account))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DWN) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DWN: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DWN: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Account = append(x.Account[:0], dAtA[iNdEx:postIndex]...) + if x.Account == nil { + x.Account = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + x.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: vault/v1/state.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type DWN struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *DWN) Reset() { + *x = DWN{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_state_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DWN) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DWN) ProtoMessage() {} + +// Deprecated: Use DWN.ProtoReflect.Descriptor instead. +func (*DWN) Descriptor() ([]byte, []int) { + return file_vault_v1_state_proto_rawDescGZIP(), []int{0} +} + +func (x *DWN) GetAccount() []byte { + if x != nil { + return x.Account + } + return nil +} + +func (x *DWN) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +var File_vault_v1_state_proto protoreflect.FileDescriptor + +var file_vault_v1_state_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, + 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, + 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x03, 0x44, 0x57, 0x4e, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x3a, 0x1f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, 0x0a, 0x09, 0x0a, 0x07, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x10, + 0x01, 0x18, 0x01, 0x42, 0x88, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, + 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, + 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_vault_v1_state_proto_rawDescOnce sync.Once + file_vault_v1_state_proto_rawDescData = file_vault_v1_state_proto_rawDesc +) + +func file_vault_v1_state_proto_rawDescGZIP() []byte { + file_vault_v1_state_proto_rawDescOnce.Do(func() { + file_vault_v1_state_proto_rawDescData = protoimpl.X.CompressGZIP(file_vault_v1_state_proto_rawDescData) + }) + return file_vault_v1_state_proto_rawDescData +} + +var file_vault_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_vault_v1_state_proto_goTypes = []interface{}{ + (*DWN)(nil), // 0: vault.v1.DWN +} +var file_vault_v1_state_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_vault_v1_state_proto_init() } +func file_vault_v1_state_proto_init() { + if File_vault_v1_state_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_vault_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DWN); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_vault_v1_state_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_vault_v1_state_proto_goTypes, + DependencyIndexes: file_vault_v1_state_proto_depIdxs, + MessageInfos: file_vault_v1_state_proto_msgTypes, + }.Build() + File_vault_v1_state_proto = out.File + file_vault_v1_state_proto_rawDesc = nil + file_vault_v1_state_proto_goTypes = nil + file_vault_v1_state_proto_depIdxs = nil +} diff --git a/api/vault/v1/tx.pulsar.go b/api/vault/v1/tx.pulsar.go new file mode 100644 index 000000000..48e2deae1 --- /dev/null +++ b/api/vault/v1/tx.pulsar.go @@ -0,0 +1,2388 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package vaultv1 + +import ( + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_tx_proto_init() + md_MsgUpdateParams = File_vault_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "vault.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.MsgUpdateParams.authority": + x.Authority = "" + case "vault.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "vault.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "vault.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "vault.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message vault.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "vault.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_vault_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_vault_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgAllocateVault protoreflect.MessageDescriptor + fd_MsgAllocateVault_authority protoreflect.FieldDescriptor + fd_MsgAllocateVault_subject protoreflect.FieldDescriptor + fd_MsgAllocateVault_origin protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_tx_proto_init() + md_MsgAllocateVault = File_vault_v1_tx_proto.Messages().ByName("MsgAllocateVault") + fd_MsgAllocateVault_authority = md_MsgAllocateVault.Fields().ByName("authority") + fd_MsgAllocateVault_subject = md_MsgAllocateVault.Fields().ByName("subject") + fd_MsgAllocateVault_origin = md_MsgAllocateVault.Fields().ByName("origin") +} + +var _ protoreflect.Message = (*fastReflection_MsgAllocateVault)(nil) + +type fastReflection_MsgAllocateVault MsgAllocateVault + +func (x *MsgAllocateVault) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAllocateVault)(x) +} + +func (x *MsgAllocateVault) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgAllocateVault_messageType fastReflection_MsgAllocateVault_messageType +var _ protoreflect.MessageType = fastReflection_MsgAllocateVault_messageType{} + +type fastReflection_MsgAllocateVault_messageType struct{} + +func (x fastReflection_MsgAllocateVault_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAllocateVault)(nil) +} +func (x fastReflection_MsgAllocateVault_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAllocateVault) +} +func (x fastReflection_MsgAllocateVault_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAllocateVault +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgAllocateVault) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAllocateVault +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgAllocateVault) Type() protoreflect.MessageType { + return _fastReflection_MsgAllocateVault_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgAllocateVault) New() protoreflect.Message { + return new(fastReflection_MsgAllocateVault) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgAllocateVault) Interface() protoreflect.ProtoMessage { + return (*MsgAllocateVault)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgAllocateVault) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgAllocateVault_authority, value) { + return + } + } + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_MsgAllocateVault_subject, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_MsgAllocateVault_origin, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgAllocateVault) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.MsgAllocateVault.authority": + return x.Authority != "" + case "vault.v1.MsgAllocateVault.subject": + return x.Subject != "" + case "vault.v1.MsgAllocateVault.origin": + return x.Origin != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVault does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVault) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.MsgAllocateVault.authority": + x.Authority = "" + case "vault.v1.MsgAllocateVault.subject": + x.Subject = "" + case "vault.v1.MsgAllocateVault.origin": + x.Origin = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVault does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgAllocateVault) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.MsgAllocateVault.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "vault.v1.MsgAllocateVault.subject": + value := x.Subject + return protoreflect.ValueOfString(value) + case "vault.v1.MsgAllocateVault.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVault does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVault) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.MsgAllocateVault.authority": + x.Authority = value.Interface().(string) + case "vault.v1.MsgAllocateVault.subject": + x.Subject = value.Interface().(string) + case "vault.v1.MsgAllocateVault.origin": + x.Origin = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVault does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVault) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.MsgAllocateVault.authority": + panic(fmt.Errorf("field authority of message vault.v1.MsgAllocateVault is not mutable")) + case "vault.v1.MsgAllocateVault.subject": + panic(fmt.Errorf("field subject of message vault.v1.MsgAllocateVault is not mutable")) + case "vault.v1.MsgAllocateVault.origin": + panic(fmt.Errorf("field origin of message vault.v1.MsgAllocateVault is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVault does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgAllocateVault) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.MsgAllocateVault.authority": + return protoreflect.ValueOfString("") + case "vault.v1.MsgAllocateVault.subject": + return protoreflect.ValueOfString("") + case "vault.v1.MsgAllocateVault.origin": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVault does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgAllocateVault) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.MsgAllocateVault", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgAllocateVault) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVault) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgAllocateVault) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgAllocateVault) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgAllocateVault) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgAllocateVault) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgAllocateVault) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgAllocateVaultResponse protoreflect.MessageDescriptor + fd_MsgAllocateVaultResponse_cid protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_expiry_block protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_token protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_localhost protoreflect.FieldDescriptor +) + +func init() { + file_vault_v1_tx_proto_init() + md_MsgAllocateVaultResponse = File_vault_v1_tx_proto.Messages().ByName("MsgAllocateVaultResponse") + fd_MsgAllocateVaultResponse_cid = md_MsgAllocateVaultResponse.Fields().ByName("cid") + fd_MsgAllocateVaultResponse_expiry_block = md_MsgAllocateVaultResponse.Fields().ByName("expiry_block") + fd_MsgAllocateVaultResponse_token = md_MsgAllocateVaultResponse.Fields().ByName("token") + fd_MsgAllocateVaultResponse_localhost = md_MsgAllocateVaultResponse.Fields().ByName("localhost") +} + +var _ protoreflect.Message = (*fastReflection_MsgAllocateVaultResponse)(nil) + +type fastReflection_MsgAllocateVaultResponse MsgAllocateVaultResponse + +func (x *MsgAllocateVaultResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAllocateVaultResponse)(x) +} + +func (x *MsgAllocateVaultResponse) slowProtoReflect() protoreflect.Message { + mi := &file_vault_v1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgAllocateVaultResponse_messageType fastReflection_MsgAllocateVaultResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgAllocateVaultResponse_messageType{} + +type fastReflection_MsgAllocateVaultResponse_messageType struct{} + +func (x fastReflection_MsgAllocateVaultResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAllocateVaultResponse)(nil) +} +func (x fastReflection_MsgAllocateVaultResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAllocateVaultResponse) +} +func (x fastReflection_MsgAllocateVaultResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAllocateVaultResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgAllocateVaultResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAllocateVaultResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgAllocateVaultResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgAllocateVaultResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgAllocateVaultResponse) New() protoreflect.Message { + return new(fastReflection_MsgAllocateVaultResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgAllocateVaultResponse) Interface() protoreflect.ProtoMessage { + return (*MsgAllocateVaultResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgAllocateVaultResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Cid != "" { + value := protoreflect.ValueOfString(x.Cid) + if !f(fd_MsgAllocateVaultResponse_cid, value) { + return + } + } + if x.ExpiryBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.ExpiryBlock) + if !f(fd_MsgAllocateVaultResponse_expiry_block, value) { + return + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgAllocateVaultResponse_token, value) { + return + } + } + if x.Localhost != false { + value := protoreflect.ValueOfBool(x.Localhost) + if !f(fd_MsgAllocateVaultResponse_localhost, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgAllocateVaultResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "vault.v1.MsgAllocateVaultResponse.cid": + return x.Cid != "" + case "vault.v1.MsgAllocateVaultResponse.expiry_block": + return x.ExpiryBlock != int64(0) + case "vault.v1.MsgAllocateVaultResponse.token": + return x.Token != "" + case "vault.v1.MsgAllocateVaultResponse.localhost": + return x.Localhost != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVaultResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "vault.v1.MsgAllocateVaultResponse.cid": + x.Cid = "" + case "vault.v1.MsgAllocateVaultResponse.expiry_block": + x.ExpiryBlock = int64(0) + case "vault.v1.MsgAllocateVaultResponse.token": + x.Token = "" + case "vault.v1.MsgAllocateVaultResponse.localhost": + x.Localhost = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgAllocateVaultResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "vault.v1.MsgAllocateVaultResponse.cid": + value := x.Cid + return protoreflect.ValueOfString(value) + case "vault.v1.MsgAllocateVaultResponse.expiry_block": + value := x.ExpiryBlock + return protoreflect.ValueOfInt64(value) + case "vault.v1.MsgAllocateVaultResponse.token": + value := x.Token + return protoreflect.ValueOfString(value) + case "vault.v1.MsgAllocateVaultResponse.localhost": + value := x.Localhost + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVaultResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVaultResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "vault.v1.MsgAllocateVaultResponse.cid": + x.Cid = value.Interface().(string) + case "vault.v1.MsgAllocateVaultResponse.expiry_block": + x.ExpiryBlock = value.Int() + case "vault.v1.MsgAllocateVaultResponse.token": + x.Token = value.Interface().(string) + case "vault.v1.MsgAllocateVaultResponse.localhost": + x.Localhost = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVaultResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.MsgAllocateVaultResponse.cid": + panic(fmt.Errorf("field cid of message vault.v1.MsgAllocateVaultResponse is not mutable")) + case "vault.v1.MsgAllocateVaultResponse.expiry_block": + panic(fmt.Errorf("field expiry_block of message vault.v1.MsgAllocateVaultResponse is not mutable")) + case "vault.v1.MsgAllocateVaultResponse.token": + panic(fmt.Errorf("field token of message vault.v1.MsgAllocateVaultResponse is not mutable")) + case "vault.v1.MsgAllocateVaultResponse.localhost": + panic(fmt.Errorf("field localhost of message vault.v1.MsgAllocateVaultResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgAllocateVaultResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "vault.v1.MsgAllocateVaultResponse.cid": + return protoreflect.ValueOfString("") + case "vault.v1.MsgAllocateVaultResponse.expiry_block": + return protoreflect.ValueOfInt64(int64(0)) + case "vault.v1.MsgAllocateVaultResponse.token": + return protoreflect.ValueOfString("") + case "vault.v1.MsgAllocateVaultResponse.localhost": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message vault.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgAllocateVaultResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in vault.v1.MsgAllocateVaultResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgAllocateVaultResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVaultResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgAllocateVaultResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgAllocateVaultResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Cid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ExpiryBlock != 0 { + n += 1 + runtime.Sov(uint64(x.ExpiryBlock)) + } + l = len(x.Token) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Localhost { + n += 2 + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgAllocateVaultResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Localhost { + i-- + if x.Localhost { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0x1a + } + if x.ExpiryBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryBlock)) + i-- + dAtA[i] = 0x10 + } + if len(x.Cid) > 0 { + i -= len(x.Cid) + copy(dAtA[i:], x.Cid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cid))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgAllocateVaultResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVaultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpiryBlock", wireType) + } + x.ExpiryBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ExpiryBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Localhost", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Localhost = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: vault/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_vault_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_vault_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// MsgAllocateVault is the message type for the AllocateVault RPC. +type MsgAllocateVault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the service account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // subject is a unique human-defined identifier to associate with the vault. + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + // origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` +} + +func (x *MsgAllocateVault) Reset() { + *x = MsgAllocateVault{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAllocateVault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAllocateVault) ProtoMessage() {} + +// Deprecated: Use MsgAllocateVault.ProtoReflect.Descriptor instead. +func (*MsgAllocateVault) Descriptor() ([]byte, []int) { + return file_vault_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgAllocateVault) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgAllocateVault) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *MsgAllocateVault) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. +type MsgAllocateVaultResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // CID is the content identifier of the vault. + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + // ExpiryBlock is the block number at which the vault will expire. + ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` + // RegistrationOptions is a json string of the + // PublicKeyCredentialCreationOptions for WebAuthn + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + // IsLocalhost is a flag to indicate if the vault is localhost + Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"` +} + +func (x *MsgAllocateVaultResponse) Reset() { + *x = MsgAllocateVaultResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vault_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAllocateVaultResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAllocateVaultResponse) ProtoMessage() {} + +// Deprecated: Use MsgAllocateVaultResponse.ProtoReflect.Descriptor instead. +func (*MsgAllocateVaultResponse) Descriptor() ([]byte, []int) { + return file_vault_v1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *MsgAllocateVaultResponse) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +func (x *MsgAllocateVaultResponse) GetExpiryBlock() int64 { + if x != nil { + return x.ExpiryBlock + } + return 0 +} + +func (x *MsgAllocateVaultResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *MsgAllocateVaultResponse) GetLocalhost() bool { + if x != nil { + return x.Localhost + } + return false +} + +var File_vault_v1_tx_proto protoreflect.FileDescriptor + +var file_vault_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x89, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2e, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x61, + 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x41, 0x6c, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x83, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x63, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x32, 0xab, 0x01, 0x0a, 0x03, + 0x4d, 0x73, 0x67, 0x12, 0x4f, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, + 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, + 0x1a, 0x22, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, + 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x19, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x21, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x85, 0x01, 0x0a, 0x0c, 0x63, 0x6f, + 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x14, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_vault_v1_tx_proto_rawDescOnce sync.Once + file_vault_v1_tx_proto_rawDescData = file_vault_v1_tx_proto_rawDesc +) + +func file_vault_v1_tx_proto_rawDescGZIP() []byte { + file_vault_v1_tx_proto_rawDescOnce.Do(func() { + file_vault_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_vault_v1_tx_proto_rawDescData) + }) + return file_vault_v1_tx_proto_rawDescData +} + +var file_vault_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_vault_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: vault.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: vault.v1.MsgUpdateParamsResponse + (*MsgAllocateVault)(nil), // 2: vault.v1.MsgAllocateVault + (*MsgAllocateVaultResponse)(nil), // 3: vault.v1.MsgAllocateVaultResponse + (*Params)(nil), // 4: vault.v1.Params +} +var file_vault_v1_tx_proto_depIdxs = []int32{ + 4, // 0: vault.v1.MsgUpdateParams.params:type_name -> vault.v1.Params + 2, // 1: vault.v1.Msg.AllocateVault:input_type -> vault.v1.MsgAllocateVault + 0, // 2: vault.v1.Msg.UpdateParams:input_type -> vault.v1.MsgUpdateParams + 3, // 3: vault.v1.Msg.AllocateVault:output_type -> vault.v1.MsgAllocateVaultResponse + 1, // 4: vault.v1.Msg.UpdateParams:output_type -> vault.v1.MsgUpdateParamsResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_vault_v1_tx_proto_init() } +func file_vault_v1_tx_proto_init() { + if File_vault_v1_tx_proto != nil { + return + } + file_vault_v1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_vault_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgAllocateVault); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vault_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgAllocateVaultResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_vault_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_vault_v1_tx_proto_goTypes, + DependencyIndexes: file_vault_v1_tx_proto_depIdxs, + MessageInfos: file_vault_v1_tx_proto_msgTypes, + }.Build() + File_vault_v1_tx_proto = out.File + file_vault_v1_tx_proto_rawDesc = nil + file_vault_v1_tx_proto_goTypes = nil + file_vault_v1_tx_proto_depIdxs = nil +} diff --git a/api/vault/v1/tx_grpc.pb.go b/api/vault/v1/tx_grpc.pb.go new file mode 100644 index 000000000..9ba35ba81 --- /dev/null +++ b/api/vault/v1/tx_grpc.pb.go @@ -0,0 +1,158 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: vault/v1/tx.proto + +package vaultv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_AllocateVault_FullMethodName = "/vault.v1.Msg/AllocateVault" + Msg_UpdateParams_FullMethodName = "/vault.v1.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // AllocateVault assembles a sqlite3 database in a local directory and returns + // the CID of the database. this operation is called by services initiating a + // controller registration. + AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) + // UpdateParams defines a governance operation for updating the parameters. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) { + out := new(MsgAllocateVaultResponse) + err := c.cc.Invoke(ctx, Msg_AllocateVault_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // AllocateVault assembles a sqlite3 database in a local directory and returns + // the CID of the database. this operation is called by services initiating a + // controller registration. + AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) + // UpdateParams defines a governance operation for updating the parameters. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented") +} +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAllocateVault) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AllocateVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_AllocateVault_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "vault.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AllocateVault", + Handler: _Msg_AllocateVault_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "vault/v1/tx.proto", +} diff --git a/app/app.go b/app/app.go index 077441b0a..2bfec6c1c 100644 --- a/app/app.go +++ b/app/app.go @@ -134,6 +134,12 @@ import ( ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + did "github.com/onsonr/sonr/x/did" + didkeeper "github.com/onsonr/sonr/x/did/keeper" + didtypes "github.com/onsonr/sonr/x/did/types" + vault "github.com/onsonr/sonr/x/vault" + vaultkeeper "github.com/onsonr/sonr/x/vault/keeper" + vaulttypes "github.com/onsonr/sonr/x/vault/types" "github.com/spf13/cast" globalfee "github.com/strangelove-ventures/globalfee/x/globalfee" globalfeekeeper "github.com/strangelove-ventures/globalfee/x/globalfee/keeper" @@ -144,10 +150,6 @@ import ( tokenfactory "github.com/strangelove-ventures/tokenfactory/x/tokenfactory" tokenfactorykeeper "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/keeper" tokenfactorytypes "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types" - - did "github.com/onsonr/sonr/x/did" - didkeeper "github.com/onsonr/sonr/x/did/keeper" - didtypes "github.com/onsonr/sonr/x/did/types" ) const appName = "sonr" @@ -226,6 +228,7 @@ type SonrApp struct { CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper legacyAmino *codec.LegacyAmino + VaultKeeper vaultkeeper.Keeper sm *module.SimulationManager BasicModuleManager module.BasicManager ModuleManager *module.Manager @@ -358,6 +361,7 @@ func NewChainApp( globalfeetypes.StoreKey, packetforwardtypes.StoreKey, didtypes.StoreKey, + vaulttypes.StoreKey, ) tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -606,6 +610,15 @@ func NewChainApp( // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper + // Create the vault Keeper + app.VaultKeeper = vaultkeeper.NewKeeper( + appCodec, + sdkruntime.NewKVStoreService(keys[vaulttypes.StoreKey]), + logger, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.DidKeeper, + ) + // Create the did Keeper app.DidKeeper = didkeeper.NewKeeper( appCodec, @@ -874,6 +887,7 @@ func NewChainApp( ), did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper), + vault.NewAppModule(appCodec, app.VaultKeeper), ) // BasicModuleManager defines the module BasicManager is in charge of setting up basic, @@ -922,6 +936,7 @@ func NewChainApp( tokenfactorytypes.ModuleName, packetforwardtypes.ModuleName, didtypes.ModuleName, + vaulttypes.ModuleName, ) app.ModuleManager.SetOrderEndBlockers( @@ -941,6 +956,7 @@ func NewChainApp( tokenfactorytypes.ModuleName, packetforwardtypes.ModuleName, didtypes.ModuleName, + vaulttypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -969,6 +985,7 @@ func NewChainApp( globalfeetypes.ModuleName, packetforwardtypes.ModuleName, didtypes.ModuleName, + vaulttypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) @@ -1127,7 +1144,7 @@ func GetDefaultBypassFeeMessages() []string { sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenTry{}), sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenConfirm{}), sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenAck{}), - sdk.MsgTypeURL(&didtypes.MsgAllocateVault{}), + sdk.MsgTypeURL(&vaulttypes.MsgAllocateVault{}), sdk.MsgTypeURL(&didtypes.MsgRegisterController{}), } } @@ -1428,6 +1445,7 @@ func initParamsKeeper( paramsKeeper.Subspace(packetforwardtypes.ModuleName). WithKeyTable(packetforwardtypes.ParamKeyTable()) paramsKeeper.Subspace(didtypes.ModuleName) + paramsKeeper.Subspace(vaulttypes.ModuleName) return paramsKeeper } diff --git a/internal/cli/dexmodel/dexmodel.go b/app/cli/dexmodel/dexmodel.go similarity index 100% rename from internal/cli/dexmodel/dexmodel.go rename to app/cli/dexmodel/dexmodel.go diff --git a/internal/cli/tui.go b/app/cli/tui.go similarity index 74% rename from internal/cli/tui.go rename to app/cli/tui.go index f49f6c7cf..b5305baff 100644 --- a/internal/cli/tui.go +++ b/app/cli/tui.go @@ -5,17 +5,12 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/onsonr/sonr/internal/cli/dexmodel" - "github.com/onsonr/sonr/internal/cli/txmodel" + "github.com/onsonr/sonr/app/cli/dexmodel" + "github.com/onsonr/sonr/app/cli/txmodel" "github.com/spf13/cobra" ) -func AddTUICmds(rootCmd *cobra.Command) { - rootCmd.AddCommand(newBuildTxnTUICmd()) - rootCmd.AddCommand(newExplorerTUICmd()) -} - -func newBuildTxnTUICmd() *cobra.Command { +func NewBuildTxnTUICmd() *cobra.Command { return &cobra.Command{ Use: "dash", Short: "TUI for managing the local Sonr validator node", @@ -40,7 +35,7 @@ func newBuildTxnTUICmd() *cobra.Command { } } -func newExplorerTUICmd() *cobra.Command { +func NewExplorerTUICmd() *cobra.Command { return &cobra.Command{ Use: "cosmos-explorer", Short: "A terminal-based Cosmos blockchain explorer", diff --git a/internal/cli/txmodel/txmodel.go b/app/cli/txmodel/txmodel.go similarity index 100% rename from internal/cli/txmodel/txmodel.go rename to app/cli/txmodel/txmodel.go diff --git a/app/context.go b/app/context.go deleted file mode 100644 index 79de9d673..000000000 --- a/app/context.go +++ /dev/null @@ -1,23 +0,0 @@ -package app - -import ( - "context" - - "github.com/go-webauthn/webauthn/protocol" -) - -// Default Key in gRPC Metadata for the Session ID -const MetadataSessionIDKey = "sonr-session-id" - -// SonrContext is the context for the Sonr API -type SonrContext struct { - Context context.Context - SessionID string `json:"session_id"` - UserAddress string `json:"user_address"` - ValidatorAddress string `json:"validator_address"` - ServiceOrigin string `json:"service_origin"` - PeerID string `json:"peer_id"` - ChainID string `json:"chain_id"` - Token string `json:"token"` - Challenge protocol.URLEncodedBase64 `json:"challenge"` -} diff --git a/app/proxy/command.go b/app/proxy/command.go new file mode 100644 index 000000000..60416d160 --- /dev/null +++ b/app/proxy/command.go @@ -0,0 +1,56 @@ +package proxy + +import ( + "context" + "net/http" + "os" + "os/signal" + "time" + + "github.com/labstack/echo/v4" + "github.com/labstack/gommon/log" + "github.com/onsonr/sonr/nebula/pages" + "github.com/spf13/cobra" +) + +func NewProxyCmd() *cobra.Command { + return &cobra.Command{ + Use: "dwn-proxy", + Short: "Starts the DWN proxy server for the local IPFS node", + Run: func(cmd *cobra.Command, args []string) { + // Echo instance + e := echo.New() + e.Logger.SetLevel(log.INFO) + + // Load config + _, err := LoadConfig("./") + if err != nil { + e.Logger.Error(err) + } + + // Configure the server + e.GET("/", pages.Home) + e.GET("/allocate", pages.Profile) + + // Start server + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + // Start server + go func() { + if err := e.Start(":1323"); err != nil && err != http.ErrServerClosed { + e.Logger.Fatal("shutting down the server") + } + }() + + // Wait for interrupt signal to gracefully shutdown the server with a timeout of 10 seconds. + <-ctx.Done() + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + // Shutdown the server with 10 seconds timeout. + if err := e.Shutdown(ctx); err != nil { + e.Logger.Fatal(err) + } + }, + } +} diff --git a/app/proxy/config.go b/app/proxy/config.go new file mode 100644 index 000000000..cf906f035 --- /dev/null +++ b/app/proxy/config.go @@ -0,0 +1,31 @@ +package proxy + +import "github.com/spf13/viper" + +type Config struct { + Host string `mapstructure:"HOST"` + Port string `mapstructure:"PORT"` + SSL bool `mapstructure:"SSL"` + CertFile string `mapstructure:"CERT_FILE"` + KeyFile string `mapstructure:"KEY_FILE"` +} + +func (c *Config) GetHostname() string { + return c.Host + ":" + c.Port +} + +func LoadConfig(path string) (config Config, err error) { + viper.AddConfigPath(path) + viper.SetConfigName("app") + viper.SetConfigType("env") + + viper.AutomaticEnv() + + err = viper.ReadInConfig() + if err != nil { + return + } + + err = viper.Unmarshal(&config) + return +} diff --git a/cmd/sonrd/main.go b/cmd/sonrd/main.go index 5944aa356..79fc87b98 100644 --- a/cmd/sonrd/main.go +++ b/cmd/sonrd/main.go @@ -8,12 +8,15 @@ import ( _ "github.com/joho/godotenv/autoload" "github.com/onsonr/sonr/app" - "github.com/onsonr/sonr/internal/cli" + "github.com/onsonr/sonr/app/cli" + "github.com/onsonr/sonr/app/proxy" ) func main() { rootCmd := NewRootCmd() - cli.AddTUICmds(rootCmd) + rootCmd.AddCommand(cli.NewBuildTxnTUICmd()) + rootCmd.AddCommand(cli.NewExplorerTUICmd()) + rootCmd.AddCommand(proxy.NewProxyCmd()) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) diff --git a/config/pkl/orm.pkl b/config/pkl/orm.pkl index 145d89654..d08735d6d 100644 --- a/config/pkl/orm.pkl +++ b/config/pkl/orm.pkl @@ -1,6 +1,6 @@ -@go.Package { name = "github.com/onsonr/sonr/internal/orm" } +@go.Package { name = "github.com/onsonr/sonr/x/did/types/orm" } -module orm +module models import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" diff --git a/config/pkl/web.pkl b/config/pkl/web.pkl deleted file mode 100644 index ed06f3e6b..000000000 --- a/config/pkl/web.pkl +++ /dev/null @@ -1,72 +0,0 @@ -@go.Package { name = "github.com/onsonr/sonr/internal/orm/browser" } - -module browser - -import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" - - -class JsonField extends go.Field { - structTags { - ["json"] = "%{name},omitempty" - } -} - -class PublicKeyCredentialRequestOptions { - challenge: String - timeout: Int - rpId: String - allowCredentials: List - userVerification: String - extensions: List -} - -class PublicKeyCredentialDescriptor { - id: String - transports: List - type: String -} - -class PublicKeyCredentialParameters { - type: String - alg: Int? -} - -class AuthenticatorSelectionCriteria { - authenticatorAttachment: String - requireResidentKey: Boolean - userVerification: String -} - - -class PublicKeyCredentialCreationOptions { - rp: RpEntity - user: UserEntity - challenge: String - pubKeyCredParams: List - timeout: Int - excludeCredentials: List - authenticatorSelection: AuthenticatorSelectionCriteria? - attestation: String - extensions: List -} - -class RpEntity { - id: String - name: String? - icon: String? -} - -class UserEntity { - id: String - displayName: String? - name: String? -} - -class SWT { - origin: String - location: String - identifier: String - scopes: List - properties: Map - expiryBlock: Int -} diff --git a/deploy/Dockerfile b/deploy/Dockerfile deleted file mode 100644 index 19afcdb8c..000000000 --- a/deploy/Dockerfile +++ /dev/null @@ -1,89 +0,0 @@ -FROM jetpackio/devbox:latest AS sonrvm - -# Installing your devbox project -WORKDIR /code -USER root:root - -RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code - -USER ${DEVBOX_USER}:${DEVBOX_USER} - -COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json -COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} deploy/process-compose.yaml process-compose.yaml - -RUN devbox run -- echo "Installed Packages." - -ENTRYPOINT ["devbox", "run"] - -# -------------------------------------------------------- -FROM jetpackio/devbox:latest AS sonr-runner - -WORKDIR /code -USER root:root - -RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code - -USER ${DEVBOX_USER}:${DEVBOX_USER} - -COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json -COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} deploy/process-compose.yaml process-compose.yaml -COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} . . - -RUN devbox run -- echo "Installed Packages." - -RUN git config --global --add safe.directory /code -ENTRYPOINT ["devbox", "run", "testnet"] - -# -------------------------------------------------------- -FROM golang:1.22-alpine AS go-builder - -SHELL ["/bin/sh", "-ecuxo", "pipefail"] - -RUN apk add --no-cache ca-certificates build-base git - -WORKDIR /code - -COPY go.mod go.sum ./ -RUN set -eux; \ - export ARCH=$(uname -m); \ - WASM_VERSION=$(go list -m all | grep github.com/CosmWasm/wasmvm || true); \ - if [ ! -z "${WASM_VERSION}" ]; then \ - WASMVM_REPO=$(echo $WASM_VERSION | awk '{print $1}');\ - WASMVM_VERS=$(echo $WASM_VERSION | awk '{print $2}');\ - wget -O /lib/libwasmvm_muslc.a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a;\ - fi; \ - go mod download; - -# Copy over code -COPY . /code - -# force it to use static lib (from above) not standard libgo_cosmwasm.so file -# then log output of file /code/bin/sonrd -# then ensure static linking -RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \ - && file /code/build/sonrd \ - && echo "Ensuring binary is statically linked ..." \ - && (file /code/build/sonrd | grep "statically linked") - -# -------------------------------------------------------- -FROM debian:11-slim - -COPY --from=go-builder /code/build/sonrd /usr/bin/sonrd - -# Install dependencies for Debian 11 -RUN apt-get update && apt-get install -y \ - curl \ - make \ - bash \ - jq \ - sed \ - && rm -rf /var/lib/apt/lists/* - -COPY scripts/test_node.sh /usr/bin/test_node.sh - -WORKDIR /opt - -# rest server, tendermint p2p, tendermint rpc -EXPOSE 1317 26656 26657 6060 - -ENTRYPOINT ["/usr/bin/sonrd"] diff --git a/deploy/air.toml b/deploy/air.toml deleted file mode 100644 index b39d53c8f..000000000 --- a/deploy/air.toml +++ /dev/null @@ -1,50 +0,0 @@ -root = "." -testdata_dir = "testdata" -tmp_dir = "tmp" - -[build] -delay = 1000 -cmd = "devbox run build:motr" -exclude_dir = ["assets", "tmp", "vendor", "testdata"] -exclude_file = [] -exclude_regex = ["_test.go", ".pk.go", "_templ.go", ".pb.go"] -exclude_unchanged = true -follow_symlink = false -full_bin = "bunx wrangler -c ./pkg/proxy/wrangler.toml dev" -include_dir = ["web", "internal/dwn", "pkl"] -include_ext = ["go", "templ", "html", "pkl", "js", "mjs"] -include_file = [ - "wrangler.toml", - "Dockerfile", - ".goreleaser.yaml", - "go.mod", - "devbox.json", - ".air.toml", -] -kill_delay = "2s" -log = "build-errors.log" -poll = false -poll_interval = 0 -post_cmd = [] -pre_cmd = ["templ generate", "devbox run gen:pkl"] -rerun = false -rerun_delay = 500 -send_interrupt = false -stop_on_error = false - -[color] -build = "yellow" -main = "magenta" -runner = "green" -watcher = "cyan" - -[log] -main_only = true -time = true - -[misc] -clean_on_exit = true - -[screen] -clear_on_rebuild = true -keep_scroll = true diff --git a/deploy/docker-compose.yaml b/deploy/docker-compose.yaml deleted file mode 100644 index 9b7687ed8..000000000 --- a/deploy/docker-compose.yaml +++ /dev/null @@ -1,30 +0,0 @@ -version: "3" - -services: - sonr-node: - build: - context: . - dockerfile: Dockerfile - volumes: - - /home/prad/.scnr:/root/.sonr - ports: - - "26657:26657" - - "1317:1317" - - "9090:9090" - environment: - - CHAIN_ID=local-1 - - MONIKER=localvalidator - - KEYRING=test - - KEY=user1 - - KEY2=user2 - - DENOM=usnr - - CLEAN=true - - BLOCK_TIME=5s - command: "start --pruning=nothing" - restart: always - networks: - - sonr-network - -networks: - sonr-network: - name: sonr-network diff --git a/devbox.json b/devbox.json index 8691cb570..0952852e5 100644 --- a/devbox.json +++ b/devbox.json @@ -1,9 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json", "packages": [ - "go@1.22", - "bun@latest", - "process-compose@latest" + "go@1.22" ], "env": { "CLOUDFLARE_API_TOKEN": "$CLOUDFLARE_API_TOKEN", @@ -30,9 +28,6 @@ "build:image": [ "make local-image" ], - "build:motr": [ - "make motr" - ], "gen:proto": [ "make proto-gen" ], @@ -53,6 +48,9 @@ ], "serve:sonr": [ "make sh-testnet" + ], + "serve:proxy": [ + "make sh-testnet" ] } } diff --git a/go.mod b/go.mod index 6b3704989..dc4ba2341 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,6 @@ require ( cosmossdk.io/x/upgrade v0.1.1 github.com/a-h/templ v0.2.778 github.com/apple/pkl-go v0.8.0 - github.com/btcsuite/btcd/btcec/v2 v2.3.3 github.com/charmbracelet/bubbles v0.19.0 github.com/charmbracelet/bubbletea v1.1.0 github.com/charmbracelet/huh v0.5.3 @@ -65,11 +64,13 @@ require ( github.com/ethereum/go-ethereum v1.14.6 github.com/go-webauthn/webauthn v0.10.2 github.com/golang/protobuf v1.5.4 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/ipfs/boxo v0.21.0 github.com/ipfs/kubo v0.29.0 github.com/joho/godotenv v1.5.1 github.com/labstack/echo/v4 v4.10.2 + github.com/labstack/gommon v0.4.0 github.com/nlepage/go-js-promise v1.0.0 github.com/onsonr/crypto v1.32.0 github.com/segmentio/ksuid v1.0.4 @@ -81,7 +82,6 @@ require ( github.com/strangelove-ventures/poa v0.50.0 github.com/strangelove-ventures/tokenfactory v0.50.0 github.com/stretchr/testify v1.9.0 - github.com/syumai/workers v0.26.3 golang.org/x/crypto v0.26.0 google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 google.golang.org/grpc v1.64.0 @@ -108,6 +108,7 @@ require ( github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect github.com/btcsuite/btcd/btcutil v1.1.5 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/bwesterb/go-ristretto v1.2.3 // indirect @@ -180,7 +181,6 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/handlers v1.5.2 // indirect - github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect @@ -232,7 +232,6 @@ require ( github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/labstack/gommon v0.4.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect diff --git a/go.sum b/go.sum index 29da40697..94e1ffc63 100644 --- a/go.sum +++ b/go.sum @@ -2048,8 +2048,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/syumai/workers v0.26.3 h1:AF+IBaRccbR4JIj2kNJLJblruPFMD/pAbzkopejGcP8= -github.com/syumai/workers v0.26.3/go.mod h1:ZnqmdiHNBrbxOLrZ/HJ5jzHy6af9cmiNZk10R9NrIEA= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= diff --git a/internal/orm/bip44.go b/internal/orm/bip44.go deleted file mode 100644 index a48b40b2e..000000000 --- a/internal/orm/bip44.go +++ /dev/null @@ -1,116 +0,0 @@ -package orm - -import ( - "crypto/hmac" - "crypto/sha512" - "encoding/binary" - "encoding/hex" - "errors" - "math/big" - - "github.com/btcsuite/btcd/btcec/v2" - "github.com/onsonr/sonr/internal/orm/didmethod" -) - -type ChainCode uint32 - -func GetChainCode(m didmethod.DIDMethod) ChainCode { - switch m { - case didmethod.Bitcoin: - return 0 // 0 - case didmethod.Ethereum: - return 64 // 60 - case didmethod.Ibc: - return 118 // 118 - case didmethod.Sonr: - return 703 // 703 - default: - return 0 - } -} - -func FormatAddress(pubKey *PublicKey, m didmethod.DIDMethod) (string, error) { - hexPubKey, err := hex.DecodeString(pubKey.Raw) - if err != nil { - return "", err - } - - // switch m { - // case didmethod.Bitcoin: - // return bech32.Encode("bc", pubKey.Bytes()) - // - // case didmethod.Ethereum: - // epk, err := pubKey.ECDSA() - // if err != nil { - // return "", err - // } - // return ComputeEthAddress(*epk), nil - // - // case didmethod.Sonr: - // return bech32.Encode("idx", hexPubKey) - // - // case didmethod.Ibc: - // return bech32.Encode("cosmos", hexPubKey) - // - // } - return string(hexPubKey), nil -} - -// ComputeAccountPublicKey computes the public key of a child key given the extended public key, chain code, and index. -func ComputeBip32AccountPublicKey(extPubKey PublicKey, chainCode ChainCode, index int) (*PublicKey, error) { - // Check if the index is a hardened child key - if chainCode&0x80000000 != 0 && index < 0 { - return nil, errors.New("invalid index") - } - - hexPubKey, err := hex.DecodeString(extPubKey.Raw) - if err != nil { - return nil, err - } - - // Serialize the public key - pubKey, err := btcec.ParsePubKey(hexPubKey) - if err != nil { - return nil, err - } - pubKeyBytes := pubKey.SerializeCompressed() - - // Serialize the index - indexBytes := make([]byte, 4) - binary.BigEndian.PutUint32(indexBytes, uint32(index)) - - // Compute the HMAC-SHA512 - mac := hmac.New(sha512.New, []byte{byte(chainCode)}) - mac.Write(pubKeyBytes) - mac.Write(indexBytes) - I := mac.Sum(nil) - - // Split I into two 32-byte sequences - IL := I[:32] - - // Convert IL to a big integer - ilNum := new(big.Int).SetBytes(IL) - - // Check if parse256(IL) >= n - curve := btcec.S256() - if ilNum.Cmp(curve.N) >= 0 { - return nil, errors.New("invalid child key") - } - - // Compute the child public key - ilx, ily := curve.ScalarBaseMult(IL) - childX, childY := curve.Add(ilx, ily, pubKey.X(), pubKey.Y()) - lx := newBigIntFieldVal(childX) - ly := newBigIntFieldVal(childY) - - // Create the child public key - _ = btcec.NewPublicKey(lx, ly) - return &PublicKey{}, nil -} - -// newBigIntFieldVal creates a new field value from a big integer. -func newBigIntFieldVal(val *big.Int) *btcec.FieldVal { - lx := new(btcec.FieldVal) - lx.SetByteSlice(val.Bytes()) - return lx -} diff --git a/internal/orm/browser/AuthenticatorSelectionCriteria.pkl.go b/internal/orm/browser/AuthenticatorSelectionCriteria.pkl.go deleted file mode 100644 index a53b382f2..000000000 --- a/internal/orm/browser/AuthenticatorSelectionCriteria.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -type AuthenticatorSelectionCriteria struct { - AuthenticatorAttachment string `pkl:"authenticatorAttachment"` - - RequireResidentKey bool `pkl:"requireResidentKey"` - - UserVerification string `pkl:"userVerification"` -} diff --git a/internal/orm/browser/Browser.pkl.go b/internal/orm/browser/Browser.pkl.go deleted file mode 100644 index 3943b79a5..000000000 --- a/internal/orm/browser/Browser.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Browser struct { -} - -// LoadFromPath loads the pkl module at the given path and evaluates it into a Browser -func LoadFromPath(ctx context.Context, path string) (ret *Browser, err error) { - evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) - if err != nil { - return nil, err - } - defer func() { - cerr := evaluator.Close() - if err == nil { - err = cerr - } - }() - ret, err = Load(ctx, evaluator, pkl.FileSource(path)) - return ret, err -} - -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Browser -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Browser, error) { - var ret Browser - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/internal/orm/browser/PublicKeyCredentialCreationOptions.pkl.go b/internal/orm/browser/PublicKeyCredentialCreationOptions.pkl.go deleted file mode 100644 index db72fb8fe..000000000 --- a/internal/orm/browser/PublicKeyCredentialCreationOptions.pkl.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -type PublicKeyCredentialCreationOptions struct { - Rp *RpEntity `pkl:"rp"` - - User *UserEntity `pkl:"user"` - - Challenge string `pkl:"challenge"` - - PubKeyCredParams []*PublicKeyCredentialParameters `pkl:"pubKeyCredParams"` - - Timeout int `pkl:"timeout"` - - ExcludeCredentials []*PublicKeyCredentialDescriptor `pkl:"excludeCredentials"` - - AuthenticatorSelection *AuthenticatorSelectionCriteria `pkl:"authenticatorSelection"` - - Attestation string `pkl:"attestation"` - - Extensions []*PublicKeyCredentialParameters `pkl:"extensions"` -} diff --git a/internal/orm/browser/PublicKeyCredentialDescriptor.pkl.go b/internal/orm/browser/PublicKeyCredentialDescriptor.pkl.go deleted file mode 100644 index ac66c213b..000000000 --- a/internal/orm/browser/PublicKeyCredentialDescriptor.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -type PublicKeyCredentialDescriptor struct { - Id string `pkl:"id"` - - Transports []string `pkl:"transports"` - - Type string `pkl:"type"` -} diff --git a/internal/orm/browser/PublicKeyCredentialParameters.pkl.go b/internal/orm/browser/PublicKeyCredentialParameters.pkl.go deleted file mode 100644 index 7c7492bda..000000000 --- a/internal/orm/browser/PublicKeyCredentialParameters.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -type PublicKeyCredentialParameters struct { - Type string `pkl:"type"` - - Alg *int `pkl:"alg"` -} diff --git a/internal/orm/browser/PublicKeyCredentialRequestOptions.pkl.go b/internal/orm/browser/PublicKeyCredentialRequestOptions.pkl.go deleted file mode 100644 index f494a9fcb..000000000 --- a/internal/orm/browser/PublicKeyCredentialRequestOptions.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -type PublicKeyCredentialRequestOptions struct { - Challenge string `pkl:"challenge"` - - Timeout int `pkl:"timeout"` - - RpId string `pkl:"rpId"` - - AllowCredentials []*PublicKeyCredentialDescriptor `pkl:"allowCredentials"` - - UserVerification string `pkl:"userVerification"` - - Extensions []*PublicKeyCredentialParameters `pkl:"extensions"` -} diff --git a/internal/orm/browser/RpEntity.pkl.go b/internal/orm/browser/RpEntity.pkl.go deleted file mode 100644 index facd857a2..000000000 --- a/internal/orm/browser/RpEntity.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -type RpEntity struct { - Id string `pkl:"id"` - - Name *string `pkl:"name"` - - Icon *string `pkl:"icon"` -} diff --git a/internal/orm/browser/SWT.pkl.go b/internal/orm/browser/SWT.pkl.go deleted file mode 100644 index 32e9ebe54..000000000 --- a/internal/orm/browser/SWT.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -type SWT struct { - Origin string `pkl:"origin"` - - Location string `pkl:"location"` - - Identifier string `pkl:"identifier"` - - Scopes []string `pkl:"scopes"` - - Properties map[string]string `pkl:"properties"` - - ExpiryBlock int `pkl:"expiryBlock"` -} diff --git a/internal/orm/browser/UserEntity.pkl.go b/internal/orm/browser/UserEntity.pkl.go deleted file mode 100644 index 6b99cb2b8..000000000 --- a/internal/orm/browser/UserEntity.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -type UserEntity struct { - Id string `pkl:"id"` - - DisplayName *string `pkl:"displayName"` - - Name *string `pkl:"name"` -} diff --git a/internal/orm/browser/init.pkl.go b/internal/orm/browser/init.pkl.go deleted file mode 100644 index df843093c..000000000 --- a/internal/orm/browser/init.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `browser`. DO NOT EDIT. -package browser - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("browser", Browser{}) - pkl.RegisterMapping("browser#PublicKeyCredentialRequestOptions", PublicKeyCredentialRequestOptions{}) - pkl.RegisterMapping("browser#PublicKeyCredentialDescriptor", PublicKeyCredentialDescriptor{}) - pkl.RegisterMapping("browser#PublicKeyCredentialParameters", PublicKeyCredentialParameters{}) - pkl.RegisterMapping("browser#AuthenticatorSelectionCriteria", AuthenticatorSelectionCriteria{}) - pkl.RegisterMapping("browser#PublicKeyCredentialCreationOptions", PublicKeyCredentialCreationOptions{}) - pkl.RegisterMapping("browser#RpEntity", RpEntity{}) - pkl.RegisterMapping("browser#UserEntity", UserEntity{}) - pkl.RegisterMapping("browser#SWT", SWT{}) -} diff --git a/internal/orm/constants.go b/internal/orm/constants.go deleted file mode 100644 index 744733c81..000000000 --- a/internal/orm/constants.go +++ /dev/null @@ -1,334 +0,0 @@ -package orm - -import ( - "github.com/onsonr/sonr/x/did/types" -) - -type ( - AuthenticatorAttachment string - AuthenticatorTransport string -) - -const ( - // Platform represents a platform authenticator is attached using a client device-specific transport, called - // platform attachment, and is usually not removable from the client device. A public key credential bound to a - // platform authenticator is called a platform credential. - Platform AuthenticatorAttachment = "platform" - - // CrossPlatform represents a roaming authenticator is attached using cross-platform transports, called - // cross-platform attachment. Authenticators of this class are removable from, and can "roam" among, client devices. - // A public key credential bound to a roaming authenticator is called a roaming credential. - CrossPlatform AuthenticatorAttachment = "cross-platform" -) - -func ParseAuthenticatorAttachment(s string) AuthenticatorAttachment { - switch s { - case "platform": - return Platform - default: - return CrossPlatform - } -} - -const ( - // USB indicates the respective authenticator can be contacted over removable USB. - USB AuthenticatorTransport = "usb" - - // NFC indicates the respective authenticator can be contacted over Near Field Communication (NFC). - NFC AuthenticatorTransport = "nfc" - - // BLE indicates the respective authenticator can be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE). - BLE AuthenticatorTransport = "ble" - - // SmartCard indicates the respective authenticator can be contacted over ISO/IEC 7816 smart card with contacts. - // - // WebAuthn Level 3. - SmartCard AuthenticatorTransport = "smart-card" - - // Hybrid indicates the respective authenticator can be contacted using a combination of (often separate) - // data-transport and proximity mechanisms. This supports, for example, authentication on a desktop computer using - // a smartphone. - // - // WebAuthn Level 3. - Hybrid AuthenticatorTransport = "hybrid" - - // Internal indicates the respective authenticator is contacted using a client device-specific transport, i.e., it - // is a platform authenticator. These authenticators are not removable from the client device. - Internal AuthenticatorTransport = "internal" -) - -func ParseAuthenticatorTransport(s string) AuthenticatorTransport { - switch s { - case "usb": - return USB - case "nfc": - return NFC - case "ble": - return BLE - case "smart-card": - return SmartCard - case "hybrid": - return Hybrid - default: - return Internal - } -} - -type AuthenticatorFlags byte - -const ( - // FlagUserPresent Bit 00000001 in the byte sequence. Tells us if user is present. Also referred to as the UP flag. - FlagUserPresent AuthenticatorFlags = 1 << iota // Referred to as UP - - // FlagRFU1 is a reserved for future use flag. - FlagRFU1 - - // FlagUserVerified Bit 00000100 in the byte sequence. Tells us if user is verified - // by the authenticator using a biometric or PIN. Also referred to as the UV flag. - FlagUserVerified - - // FlagBackupEligible Bit 00001000 in the byte sequence. Tells us if a backup is eligible for device. Also referred - // to as the BE flag. - FlagBackupEligible // Referred to as BE - - // FlagBackupState Bit 00010000 in the byte sequence. Tells us if a backup state for device. Also referred to as the - // BS flag. - FlagBackupState - - // FlagRFU2 is a reserved for future use flag. - FlagRFU2 - - // FlagAttestedCredentialData Bit 01000000 in the byte sequence. Indicates whether - // the authenticator added attested credential data. Also referred to as the AT flag. - FlagAttestedCredentialData - - // FlagHasExtensions Bit 10000000 in the byte sequence. Indicates if the authenticator data has extensions. Also - // referred to as the ED flag. - FlagHasExtensions -) - -type AttestationFormat string - -const ( - // AttestationFormatPacked is the "packed" attestation statement format is a WebAuthn-optimized format for - // attestation. It uses a very compact but still extensible encoding method. This format is implementable by - // authenticators with limited resources (e.g., secure elements). - AttestationFormatPacked AttestationFormat = "packed" - - // AttestationFormatTPM is the TPM attestation statement format returns an attestation statement in the same format - // as the packed attestation statement format, although the rawData and signature fields are computed differently. - AttestationFormatTPM AttestationFormat = "tpm" - - // AttestationFormatAndroidKey is the attestation statement format for platform authenticators on versions "N", and - // later, which may provide this proprietary "hardware attestation" statement. - AttestationFormatAndroidKey AttestationFormat = "android-key" - - // AttestationFormatAndroidSafetyNet is the attestation statement format that Android-based platform authenticators - // MAY produce an attestation statement based on the Android SafetyNet API. - AttestationFormatAndroidSafetyNet AttestationFormat = "android-safetynet" - - // AttestationFormatFIDOUniversalSecondFactor is the attestation statement format that is used with FIDO U2F - // authenticators. - AttestationFormatFIDOUniversalSecondFactor AttestationFormat = "fido-u2f" - - // AttestationFormatApple is the attestation statement format that is used with Apple devices' platform - // authenticators. - AttestationFormatApple AttestationFormat = "apple" - - // AttestationFormatNone is the attestation statement format that is used to replace any authenticator-provided - // attestation statement when a WebAuthn Relying Party indicates it does not wish to receive attestation information. - AttestationFormatNone AttestationFormat = "none" -) - -func ExtractAttestationFormats(p *types.Params) []AttestationFormat { - var formats []AttestationFormat - for _, v := range p.AttestationFormats { - formats = append(formats, parseAttestationFormat(v)) - } - return formats -} - -func parseAttestationFormat(s string) AttestationFormat { - switch s { - case "packed": - return AttestationFormatPacked - case "tpm": - return AttestationFormatTPM - case "android-key": - return AttestationFormatAndroidKey - case "android-safetynet": - return AttestationFormatAndroidSafetyNet - case "fido-u2f": - return AttestationFormatFIDOUniversalSecondFactor - case "apple": - return AttestationFormatApple - case "none": - return AttestationFormatNone - default: - return AttestationFormatPacked - } -} - -type CredentialType string - -const ( - CredentialTypePublicKeyCredential CredentialType = "public-key" -) - -type ConveyancePreference string - -const ( - // PreferNoAttestation is a ConveyancePreference value. - // - // This value indicates that the Relying Party is not interested in authenticator attestation. For example, in order - // to potentially avoid having to obtain user consent to relay identifying information to the Relying Party, or to - // save a round trip to an Attestation CA or Anonymization CA. - // - // This is the default value. - // - // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-none) - PreferNoAttestation ConveyancePreference = "none" - - // PreferIndirectAttestation is a ConveyancePreference value. - // - // This value indicates that the Relying Party prefers an attestation conveyance yielding verifiable attestation - // statements, but allows the client to decide how to obtain such attestation statements. The client MAY replace the - // authenticator-generated attestation statements with attestation statements generated by an Anonymization CA, in - // order to protect the user’s privacy, or to assist Relying Parties with attestation verification in a - // heterogeneous ecosystem. - // - // Note: There is no guarantee that the Relying Party will obtain a verifiable attestation statement in this case. - // For example, in the case that the authenticator employs self attestation. - // - // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-indirect) - PreferIndirectAttestation ConveyancePreference = "indirect" - - // PreferDirectAttestation is a ConveyancePreference value. - // - // This value indicates that the Relying Party wants to receive the attestation statement as generated by the - // authenticator. - // - // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-direct) - PreferDirectAttestation ConveyancePreference = "direct" - - // PreferEnterpriseAttestation is a ConveyancePreference value. - // - // This value indicates that the Relying Party wants to receive an attestation statement that may include uniquely - // identifying information. This is intended for controlled deployments within an enterprise where the organization - // wishes to tie registrations to specific authenticators. User agents MUST NOT provide such an attestation unless - // the user agent or authenticator configuration permits it for the requested RP ID. - // - // If permitted, the user agent SHOULD signal to the authenticator (at invocation time) that enterprise - // attestation is requested, and convey the resulting AAGUID and attestation statement, unaltered, to the Relying - // Party. - // - // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-enterprise) - PreferEnterpriseAttestation ConveyancePreference = "enterprise" -) - -func ExtractConveyancePreference(p *types.Params) ConveyancePreference { - switch p.ConveyancePreference { - case "none": - return PreferNoAttestation - case "indirect": - return PreferIndirectAttestation - case "direct": - return PreferDirectAttestation - case "enterprise": - return PreferEnterpriseAttestation - default: - return PreferNoAttestation - } -} - -type PublicKeyCredentialHints string - -const ( - // PublicKeyCredentialHintSecurityKey is a PublicKeyCredentialHint that indicates that the Relying Party believes - // that users will satisfy this request with a physical security key. For example, an enterprise Relying Party may - // set this hint if they have issued security keys to their employees and will only accept those authenticators for - // registration and authentication. - // - // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the - // authenticatorAttachment SHOULD be set to cross-platform. - PublicKeyCredentialHintSecurityKey PublicKeyCredentialHints = "security-key" - - // PublicKeyCredentialHintClientDevice is a PublicKeyCredentialHint that indicates that the Relying Party believes - // that users will satisfy this request with a platform authenticator attached to the client device. - // - // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the - // authenticatorAttachment SHOULD be set to platform. - PublicKeyCredentialHintClientDevice PublicKeyCredentialHints = "client-device" - - // PublicKeyCredentialHintHybrid is a PublicKeyCredentialHint that indicates that the Relying Party believes that - // users will satisfy this request with general-purpose authenticators such as smartphones. For example, a consumer - // Relying Party may believe that only a small fraction of their customers possesses dedicated security keys. This - // option also implies that the local platform authenticator should not be promoted in the UI. - // - // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the - // authenticatorAttachment SHOULD be set to cross-platform. - PublicKeyCredentialHintHybrid PublicKeyCredentialHints = "hybrid" -) - -func ParsePublicKeyCredentialHints(s string) PublicKeyCredentialHints { - switch s { - case "security-key": - return PublicKeyCredentialHintSecurityKey - case "client-device": - return PublicKeyCredentialHintClientDevice - case "hybrid": - return PublicKeyCredentialHintHybrid - default: - return "" - } -} - -type AttestedCredentialData struct { - AAGUID []byte `json:"aaguid"` - CredentialID []byte `json:"credential_id"` - - // The raw credential public key bytes received from the attestation data. - CredentialPublicKey []byte `json:"public_key"` -} - -type ResidentKeyRequirement string - -const ( - // ResidentKeyRequirementDiscouraged indicates the Relying Party prefers creating a server-side credential, but will - // accept a client-side discoverable credential. This is the default. - ResidentKeyRequirementDiscouraged ResidentKeyRequirement = "discouraged" - - // ResidentKeyRequirementPreferred indicates to the client we would prefer a discoverable credential. - ResidentKeyRequirementPreferred ResidentKeyRequirement = "preferred" - - // ResidentKeyRequirementRequired indicates the Relying Party requires a client-side discoverable credential, and is - // prepared to receive an error if a client-side discoverable credential cannot be created. - ResidentKeyRequirementRequired ResidentKeyRequirement = "required" -) - -func ParseResidentKeyRequirement(s string) ResidentKeyRequirement { - switch s { - case "discouraged": - return ResidentKeyRequirementDiscouraged - case "preferred": - return ResidentKeyRequirementPreferred - default: - return ResidentKeyRequirementRequired - } -} - -type ( - AuthenticationExtensions map[string]any - UserVerificationRequirement string -) - -const ( - // VerificationRequired User verification is required to create/release a credential - VerificationRequired UserVerificationRequirement = "required" - - // VerificationPreferred User verification is preferred to create/release a credential - VerificationPreferred UserVerificationRequirement = "preferred" // This is the default - - // VerificationDiscouraged The authenticator should not verify the user for the credential - VerificationDiscouraged UserVerificationRequirement = "discouraged" -) diff --git a/internal/orm/credential.go b/internal/orm/credential.go deleted file mode 100644 index 5448bba29..000000000 --- a/internal/orm/credential.go +++ /dev/null @@ -1,56 +0,0 @@ -package orm - -import ( - "encoding/base64" - - "github.com/go-webauthn/webauthn/protocol" -) - -// NewCredential will return a credential pointer on successful validation of a registration response. -func NewCredential(c *protocol.ParsedCredentialCreationData, origin, handle string) *Credential { - return &Credential{ - Subject: handle, - Origin: origin, - AttestationType: c.Response.AttestationObject.Format, - CredentialId: BytesToBase64(c.Response.AttestationObject.AuthData.AttData.CredentialID), - PublicKey: BytesToBase64(c.Response.AttestationObject.AuthData.AttData.CredentialPublicKey), - Transport: NormalizeTransports(c.Response.Transports), - SignCount: uint(c.Response.AttestationObject.AuthData.Counter), - UserPresent: c.Response.AttestationObject.AuthData.Flags.HasUserPresent(), - UserVerified: c.Response.AttestationObject.AuthData.Flags.HasUserVerified(), - BackupEligible: c.Response.AttestationObject.AuthData.Flags.HasBackupEligible(), - BackupState: c.Response.AttestationObject.AuthData.Flags.HasAttestedCredentialData(), - } -} - -func BytesToBase64(b []byte) string { - return base64.RawURLEncoding.EncodeToString(b) -} - -func Base64ToBytes(b string) ([]byte, error) { - return base64.RawURLEncoding.DecodeString(b) -} - -// Descriptor converts a Credential into a protocol.CredentialDescriptor. -func (c *Credential) Descriptor() protocol.CredentialDescriptor { - id, err := base64.RawURLEncoding.DecodeString(c.CredentialId) - if err != nil { - panic(err) - } - return protocol.CredentialDescriptor{ - Type: protocol.PublicKeyCredentialType, - CredentialID: id, - Transport: ConvertTransports(c.Transport), - AttestationType: c.AttestationType, - } -} - -// This is a signal that the authenticator may be cloned, see CloneWarning above for more information. -func (a *Credential) UpdateCounter(authDataCount uint) { - if authDataCount <= a.SignCount && (authDataCount != 0 || a.SignCount != 0) { - a.CloneWarning = true - return - } - - a.SignCount = authDataCount -} diff --git a/internal/orm/init.pkl.go b/internal/orm/init.pkl.go deleted file mode 100644 index 390916a45..000000000 --- a/internal/orm/init.pkl.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("orm", Orm{}) - pkl.RegisterMapping("orm#Account", Account{}) - pkl.RegisterMapping("orm#Asset", Asset{}) - pkl.RegisterMapping("orm#Chain", Chain{}) - pkl.RegisterMapping("orm#Credential", Credential{}) - pkl.RegisterMapping("orm#JWK", JWK{}) - pkl.RegisterMapping("orm#Grant", Grant{}) - pkl.RegisterMapping("orm#Keyshare", Keyshare{}) - pkl.RegisterMapping("orm#PublicKey", PublicKey{}) - pkl.RegisterMapping("orm#Profile", Profile{}) -} diff --git a/internal/orm/jwk.go b/internal/orm/jwk.go deleted file mode 100644 index a55d8f226..000000000 --- a/internal/orm/jwk.go +++ /dev/null @@ -1,111 +0,0 @@ -package orm - -import ( - "encoding/base64" - "fmt" - - "github.com/go-webauthn/webauthn/protocol" - "github.com/go-webauthn/webauthn/protocol/webauthncose" -) - -func FormatEC2PublicKey(key *webauthncose.EC2PublicKeyData) (*JWK, error) { - curve, err := GetCOSECurveName(key.Curve) - if err != nil { - return nil, err - } - - jwkMap := map[string]interface{}{ - "kty": "EC", - "crv": curve, - "x": base64.RawURLEncoding.EncodeToString(key.XCoord), - "y": base64.RawURLEncoding.EncodeToString(key.YCoord), - } - - return MapToJWK(jwkMap) -} - -func FormatRSAPublicKey(key *webauthncose.RSAPublicKeyData) (*JWK, error) { - jwkMap := map[string]interface{}{ - "kty": "RSA", - "n": base64.RawURLEncoding.EncodeToString(key.Modulus), - "e": base64.RawURLEncoding.EncodeToString(key.Exponent), - } - - return MapToJWK(jwkMap) -} - -func FormatOKPPublicKey(key *webauthncose.OKPPublicKeyData) (*JWK, error) { - curve, err := GetOKPCurveName(key.Curve) - if err != nil { - return nil, err - } - - jwkMap := map[string]interface{}{ - "kty": "OKP", - "crv": curve, - "x": base64.RawURLEncoding.EncodeToString(key.XCoord), - } - - return MapToJWK(jwkMap) -} - -func MapToJWK(m map[string]interface{}) (*JWK, error) { - jwk := &JWK{} - for k, v := range m { - switch k { - case "kty": - jwk.Kty = v.(string) - case "crv": - jwk.Crv = v.(string) - case "x": - jwk.X = v.(string) - case "y": - jwk.Y = v.(string) - case "n": - jwk.N = v.(string) - case "e": - jwk.E = v.(string) - } - } - return jwk, nil -} - -func GetCOSECurveName(curveID int64) (string, error) { - switch curveID { - case int64(webauthncose.P256): - return "P-256", nil - case int64(webauthncose.P384): - return "P-384", nil - case int64(webauthncose.P521): - return "P-521", nil - default: - return "", fmt.Errorf("unknown curve ID: %d", curveID) - } -} - -func GetOKPCurveName(curveID int64) (string, error) { - switch curveID { - case int64(webauthncose.Ed25519): - return "Ed25519", nil - default: - return "", fmt.Errorf("unknown OKP curve ID: %d", curveID) - } -} - -// ConvertTransports converts the transports from strings to protocol.AuthenticatorTransport -func ConvertTransports(transports []string) []protocol.AuthenticatorTransport { - tss := make([]protocol.AuthenticatorTransport, len(transports)) - for i, t := range transports { - tss[i] = protocol.AuthenticatorTransport(t) - } - return tss -} - -// NormalizeTransports returns the transports as strings -func NormalizeTransports(transports []protocol.AuthenticatorTransport) []string { - tss := make([]string, len(transports)) - for i, t := range transports { - tss[i] = string(t) - } - return tss -} diff --git a/internal/orm/keyalg.go b/internal/orm/keyalg.go deleted file mode 100644 index 387df8d3d..000000000 --- a/internal/orm/keyalg.go +++ /dev/null @@ -1,22 +0,0 @@ -package orm - -import "github.com/onsonr/sonr/internal/orm/keyalgorithm" - -type COSEAlgorithmIdentifier int - -func GetCoseIdentifier(alg keyalgorithm.KeyAlgorithm) COSEAlgorithmIdentifier { - switch alg { - case keyalgorithm.Es256: - return COSEAlgorithmIdentifier(-7) - case keyalgorithm.Es384: - return COSEAlgorithmIdentifier(-35) - case keyalgorithm.Es512: - return COSEAlgorithmIdentifier(-36) - case keyalgorithm.Eddsa: - return COSEAlgorithmIdentifier(-8) - case keyalgorithm.Es256k: - return COSEAlgorithmIdentifier(-10) - default: - return COSEAlgorithmIdentifier(0) - } -} diff --git a/internal/orm/publickey.go b/internal/orm/publickey.go deleted file mode 100644 index 8256d0946..000000000 --- a/internal/orm/publickey.go +++ /dev/null @@ -1,26 +0,0 @@ -package orm - -import ( - "fmt" - - "github.com/go-webauthn/webauthn/protocol/webauthncose" -) - -// ExtractWebAuthnPublicKey parses the raw public key bytes and returns a JWK representation -func ExtractWebAuthnPublicKey(keyBytes []byte) (*JWK, error) { - key, err := webauthncose.ParsePublicKey(keyBytes) - if err != nil { - return nil, fmt.Errorf("failed to parse public key: %w", err) - } - - switch k := key.(type) { - case *webauthncose.EC2PublicKeyData: - return FormatEC2PublicKey(k) - case *webauthncose.RSAPublicKeyData: - return FormatRSAPublicKey(k) - case *webauthncose.OKPPublicKeyData: - return FormatOKPPublicKey(k) - default: - return nil, fmt.Errorf("unsupported key type") - } -} diff --git a/internal/orm/transactions/Msg.pkl.go b/internal/orm/transactions/Msg.pkl.go deleted file mode 100644 index fe8ffcc9a..000000000 --- a/internal/orm/transactions/Msg.pkl.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -type Msg interface { - GetTypeUrl() string -} diff --git a/internal/orm/transactions/MsgDidAllocateVault.pkl.go b/internal/orm/transactions/MsgDidAllocateVault.pkl.go deleted file mode 100644 index 0e691f461..000000000 --- a/internal/orm/transactions/MsgDidAllocateVault.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidAllocateVault interface { - Msg - - GetAuthority() string - - GetSubject() string - - GetToken() *pkl.Object -} - -var _ MsgDidAllocateVault = (*MsgDidAllocateVaultImpl)(nil) - -type MsgDidAllocateVaultImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Subject string `pkl:"subject"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidAllocateVaultImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidAllocateVaultImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidAllocateVaultImpl) GetSubject() string { - return rcv.Subject -} - -func (rcv *MsgDidAllocateVaultImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidAuthorize.pkl.go b/internal/orm/transactions/MsgDidAuthorize.pkl.go deleted file mode 100644 index b12fc046d..000000000 --- a/internal/orm/transactions/MsgDidAuthorize.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidAuthorize interface { - Msg - - GetAuthority() string - - GetController() string - - GetAddress() string - - GetOrigin() string - - GetToken() *pkl.Object -} - -var _ MsgDidAuthorize = (*MsgDidAuthorizeImpl)(nil) - -type MsgDidAuthorizeImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Controller string `pkl:"controller"` - - Address string `pkl:"address"` - - Origin string `pkl:"origin"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidAuthorizeImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidAuthorizeImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidAuthorizeImpl) GetController() string { - return rcv.Controller -} - -func (rcv *MsgDidAuthorizeImpl) GetAddress() string { - return rcv.Address -} - -func (rcv *MsgDidAuthorizeImpl) GetOrigin() string { - return rcv.Origin -} - -func (rcv *MsgDidAuthorizeImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidProveWitness.pkl.go b/internal/orm/transactions/MsgDidProveWitness.pkl.go deleted file mode 100644 index 8bb849194..000000000 --- a/internal/orm/transactions/MsgDidProveWitness.pkl.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidProveWitness interface { - Msg - - GetAuthority() string - - GetProperty() string - - GetWitness() []int - - GetToken() *pkl.Object -} - -var _ MsgDidProveWitness = (*MsgDidProveWitnessImpl)(nil) - -type MsgDidProveWitnessImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Property string `pkl:"property"` - - Witness []int `pkl:"witness"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidProveWitnessImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidProveWitnessImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidProveWitnessImpl) GetProperty() string { - return rcv.Property -} - -func (rcv *MsgDidProveWitnessImpl) GetWitness() []int { - return rcv.Witness -} - -func (rcv *MsgDidProveWitnessImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidRegisterController.pkl.go b/internal/orm/transactions/MsgDidRegisterController.pkl.go deleted file mode 100644 index 99907f455..000000000 --- a/internal/orm/transactions/MsgDidRegisterController.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidRegisterController interface { - Msg - - GetAuthority() string - - GetCid() string - - GetOrigin() string - - GetAuthentication() []*pkl.Object - - GetToken() *pkl.Object -} - -var _ MsgDidRegisterController = (*MsgDidRegisterControllerImpl)(nil) - -type MsgDidRegisterControllerImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Cid string `pkl:"cid"` - - Origin string `pkl:"origin"` - - Authentication []*pkl.Object `pkl:"authentication"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidRegisterControllerImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidRegisterControllerImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidRegisterControllerImpl) GetCid() string { - return rcv.Cid -} - -func (rcv *MsgDidRegisterControllerImpl) GetOrigin() string { - return rcv.Origin -} - -func (rcv *MsgDidRegisterControllerImpl) GetAuthentication() []*pkl.Object { - return rcv.Authentication -} - -func (rcv *MsgDidRegisterControllerImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidRegisterService.pkl.go b/internal/orm/transactions/MsgDidRegisterService.pkl.go deleted file mode 100644 index d234865da..000000000 --- a/internal/orm/transactions/MsgDidRegisterService.pkl.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidRegisterService interface { - Msg - - GetController() string - - GetOriginUri() string - - GetScopes() *pkl.Object - - GetDescription() string - - GetServiceEndpoints() map[string]string - - GetMetadata() *pkl.Object - - GetToken() *pkl.Object -} - -var _ MsgDidRegisterService = (*MsgDidRegisterServiceImpl)(nil) - -type MsgDidRegisterServiceImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Controller string `pkl:"controller"` - - OriginUri string `pkl:"originUri"` - - Scopes *pkl.Object `pkl:"scopes"` - - Description string `pkl:"description"` - - ServiceEndpoints map[string]string `pkl:"serviceEndpoints"` - - Metadata *pkl.Object `pkl:"metadata"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidRegisterServiceImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidRegisterServiceImpl) GetController() string { - return rcv.Controller -} - -func (rcv *MsgDidRegisterServiceImpl) GetOriginUri() string { - return rcv.OriginUri -} - -func (rcv *MsgDidRegisterServiceImpl) GetScopes() *pkl.Object { - return rcv.Scopes -} - -func (rcv *MsgDidRegisterServiceImpl) GetDescription() string { - return rcv.Description -} - -func (rcv *MsgDidRegisterServiceImpl) GetServiceEndpoints() map[string]string { - return rcv.ServiceEndpoints -} - -func (rcv *MsgDidRegisterServiceImpl) GetMetadata() *pkl.Object { - return rcv.Metadata -} - -func (rcv *MsgDidRegisterServiceImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidSyncVault.pkl.go b/internal/orm/transactions/MsgDidSyncVault.pkl.go deleted file mode 100644 index c4de4ba64..000000000 --- a/internal/orm/transactions/MsgDidSyncVault.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidSyncVault interface { - Msg - - GetController() string - - GetToken() *pkl.Object -} - -var _ MsgDidSyncVault = (*MsgDidSyncVaultImpl)(nil) - -type MsgDidSyncVaultImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Controller string `pkl:"controller"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidSyncVaultImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidSyncVaultImpl) GetController() string { - return rcv.Controller -} - -func (rcv *MsgDidSyncVaultImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidUpdateParams.pkl.go b/internal/orm/transactions/MsgDidUpdateParams.pkl.go deleted file mode 100644 index a3e227ab8..000000000 --- a/internal/orm/transactions/MsgDidUpdateParams.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidUpdateParams interface { - Msg - - GetAuthority() string - - GetParams() *pkl.Object - - GetToken() *pkl.Object -} - -var _ MsgDidUpdateParams = (*MsgDidUpdateParamsImpl)(nil) - -type MsgDidUpdateParamsImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Params *pkl.Object `pkl:"params"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidUpdateParamsImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidUpdateParamsImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidUpdateParamsImpl) GetParams() *pkl.Object { - return rcv.Params -} - -func (rcv *MsgDidUpdateParamsImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgGovDeposit.pkl.go b/internal/orm/transactions/MsgGovDeposit.pkl.go deleted file mode 100644 index 556d1df7f..000000000 --- a/internal/orm/transactions/MsgGovDeposit.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgGovDeposit interface { - Msg - - GetProposalId() int - - GetDepositor() string - - GetAmount() []*pkl.Object -} - -var _ MsgGovDeposit = (*MsgGovDepositImpl)(nil) - -type MsgGovDepositImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - ProposalId int `pkl:"proposalId"` - - Depositor string `pkl:"depositor"` - - Amount []*pkl.Object `pkl:"amount"` -} - -// The type URL for the message -func (rcv *MsgGovDepositImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGovDepositImpl) GetProposalId() int { - return rcv.ProposalId -} - -func (rcv *MsgGovDepositImpl) GetDepositor() string { - return rcv.Depositor -} - -func (rcv *MsgGovDepositImpl) GetAmount() []*pkl.Object { - return rcv.Amount -} diff --git a/internal/orm/transactions/MsgGovSubmitProposal.pkl.go b/internal/orm/transactions/MsgGovSubmitProposal.pkl.go deleted file mode 100644 index c33b589b6..000000000 --- a/internal/orm/transactions/MsgGovSubmitProposal.pkl.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgGovSubmitProposal interface { - Msg - - GetContent() *Proposal - - GetInitialDeposit() []*pkl.Object - - GetProposer() string -} - -var _ MsgGovSubmitProposal = (*MsgGovSubmitProposalImpl)(nil) - -// Gov module messages -type MsgGovSubmitProposalImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Content *Proposal `pkl:"content"` - - InitialDeposit []*pkl.Object `pkl:"initialDeposit"` - - Proposer string `pkl:"proposer"` -} - -// The type URL for the message -func (rcv *MsgGovSubmitProposalImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGovSubmitProposalImpl) GetContent() *Proposal { - return rcv.Content -} - -func (rcv *MsgGovSubmitProposalImpl) GetInitialDeposit() []*pkl.Object { - return rcv.InitialDeposit -} - -func (rcv *MsgGovSubmitProposalImpl) GetProposer() string { - return rcv.Proposer -} diff --git a/internal/orm/transactions/MsgGovVote.pkl.go b/internal/orm/transactions/MsgGovVote.pkl.go deleted file mode 100644 index 303cf1eee..000000000 --- a/internal/orm/transactions/MsgGovVote.pkl.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -type MsgGovVote interface { - Msg - - GetProposalId() int - - GetVoter() string - - GetOption() int -} - -var _ MsgGovVote = (*MsgGovVoteImpl)(nil) - -type MsgGovVoteImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - ProposalId int `pkl:"proposalId"` - - Voter string `pkl:"voter"` - - Option int `pkl:"option"` -} - -// The type URL for the message -func (rcv *MsgGovVoteImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGovVoteImpl) GetProposalId() int { - return rcv.ProposalId -} - -func (rcv *MsgGovVoteImpl) GetVoter() string { - return rcv.Voter -} - -func (rcv *MsgGovVoteImpl) GetOption() int { - return rcv.Option -} diff --git a/internal/orm/transactions/MsgGroupCreateGroup.pkl.go b/internal/orm/transactions/MsgGroupCreateGroup.pkl.go deleted file mode 100644 index c5dafd6bd..000000000 --- a/internal/orm/transactions/MsgGroupCreateGroup.pkl.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgGroupCreateGroup interface { - Msg - - GetAdmin() string - - GetMembers() []*pkl.Object - - GetMetadata() string -} - -var _ MsgGroupCreateGroup = (*MsgGroupCreateGroupImpl)(nil) - -// Group module messages -type MsgGroupCreateGroupImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Admin string `pkl:"admin"` - - Members []*pkl.Object `pkl:"members"` - - Metadata string `pkl:"metadata"` -} - -// The type URL for the message -func (rcv *MsgGroupCreateGroupImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGroupCreateGroupImpl) GetAdmin() string { - return rcv.Admin -} - -func (rcv *MsgGroupCreateGroupImpl) GetMembers() []*pkl.Object { - return rcv.Members -} - -func (rcv *MsgGroupCreateGroupImpl) GetMetadata() string { - return rcv.Metadata -} diff --git a/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go b/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go deleted file mode 100644 index c23f15391..000000000 --- a/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgGroupSubmitProposal interface { - Msg - - GetGroupPolicyAddress() string - - GetProposers() []string - - GetMetadata() string - - GetMessages() []*pkl.Object - - GetExec() int -} - -var _ MsgGroupSubmitProposal = (*MsgGroupSubmitProposalImpl)(nil) - -type MsgGroupSubmitProposalImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - GroupPolicyAddress string `pkl:"groupPolicyAddress"` - - Proposers []string `pkl:"proposers"` - - Metadata string `pkl:"metadata"` - - Messages []*pkl.Object `pkl:"messages"` - - Exec int `pkl:"exec"` -} - -// The type URL for the message -func (rcv *MsgGroupSubmitProposalImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGroupSubmitProposalImpl) GetGroupPolicyAddress() string { - return rcv.GroupPolicyAddress -} - -func (rcv *MsgGroupSubmitProposalImpl) GetProposers() []string { - return rcv.Proposers -} - -func (rcv *MsgGroupSubmitProposalImpl) GetMetadata() string { - return rcv.Metadata -} - -func (rcv *MsgGroupSubmitProposalImpl) GetMessages() []*pkl.Object { - return rcv.Messages -} - -func (rcv *MsgGroupSubmitProposalImpl) GetExec() int { - return rcv.Exec -} diff --git a/internal/orm/transactions/MsgGroupVote.pkl.go b/internal/orm/transactions/MsgGroupVote.pkl.go deleted file mode 100644 index a79ce6899..000000000 --- a/internal/orm/transactions/MsgGroupVote.pkl.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -type MsgGroupVote interface { - Msg - - GetProposalId() int - - GetVoter() string - - GetOption() int - - GetMetadata() string - - GetExec() int -} - -var _ MsgGroupVote = (*MsgGroupVoteImpl)(nil) - -type MsgGroupVoteImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - ProposalId int `pkl:"proposalId"` - - Voter string `pkl:"voter"` - - Option int `pkl:"option"` - - Metadata string `pkl:"metadata"` - - Exec int `pkl:"exec"` -} - -// The type URL for the message -func (rcv *MsgGroupVoteImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGroupVoteImpl) GetProposalId() int { - return rcv.ProposalId -} - -func (rcv *MsgGroupVoteImpl) GetVoter() string { - return rcv.Voter -} - -func (rcv *MsgGroupVoteImpl) GetOption() int { - return rcv.Option -} - -func (rcv *MsgGroupVoteImpl) GetMetadata() string { - return rcv.Metadata -} - -func (rcv *MsgGroupVoteImpl) GetExec() int { - return rcv.Exec -} diff --git a/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go b/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go deleted file mode 100644 index 44a019af4..000000000 --- a/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgStakingBeginRedelegate interface { - Msg - - GetDelegatorAddress() string - - GetValidatorSrcAddress() string - - GetValidatorDstAddress() string - - GetAmount() *pkl.Object -} - -var _ MsgStakingBeginRedelegate = (*MsgStakingBeginRedelegateImpl)(nil) - -type MsgStakingBeginRedelegateImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - DelegatorAddress string `pkl:"delegatorAddress"` - - ValidatorSrcAddress string `pkl:"validatorSrcAddress"` - - ValidatorDstAddress string `pkl:"validatorDstAddress"` - - Amount *pkl.Object `pkl:"amount"` -} - -// The type URL for the message -func (rcv *MsgStakingBeginRedelegateImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgStakingBeginRedelegateImpl) GetDelegatorAddress() string { - return rcv.DelegatorAddress -} - -func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorSrcAddress() string { - return rcv.ValidatorSrcAddress -} - -func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorDstAddress() string { - return rcv.ValidatorDstAddress -} - -func (rcv *MsgStakingBeginRedelegateImpl) GetAmount() *pkl.Object { - return rcv.Amount -} diff --git a/internal/orm/transactions/MsgStakingCreateValidator.pkl.go b/internal/orm/transactions/MsgStakingCreateValidator.pkl.go deleted file mode 100644 index d904a71c6..000000000 --- a/internal/orm/transactions/MsgStakingCreateValidator.pkl.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgStakingCreateValidator interface { - Msg - - GetDescription() *pkl.Object - - GetCommission() *pkl.Object - - GetMinSelfDelegation() string - - GetDelegatorAddress() string - - GetValidatorAddress() string - - GetPubkey() *pkl.Object - - GetValue() *pkl.Object -} - -var _ MsgStakingCreateValidator = (*MsgStakingCreateValidatorImpl)(nil) - -// Staking module messages -type MsgStakingCreateValidatorImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Description *pkl.Object `pkl:"description"` - - Commission *pkl.Object `pkl:"commission"` - - MinSelfDelegation string `pkl:"minSelfDelegation"` - - DelegatorAddress string `pkl:"delegatorAddress"` - - ValidatorAddress string `pkl:"validatorAddress"` - - Pubkey *pkl.Object `pkl:"pubkey"` - - Value *pkl.Object `pkl:"value"` -} - -// The type URL for the message -func (rcv *MsgStakingCreateValidatorImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgStakingCreateValidatorImpl) GetDescription() *pkl.Object { - return rcv.Description -} - -func (rcv *MsgStakingCreateValidatorImpl) GetCommission() *pkl.Object { - return rcv.Commission -} - -func (rcv *MsgStakingCreateValidatorImpl) GetMinSelfDelegation() string { - return rcv.MinSelfDelegation -} - -func (rcv *MsgStakingCreateValidatorImpl) GetDelegatorAddress() string { - return rcv.DelegatorAddress -} - -func (rcv *MsgStakingCreateValidatorImpl) GetValidatorAddress() string { - return rcv.ValidatorAddress -} - -func (rcv *MsgStakingCreateValidatorImpl) GetPubkey() *pkl.Object { - return rcv.Pubkey -} - -func (rcv *MsgStakingCreateValidatorImpl) GetValue() *pkl.Object { - return rcv.Value -} diff --git a/internal/orm/transactions/MsgStakingDelegate.pkl.go b/internal/orm/transactions/MsgStakingDelegate.pkl.go deleted file mode 100644 index 9dd6fa824..000000000 --- a/internal/orm/transactions/MsgStakingDelegate.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgStakingDelegate interface { - Msg - - GetDelegatorAddress() string - - GetValidatorAddress() string - - GetAmount() *pkl.Object -} - -var _ MsgStakingDelegate = (*MsgStakingDelegateImpl)(nil) - -type MsgStakingDelegateImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - DelegatorAddress string `pkl:"delegatorAddress"` - - ValidatorAddress string `pkl:"validatorAddress"` - - Amount *pkl.Object `pkl:"amount"` -} - -// The type URL for the message -func (rcv *MsgStakingDelegateImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgStakingDelegateImpl) GetDelegatorAddress() string { - return rcv.DelegatorAddress -} - -func (rcv *MsgStakingDelegateImpl) GetValidatorAddress() string { - return rcv.ValidatorAddress -} - -func (rcv *MsgStakingDelegateImpl) GetAmount() *pkl.Object { - return rcv.Amount -} diff --git a/internal/orm/transactions/MsgStakingUndelegate.pkl.go b/internal/orm/transactions/MsgStakingUndelegate.pkl.go deleted file mode 100644 index ffc2395e6..000000000 --- a/internal/orm/transactions/MsgStakingUndelegate.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgStakingUndelegate interface { - Msg - - GetDelegatorAddress() string - - GetValidatorAddress() string - - GetAmount() *pkl.Object -} - -var _ MsgStakingUndelegate = (*MsgStakingUndelegateImpl)(nil) - -type MsgStakingUndelegateImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - DelegatorAddress string `pkl:"delegatorAddress"` - - ValidatorAddress string `pkl:"validatorAddress"` - - Amount *pkl.Object `pkl:"amount"` -} - -// The type URL for the message -func (rcv *MsgStakingUndelegateImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgStakingUndelegateImpl) GetDelegatorAddress() string { - return rcv.DelegatorAddress -} - -func (rcv *MsgStakingUndelegateImpl) GetValidatorAddress() string { - return rcv.ValidatorAddress -} - -func (rcv *MsgStakingUndelegateImpl) GetAmount() *pkl.Object { - return rcv.Amount -} diff --git a/internal/orm/transactions/Proposal.pkl.go b/internal/orm/transactions/Proposal.pkl.go deleted file mode 100644 index 4a3e8bd62..000000000 --- a/internal/orm/transactions/Proposal.pkl.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -// Base class for all proposals -type Proposal struct { - // The title of the proposal - Title string `pkl:"title"` - - // The description of the proposal - Description string `pkl:"description"` -} diff --git a/internal/orm/transactions/Transactions.pkl.go b/internal/orm/transactions/Transactions.pkl.go deleted file mode 100644 index 5a551b8c4..000000000 --- a/internal/orm/transactions/Transactions.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Transactions struct { -} - -// LoadFromPath loads the pkl module at the given path and evaluates it into a Transactions -func LoadFromPath(ctx context.Context, path string) (ret *Transactions, err error) { - evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) - if err != nil { - return nil, err - } - defer func() { - cerr := evaluator.Close() - if err == nil { - err = cerr - } - }() - ret, err = Load(ctx, evaluator, pkl.FileSource(path)) - return ret, err -} - -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Transactions -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Transactions, error) { - var ret Transactions - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/internal/orm/transactions/TxBody.pkl.go b/internal/orm/transactions/TxBody.pkl.go deleted file mode 100644 index 8a8c23263..000000000 --- a/internal/orm/transactions/TxBody.pkl.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -// Represents a transaction body -type TxBody struct { - Messages []Msg `pkl:"messages"` - - Memo *string `pkl:"memo"` - - TimeoutHeight *int `pkl:"timeoutHeight"` - - ExtensionOptions *[]*pkl.Object `pkl:"extensionOptions"` - - NonCriticalExtensionOptions *[]*pkl.Object `pkl:"nonCriticalExtensionOptions"` -} diff --git a/internal/orm/transactions/init.pkl.go b/internal/orm/transactions/init.pkl.go deleted file mode 100644 index 211bc2e21..000000000 --- a/internal/orm/transactions/init.pkl.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("transactions", Transactions{}) - pkl.RegisterMapping("transactions#Proposal", Proposal{}) - pkl.RegisterMapping("transactions#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{}) - pkl.RegisterMapping("transactions#MsgGovVote", MsgGovVoteImpl{}) - pkl.RegisterMapping("transactions#MsgGovDeposit", MsgGovDepositImpl{}) - pkl.RegisterMapping("transactions#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{}) - pkl.RegisterMapping("transactions#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{}) - pkl.RegisterMapping("transactions#MsgGroupVote", MsgGroupVoteImpl{}) - pkl.RegisterMapping("transactions#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{}) - pkl.RegisterMapping("transactions#MsgStakingDelegate", MsgStakingDelegateImpl{}) - pkl.RegisterMapping("transactions#MsgStakingUndelegate", MsgStakingUndelegateImpl{}) - pkl.RegisterMapping("transactions#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{}) - pkl.RegisterMapping("transactions#MsgDidUpdateParams", MsgDidUpdateParamsImpl{}) - pkl.RegisterMapping("transactions#MsgDidAllocateVault", MsgDidAllocateVaultImpl{}) - pkl.RegisterMapping("transactions#MsgDidProveWitness", MsgDidProveWitnessImpl{}) - pkl.RegisterMapping("transactions#MsgDidSyncVault", MsgDidSyncVaultImpl{}) - pkl.RegisterMapping("transactions#MsgDidRegisterController", MsgDidRegisterControllerImpl{}) - pkl.RegisterMapping("transactions#MsgDidAuthorize", MsgDidAuthorizeImpl{}) - pkl.RegisterMapping("transactions#MsgDidRegisterService", MsgDidRegisterServiceImpl{}) - pkl.RegisterMapping("transactions#TxBody", TxBody{}) -} diff --git a/nebula/README.md b/nebula/README.md new file mode 100644 index 000000000..52772822e --- /dev/null +++ b/nebula/README.md @@ -0,0 +1,3 @@ +# Nebula + +A Templ component library for the Sonr DWN (Decentralized Web Node) client. diff --git a/pkg/nebula/blocks/alert.templ b/nebula/blocks/alert.templ similarity index 100% rename from pkg/nebula/blocks/alert.templ rename to nebula/blocks/alert.templ diff --git a/pkg/nebula/blocks/alert_templ.go b/nebula/blocks/alert_templ.go similarity index 96% rename from pkg/nebula/blocks/alert_templ.go rename to nebula/blocks/alert_templ.go index 9b00895d4..dee2fc99b 100644 --- a/pkg/nebula/blocks/alert_templ.go +++ b/nebula/blocks/alert_templ.go @@ -56,7 +56,7 @@ func alertElement(attrs templ.Attributes, title, message string, icon templ.Comp var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/alert.templ`, Line: 10, Col: 66} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/alert.templ`, Line: 10, Col: 66} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -69,7 +69,7 @@ func alertElement(attrs templ.Attributes, title, message string, icon templ.Comp var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(message) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/alert.templ`, Line: 11, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/alert.templ`, Line: 11, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/blocks/badge.templ b/nebula/blocks/badge.templ similarity index 100% rename from pkg/nebula/blocks/badge.templ rename to nebula/blocks/badge.templ diff --git a/pkg/nebula/blocks/badge_templ.go b/nebula/blocks/badge_templ.go similarity index 100% rename from pkg/nebula/blocks/badge_templ.go rename to nebula/blocks/badge_templ.go diff --git a/pkg/nebula/blocks/blocks.go b/nebula/blocks/blocks.go similarity index 100% rename from pkg/nebula/blocks/blocks.go rename to nebula/blocks/blocks.go diff --git a/pkg/nebula/blocks/button.templ b/nebula/blocks/button.templ similarity index 100% rename from pkg/nebula/blocks/button.templ rename to nebula/blocks/button.templ diff --git a/pkg/nebula/blocks/button_templ.go b/nebula/blocks/button_templ.go similarity index 94% rename from pkg/nebula/blocks/button_templ.go rename to nebula/blocks/button_templ.go index e5dd0aade..e4911b7a9 100644 --- a/pkg/nebula/blocks/button_templ.go +++ b/nebula/blocks/button_templ.go @@ -157,7 +157,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxGet) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 86, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -170,7 +170,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTarget) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 86, Col: 69} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 69} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -183,7 +183,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTrigger) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 86, Col: 96} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 96} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -196,7 +196,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxSwap) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 86, Col: 117} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 117} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -254,7 +254,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxPost) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 92, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -267,7 +267,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTarget) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 92, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 52} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -280,7 +280,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTrigger) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 92, Col: 79} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 79} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -293,7 +293,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxSwap) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 92, Col: 100} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 100} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/blocks/card.templ b/nebula/blocks/card.templ similarity index 100% rename from pkg/nebula/blocks/card.templ rename to nebula/blocks/card.templ diff --git a/pkg/nebula/blocks/card_templ.go b/nebula/blocks/card_templ.go similarity index 98% rename from pkg/nebula/blocks/card_templ.go rename to nebula/blocks/card_templ.go index 686fd68a9..d3a390579 100644 --- a/pkg/nebula/blocks/card_templ.go +++ b/nebula/blocks/card_templ.go @@ -40,7 +40,7 @@ func renderCard(id string, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(id) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/card.templ`, Line: 8, Col: 13} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/card.templ`, Line: 8, Col: 13} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/blocks/fonts.templ b/nebula/blocks/fonts.templ similarity index 100% rename from pkg/nebula/blocks/fonts.templ rename to nebula/blocks/fonts.templ diff --git a/pkg/nebula/blocks/fonts_templ.go b/nebula/blocks/fonts_templ.go similarity index 92% rename from pkg/nebula/blocks/fonts_templ.go rename to nebula/blocks/fonts_templ.go index 8141bc7c2..9a2c2ef29 100644 --- a/pkg/nebula/blocks/fonts_templ.go +++ b/nebula/blocks/fonts_templ.go @@ -54,7 +54,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 23, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 23, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -72,7 +72,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 27, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 27, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -90,7 +90,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 31, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 31, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -108,7 +108,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 35, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 35, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -159,7 +159,7 @@ func renderLink(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 42, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 42, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -209,7 +209,7 @@ func renderStrong(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 48, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 48, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -259,7 +259,7 @@ func renderEmphasis(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 54, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 54, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -309,7 +309,7 @@ func renderCode(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 60, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 60, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/blocks/global.templ b/nebula/blocks/global.templ similarity index 100% rename from pkg/nebula/blocks/global.templ rename to nebula/blocks/global.templ diff --git a/pkg/nebula/blocks/global_templ.go b/nebula/blocks/global_templ.go similarity index 100% rename from pkg/nebula/blocks/global_templ.go rename to nebula/blocks/global_templ.go diff --git a/pkg/nebula/blocks/icons.templ b/nebula/blocks/icons.templ similarity index 100% rename from pkg/nebula/blocks/icons.templ rename to nebula/blocks/icons.templ diff --git a/pkg/nebula/blocks/icons_templ.go b/nebula/blocks/icons_templ.go similarity index 100% rename from pkg/nebula/blocks/icons_templ.go rename to nebula/blocks/icons_templ.go diff --git a/pkg/nebula/blocks/inputs.templ b/nebula/blocks/inputs.templ similarity index 100% rename from pkg/nebula/blocks/inputs.templ rename to nebula/blocks/inputs.templ diff --git a/pkg/nebula/blocks/inputs_templ.go b/nebula/blocks/inputs_templ.go similarity index 93% rename from pkg/nebula/blocks/inputs_templ.go rename to nebula/blocks/inputs_templ.go index 7938e89cc..e29a695a0 100644 --- a/pkg/nebula/blocks/inputs_templ.go +++ b/nebula/blocks/inputs_templ.go @@ -46,7 +46,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/inputs.templ`, Line: 15, Col: 128} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 15, Col: 128} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -64,7 +64,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/inputs.templ`, Line: 20, Col: 128} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 20, Col: 128} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -82,7 +82,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/inputs.templ`, Line: 25, Col: 128} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 25, Col: 128} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/blocks/panel.templ b/nebula/blocks/panel.templ similarity index 100% rename from pkg/nebula/blocks/panel.templ rename to nebula/blocks/panel.templ diff --git a/pkg/nebula/blocks/panel_templ.go b/nebula/blocks/panel_templ.go similarity index 97% rename from pkg/nebula/blocks/panel_templ.go rename to nebula/blocks/panel_templ.go index 39b623cbe..d6c417bfa 100644 --- a/pkg/nebula/blocks/panel_templ.go +++ b/nebula/blocks/panel_templ.go @@ -100,7 +100,7 @@ func breadcrumbItem(title string, active bool) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/panel.templ`, Line: 25, Col: 126} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/panel.templ`, Line: 25, Col: 126} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -118,7 +118,7 @@ func breadcrumbItem(title string, active bool) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/panel.templ`, Line: 27, Col: 118} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/panel.templ`, Line: 27, Col: 118} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/blocks/radios.templ b/nebula/blocks/radios.templ similarity index 100% rename from pkg/nebula/blocks/radios.templ rename to nebula/blocks/radios.templ diff --git a/pkg/nebula/blocks/radios_templ.go b/nebula/blocks/radios_templ.go similarity index 100% rename from pkg/nebula/blocks/radios_templ.go rename to nebula/blocks/radios_templ.go diff --git a/pkg/nebula/blocks/sizes.templ b/nebula/blocks/sizes.templ similarity index 100% rename from pkg/nebula/blocks/sizes.templ rename to nebula/blocks/sizes.templ diff --git a/pkg/nebula/blocks/sizes_templ.go b/nebula/blocks/sizes_templ.go similarity index 100% rename from pkg/nebula/blocks/sizes_templ.go rename to nebula/blocks/sizes_templ.go diff --git a/pkg/nebula/blocks/tabs.templ b/nebula/blocks/tabs.templ similarity index 100% rename from pkg/nebula/blocks/tabs.templ rename to nebula/blocks/tabs.templ diff --git a/pkg/nebula/blocks/tabs_templ.go b/nebula/blocks/tabs_templ.go similarity index 100% rename from pkg/nebula/blocks/tabs_templ.go rename to nebula/blocks/tabs_templ.go diff --git a/nebula/devbox.json b/nebula/devbox.json new file mode 100644 index 000000000..916674a6a --- /dev/null +++ b/nebula/devbox.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json", + "packages": [ + "bun@latest" + ], + "env": { + "CLOUDFLARE_API_TOKEN": "$CLOUDFLARE_API_TOKEN", + "GOPATH": "$HOME/go", + "PATH": "$HOME/go/bin:$PATH", + "TEMPL_EXPERIMENT": "rawgo", + "CHAIN_ID": "sonr-testnet-1", + "DENOM": "usnr", + "KEYRING": "test", + "MONIKER": "florence", + "ENV": "$ENVIRONMENT" + }, + "shell": { + "scripts": { + "build": [ + "make build" + ] + } + } +} diff --git a/nebula/nebula.go b/nebula/nebula.go new file mode 100644 index 000000000..2808317c2 --- /dev/null +++ b/nebula/nebula.go @@ -0,0 +1 @@ +package nebula diff --git a/pkg/nebula/pages/home.templ b/nebula/pages/home.templ similarity index 93% rename from pkg/nebula/pages/home.templ rename to nebula/pages/home.templ index d5d0f2a93..f9c31302a 100644 --- a/pkg/nebula/pages/home.templ +++ b/nebula/pages/home.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) func Home(c echo.Context) error { diff --git a/pkg/nebula/pages/home_templ.go b/nebula/pages/home_templ.go similarity index 99% rename from pkg/nebula/pages/home_templ.go rename to nebula/pages/home_templ.go index 8b438f4d6..f00d95bb0 100644 --- a/pkg/nebula/pages/home_templ.go +++ b/nebula/pages/home_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) func Home(c echo.Context) error { diff --git a/pkg/nebula/pages/login.templ b/nebula/pages/login.templ similarity index 90% rename from pkg/nebula/pages/login.templ rename to nebula/pages/login.templ index 9374f1a84..68f8b2e18 100644 --- a/pkg/nebula/pages/login.templ +++ b/nebula/pages/login.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) func Login(c echo.Context) error { diff --git a/pkg/nebula/pages/login_templ.go b/nebula/pages/login_templ.go similarity index 99% rename from pkg/nebula/pages/login_templ.go rename to nebula/pages/login_templ.go index ae48b92d8..696b731c2 100644 --- a/pkg/nebula/pages/login_templ.go +++ b/nebula/pages/login_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) func Login(c echo.Context) error { diff --git a/pkg/nebula/pages/openid.templ b/nebula/pages/openid.templ similarity index 87% rename from pkg/nebula/pages/openid.templ rename to nebula/pages/openid.templ index 9120e3724..2d1a677c4 100644 --- a/pkg/nebula/pages/openid.templ +++ b/nebula/pages/openid.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) func Authorize(c echo.Context) error { diff --git a/pkg/nebula/pages/openid_templ.go b/nebula/pages/openid_templ.go similarity index 98% rename from pkg/nebula/pages/openid_templ.go rename to nebula/pages/openid_templ.go index aeaa16d34..c1df7f246 100644 --- a/pkg/nebula/pages/openid_templ.go +++ b/nebula/pages/openid_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) func Authorize(c echo.Context) error { diff --git a/pkg/nebula/pages/pages.go b/nebula/pages/pages.go similarity index 100% rename from pkg/nebula/pages/pages.go rename to nebula/pages/pages.go diff --git a/pkg/nebula/pages/profile.templ b/nebula/pages/profile.templ similarity index 85% rename from pkg/nebula/pages/profile.templ rename to nebula/pages/profile.templ index 1abca0e8d..97af91f61 100644 --- a/pkg/nebula/pages/profile.templ +++ b/nebula/pages/profile.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) func Profile(c echo.Context) error { diff --git a/pkg/nebula/pages/profile_templ.go b/nebula/pages/profile_templ.go similarity index 98% rename from pkg/nebula/pages/profile_templ.go rename to nebula/pages/profile_templ.go index c4f4a6a2d..7d5f4aead 100644 --- a/pkg/nebula/pages/profile_templ.go +++ b/nebula/pages/profile_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) func Profile(c echo.Context) error { diff --git a/pkg/nebula/pages/register.templ b/nebula/pages/register.templ similarity index 97% rename from pkg/nebula/pages/register.templ rename to nebula/pages/register.templ index 6f4ef0bf0..6ecbad47b 100644 --- a/pkg/nebula/pages/register.templ +++ b/nebula/pages/register.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) type FormState string diff --git a/pkg/nebula/pages/register_templ.go b/nebula/pages/register_templ.go similarity index 99% rename from pkg/nebula/pages/register_templ.go rename to nebula/pages/register_templ.go index dabc8bcd5..568a22d0c 100644 --- a/pkg/nebula/pages/register_templ.go +++ b/nebula/pages/register_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) type FormState string diff --git a/pkg/nebula/nebula.go b/pkg/nebula/nebula.go deleted file mode 100644 index a3237757b..000000000 --- a/pkg/nebula/nebula.go +++ /dev/null @@ -1,14 +0,0 @@ -package nebula - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/pages" -) - -func RegisterHandlers(e *echo.Echo) { - e.GET("/home", pages.Home) - e.GET("/login", pages.Login) - e.GET("/register", pages.Register) - e.GET("/profile", pages.Profile) - e.GET("/authorize", pages.Authorize) -} diff --git a/pkg/nebula/view.go b/pkg/nebula/view.go deleted file mode 100644 index fe72ad483..000000000 --- a/pkg/nebula/view.go +++ /dev/null @@ -1,27 +0,0 @@ -package nebula - -import ( - "bytes" - - "github.com/a-h/templ" - "github.com/labstack/echo/v4" -) - -func Render(cmp templ.Component) echo.HandlerFunc { - return func(c echo.Context) error { - // Create a buffer to store the rendered HTML - buf := &bytes.Buffer{} - // Render the component to the buffer - err := cmp.Render(c.Request().Context(), buf) - if err != nil { - return err - } - - // Set the content type - c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) - - // Write the buffered content to the response - _, err = c.Response().Write(buf.Bytes()) - return err - } -} diff --git a/pkg/proxy/README.md b/pkg/proxy/README.md deleted file mode 100644 index 10ca30fcc..000000000 --- a/pkg/proxy/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# sonr.id - -A public decentralized web node client for the Sonr Network. - -## Development - -### Prerequisites - -- Bun -- Devbox -- Docker - -### Setup - -1. Install [Devbox](https://github.com/jetpack-io/devbox) -2. Install [Bun](https://bun.sh/docs/installation) -3. Install [Docker](https://docs.docker.com/get-docker/) -4. Run `devbox run dev` diff --git a/pkg/proxy/main.go b/pkg/proxy/main.go deleted file mode 100644 index dacf6f1a3..000000000 --- a/pkg/proxy/main.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build wasm - -package main - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/proxy/routes" - "github.com/syumai/workers" -) - -// # Sonr.ID -// -// This App is used as an IPFS gateway proxy for exissting Sonr DWN nodes -func main() { - // TODO: Route from /ipfs/cid and /ipns/did to the gateway - // 1. Display Generic Homepage - e := echo.New() - // Configure the server - e.GET("/", routes.HomeView) - e.GET("/allocate", routes.AllocateView) - // 2. Present Terms Agreement and Checkbox to Accept - // 3. Collect UserAgent, Set-Cookie, and Client Headers - // 4. Redirect to DWN Node - workers.Serve(e) -} diff --git a/pkg/proxy/routes/allocate.templ b/pkg/proxy/routes/allocate.templ deleted file mode 100644 index 71ccecbdf..000000000 --- a/pkg/proxy/routes/allocate.templ +++ /dev/null @@ -1,18 +0,0 @@ -package routes - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" -) - -func AllocateView(c echo.Context) error { - return echoComponentResponse(c, renderAuthorizeView()) -} - -templ renderAuthorizeView() { - @blocks.Card("authorize-view", blocks.SizeMedium) { - @blocks.H1("Sonr.ID") - @blocks.Text("Neo-tree is a file manager for NeoFS.") - } -} - diff --git a/pkg/proxy/routes/allocate_templ.go b/pkg/proxy/routes/allocate_templ.go deleted file mode 100644 index 66e703de1..000000000 --- a/pkg/proxy/routes/allocate_templ.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package routes - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" -) - -func AllocateView(c echo.Context) error { - return echoComponentResponse(c, renderAuthorizeView()) -} - -func renderAuthorizeView() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Card("authorize-view", blocks.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/proxy/routes/home.templ b/pkg/proxy/routes/home.templ deleted file mode 100644 index c9c927bff..000000000 --- a/pkg/proxy/routes/home.templ +++ /dev/null @@ -1,28 +0,0 @@ -package routes - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" -) - -func HomeView(c echo.Context) error { - return echoComponentResponse(c, renderHomeView()) -} - -templ renderHomeView() { - @blocks.Card("home-view", blocks.SizeLarge) { - @blocks.H1("Sonr.ID") - @blocks.Text("A Decentralized Web Node Client for the Sonr Network.") - @blocks.Spacer() -
- @blocks.Button(blocks.GET("/register", "#home-view"), blocks.PrimaryButtonStyle()) { - @blocks.Text("Get Started") - } - @blocks.Button(blocks.GET("/login", "#home-view")) { - @blocks.Text("Login") - } -
- @blocks.PoweredBySonr() - } -} - diff --git a/pkg/proxy/routes/home_templ.go b/pkg/proxy/routes/home_templ.go deleted file mode 100644 index deeb75b60..000000000 --- a/pkg/proxy/routes/home_templ.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package routes - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" -) - -func HomeView(c echo.Context) error { - return echoComponentResponse(c, renderHomeView()) -} - -func renderHomeView() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Text("A Decentralized Web Node Client for the Sonr Network.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.Text("Get Started").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Button(blocks.GET("/register", "#home-view"), blocks.PrimaryButtonStyle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.Text("Login").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Button(blocks.GET("/login", "#home-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.PoweredBySonr().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Card("home-view", blocks.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/proxy/routes/pages.go b/pkg/proxy/routes/pages.go deleted file mode 100644 index 49aeacfce..000000000 --- a/pkg/proxy/routes/pages.go +++ /dev/null @@ -1,27 +0,0 @@ -package routes - -import ( - "bytes" - - "github.com/a-h/templ" - "github.com/labstack/echo/v4" -) - -// render renders a templ.Component -func echoComponentResponse(c echo.Context, cmp templ.Component) error { - // Create a buffer to store the rendered HTML - buf := &bytes.Buffer{} - - // Render the component to the buffer - err := cmp.Render(c.Request().Context(), buf) - if err != nil { - return err - } - - // Set the content type - c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) - - // Write the buffered content to the response - _, err = c.Response().Write(buf.Bytes()) - return err -} diff --git a/pkg/proxy/wrangler.toml b/pkg/proxy/wrangler.toml deleted file mode 100644 index 959f185c1..000000000 --- a/pkg/proxy/wrangler.toml +++ /dev/null @@ -1,9 +0,0 @@ -name = "sonr-id" -main = "./build/worker.mjs" -compatibility_date = "2024-07-26" - -[dev] -ip = "localhost" - -[build] -command = "devbox run build:motr" diff --git a/pkg/vault/vault.go b/pkg/vault/vault.go deleted file mode 100644 index 1260bd682..000000000 --- a/pkg/vault/vault.go +++ /dev/null @@ -1,61 +0,0 @@ -package vault - -import ( - "github.com/cosmos/cosmos-sdk/types/bech32" - "github.com/ipfs/boxo/files" - "github.com/onsonr/crypto/mpc" - "github.com/onsonr/sonr/config/dwn" -) - -type SchemaVersion = int - -var CurrentSchemaVersion SchemaVersion = 1 - -type Vault struct { - FS files.Node - ValKs mpc.Share -} - -func New(subject string, origin string, chainID string) (*Vault, error) { - shares, err := mpc.GenerateKeyshares() - var ( - valKs = shares[0] - usrKs = shares[1] - ) - usrKsJSON, err := usrKs.Marshal() - if err != nil { - return nil, err - } - - sonrAddr, err := bech32.ConvertAndEncode("idx", valKs.GetPublicKey()) - if err != nil { - return nil, err - } - - cnfg := NewConfig(usrKsJSON, sonrAddr, chainID, DefaultSchema()) - - fileMap, err := NewVaultDirectory(cnfg) - if err != nil { - return nil, err - } - - return &Vault{ - FS: fileMap, - ValKs: valKs, - }, nil -} - -func DefaultSchema() *dwn.Schema { - return &dwn.Schema{ - Version: CurrentSchemaVersion, - Account: "++, id, name, address, publicKey, chainCode, index, controller, createdAt", - Asset: "++, id, name, symbol, decimals, chainCode, createdAt", - Chain: "++, id, name, networkId, chainCode, createdAt", - Credential: "++, id, subject, controller, attestationType, origin, label, deviceId, credentialId, publicKey, transport, signCount, userPresent, userVerified, backupEligible, backupState, cloneWarning, createdAt, updatedAt", - Jwk: "++, kty, crv, x, y, n, e", - Grant: "++, subject, controller, origin, token, scopes, createdAt, updatedAt", - Keyshare: "++, id, data, role, createdAt, lastRefreshed", - PublicKey: "++, role, algorithm, encoding, curve, key_type, raw, jwk", - Profile: "++, id, subject, controller, originUri, publicMetadata, privateMetadata, createdAt, updatedAt", - } -} diff --git a/proto/buf.yaml b/proto/buf.yaml index 6301a3b3f..c4f0b5ffa 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -10,9 +10,12 @@ lint: - DEFAULT - COMMENTS - FILE_LOWER_SNAKE_CASE - except: + ignore: - UNARY_RPC - COMMENT_FIELD - SERVICE_SUFFIX - PACKAGE_VERSION_SUFFIX - RPC_REQUEST_STANDARD_NAME + - FILE_OPTIONS_REQUIRE_GO_PACKAGE + - FILE_OPTIONS_REQUIRE_GO_PACKAGE + - PACKAGE_VERSION_SUFFIX diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index 65e92ed09..636ca6043 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -24,17 +24,11 @@ message Params { // Whitelisted Key Types map allowed_public_keys = 2; - // IpfsActive is a flag to enable/disable ipfs - bool ipfs_active = 3; - - // Localhost Registration Enabled - bool localhost_registration_enabled = 4; - // ConveyancePreference defines the conveyance preference - string conveyance_preference = 5; + string conveyance_preference = 3; // AttestationFormats defines the attestation formats - repeated string attestation_formats = 6; + repeated string attestation_formats = 4; } // AssetInfo defines the asset info @@ -74,7 +68,8 @@ message KeyInfo { string role = 1; string algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K" string encoding = 3; // e.g., "hex", "base64", "multibase" - string curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" + string curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", + // "Ed25519", "Ed448", "secp256k1" string type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" } diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index b7a743b3e..c869dd38d 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -17,11 +17,6 @@ service Query { rpc Resolve(QueryRequest) returns (QueryResolveResponse) { option (google.api.http).get = "/did/{did}"; } - - // Sync queries the DID document by its id. And returns the required PKL information - rpc Sync(SyncRequest) returns (SyncResponse) { - option (google.api.http).post = "/sync"; - } } // Queryequest is the request type for the Query/Params RPC method. @@ -32,14 +27,6 @@ message QueryRequest { string asset = 4; } -// QueryResolveResponse is the response type for the Query/Resolve RPC method. -message QueryResponse { - bool success = 1; - string query = 2; - Document document = 3; - Params params = 5; -} - // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params defines the parameters of the module. @@ -51,13 +38,3 @@ message QueryResolveResponse { // document is the DID document Document document = 1; } - -// SyncRequest is the request type for the Sync RPC method. -message SyncRequest { - string did = 1; -} - -// SyncResponse is the response type for the Sync RPC method. -message SyncResponse { - bool success = 1; -} diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index 4c40b7627..c66e8716b 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -33,7 +33,10 @@ message Alias { message Controller { option (cosmos.orm.v1.table) = { id: 2 - primary_key: {fields: "id"} + primary_key: { + fields: "number" + auto_increment: true + } index: { id: 1 fields: "sonr_address" @@ -51,49 +54,41 @@ message Controller { } index: { id: 4 - fields: "vault_cid" - unique: true - } - index: { - id: 5 - fields: "status,vault_cid" + fields: "did" unique: true } }; // The unique identifier of the controller - string id = 1; + uint64 number = 1; + + // The unique identifier of the controller + string did = 2; // The DID of the controller - string sonr_address = 2; + string sonr_address = 3; // The DID of the controller - string eth_address = 3; + string eth_address = 4; // The DID of the controller - string btc_address = 4; - - // Aliases of the controller - repeated string aliases = 5; + string btc_address = 5; // PubKey is the verification method - PubKey public_key = 6; + bytes public_key = 6; - // The vault address or identifier - string vault_cid = 7; - - // The Authentications of the controller - repeated string authentication = 8; + // Val Keyshare + string ks_val = 7; // The Status of the claims for the controller - string status = 9; + bool claimed = 8; } // Verification reprsents a method of verifying membership in a DID message Verification { option (cosmos.orm.v1.table) = { id: 4 - primary_key: {fields: "id"} + primary_key: {fields: "did"} index: { id: 1 fields: "issuer,subject" @@ -112,7 +107,7 @@ message Verification { }; // The unique identifier of the verification - string id = 1; + string did = 1; // The controller of the verification string controller = 2; @@ -129,6 +124,7 @@ message Verification { // The public key of the verification PubKey public_key = 6; - // The Verification Type (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + // The Verification Type (Authentication, Assertion, CapabilityDelegation, + // CapabilityInvocation) string verification_type = 7; } diff --git a/proto/did/v1/tx.proto b/proto/did/v1/tx.proto index b242a37d8..b4fdd71f2 100644 --- a/proto/did/v1/tx.proto +++ b/proto/did/v1/tx.proto @@ -12,55 +12,27 @@ option go_package = "github.com/onsonr/sonr/x/did/types"; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; - // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. - // this operation is called by services initiating a controller registration. - rpc AllocateVault(MsgAllocateVault) returns (MsgAllocateVaultResponse); - // AuthorizeService asserts the given controller is the owner of the given address. + // AuthorizeService asserts the given controller is the owner of the given + // address. rpc AuthorizeService(MsgAuthorizeService) returns (MsgAuthorizeServiceResponse); - // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages Macaroon for verification. + // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages + // Macaroon for verification. rpc ExecuteTx(MsgExecuteTx) returns (MsgExecuteTxResponse); - // 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); - // 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. rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse); // UpdateParams defines a governance operation for updating the parameters. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } -// MsgAllocateVault is the message type for the AllocateVault RPC. -message MsgAllocateVault { - option (cosmos.msg.v1.signer) = "authority"; - - // authority is the address of the service account. - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // subject is a unique human-defined identifier to associate with the vault. - string subject = 2; - - // origin is the origin of the request in wildcard form. - string origin = 3; -} - -// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. -message MsgAllocateVaultResponse { - // CID is the content identifier of the vault. - string cid = 1; - - // ExpiryBlock is the block number at which the vault will expire. - int64 expiry_block = 2; - - // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn - string token = 3; - - // IsLocalhost is a flag to indicate if the vault is localhost - bool localhost = 4; -} - // MsgRegisterController is the message type for the InitializeController RPC. message MsgRegisterController { option (cosmos.msg.v1.signer) = "authority"; @@ -74,13 +46,16 @@ message MsgRegisterController { // Keyshares is the list of keyshares to initialize the controller with. repeated bytes keyshares = 3; - // Verifications is the list of verifications to initialize the controller with. + // Verifications is the list of verifications to initialize the controller + // with. repeated bytes verifications = 4; } -// MsgRegisterControllerResponse is the response type for the InitializeController RPC. +// MsgRegisterControllerResponse is the response type for the +// InitializeController RPC. message MsgRegisterControllerResponse { - // Success returns true if the specified cid is valid and not already encrypted. + // Success returns true if the specified cid is valid and not already + // encrypted. bool success = 1; // Controller is the address of the initialized controller. @@ -127,7 +102,8 @@ message MsgAuthorizeService { string token = 4; } -// MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. +// MsgAuthorizeServiceResponse is the response type for the AuthorizeService +// RPC. message MsgAuthorizeServiceResponse { bool success = 1; string token = 2; @@ -140,7 +116,8 @@ message MsgRegisterService { // authority is the address of the governance account. string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // origin is the origin of the request in wildcard form. Requires valid TXT record in DNS. + // origin is the origin of the request in wildcard form. Requires valid TXT + // record in DNS. Service service = 2; } diff --git a/proto/vault/module/v1/module.proto b/proto/vault/module/v1/module.proto new file mode 100644 index 000000000..e23456c26 --- /dev/null +++ b/proto/vault/module/v1/module.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package vault.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the app config object of the module. +// Learn more: https://docs.cosmos.network/main/building-modules/depinject +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import : "github.com/onsonr/sonr" + }; +} \ No newline at end of file diff --git a/proto/vault/v1/genesis.proto b/proto/vault/v1/genesis.proto new file mode 100644 index 000000000..350ba1c73 --- /dev/null +++ b/proto/vault/v1/genesis.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package vault.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/onsonr/sonr/x/vault/types"; + +// GenesisState defines the module genesis state +message GenesisState { + // Params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// Params defines the set of module parameters. +message Params { + option (amino.name) = "vault/params"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + bool ipfs_active = 1; + bool local_registration_enabled = 2; + Schema schema = 3; +} + +message Schema { + int32 version = 1; + string account = 2; + string asset = 3; + string chain = 4; + string credential = 5; + string jwk = 6; + string grant = 7; + string keyshare = 8; + string publicKey = 9; + string profile = 10; +} diff --git a/proto/vault/v1/query.proto b/proto/vault/v1/query.proto new file mode 100644 index 000000000..9e2d0f501 --- /dev/null +++ b/proto/vault/v1/query.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; +package vault.v1; + +import "google/api/annotations.proto"; +import "vault/v1/genesis.proto"; + +option go_package = "github.com/onsonr/sonr/x/vault/types"; + +// Query provides defines the gRPC querier service. +service Query { + // Params queries all parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/vault/v1/params"; + } + + // BuildTx builds an unsigned transaction message for the given PKL. + rpc BuildTx(BuildTxRequest) returns (BuildTxResponse) { + option (google.api.http).post = "/vault/v1/buildtx"; + } + + // Sync queries the DID document by its id. And returns the required PKL + // information + rpc Sync(SyncRequest) returns (SyncResponse) { + option (google.api.http).post = "/vault/v1/sync"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} + +// QueryIPFSRequest is the request type for the Query/IPFS RPC method. +message QueryIPFSRequest {} + +// QueryIPFSResponse is the response type for the Query/IPFS RPC method. +message QueryIPFSResponse { + // IPFS is the IPFS client status. + bool ipfs = 1; +} + +// SyncRequest is the request type for the Sync RPC method. +message SyncRequest { + string did = 1; +} + +// SyncResponse is the response type for the Sync RPC method. +message SyncResponse { + bool success = 1; +} + +// BuildTxRequest is the request type for the BuildTx RPC method. +message BuildTxRequest { + string did = 1; + string pkl = 2; +} + +// BuildTxResponse is the response type for the BuildTx RPC method. +message BuildTxResponse { + bool success = 1; + string tx = 2; +} diff --git a/proto/vault/v1/state.proto b/proto/vault/v1/state.proto new file mode 100644 index 000000000..fa0f67600 --- /dev/null +++ b/proto/vault/v1/state.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package vault.v1; + +import "cosmos/orm/v1/orm.proto"; + +option go_package = "github.com/onsonr/sonr/x/vault/types"; + +// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md + +message DWN { + option (cosmos.orm.v1.table) = { + id: 1 + primary_key: {fields: "account"} + index: { + id: 1 + fields: "amount" + } + }; + + bytes account = 1; + uint64 amount = 2; +} diff --git a/proto/vault/v1/tx.proto b/proto/vault/v1/tx.proto new file mode 100644 index 000000000..b2c491568 --- /dev/null +++ b/proto/vault/v1/tx.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; +package vault.v1; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "vault/v1/genesis.proto"; + +option go_package = "github.com/onsonr/sonr/x/vault/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + // AllocateVault assembles a sqlite3 database in a local directory and returns + // the CID of the database. this operation is called by services initiating a + // controller registration. + rpc AllocateVault(MsgAllocateVault) returns (MsgAllocateVaultResponse); + + // UpdateParams defines a governance operation for updating the parameters. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgAllocateVault is the message type for the AllocateVault RPC. +message MsgAllocateVault { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the service account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // subject is a unique human-defined identifier to associate with the vault. + string subject = 2; + + // origin is the origin of the request in wildcard form. + string origin = 3; +} + +// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. +message MsgAllocateVaultResponse { + // CID is the content identifier of the vault. + string cid = 1; + + // ExpiryBlock is the block number at which the vault will expire. + int64 expiry_block = 2; + + // RegistrationOptions is a json string of the + // PublicKeyCredentialCreationOptions for WebAuthn + string token = 3; + + // IsLocalhost is a flag to indicate if the vault is localhost + bool localhost = 4; +} diff --git a/x/did/keeper/context.go b/x/did/keeper/context.go deleted file mode 100644 index bae765c07..000000000 --- a/x/did/keeper/context.go +++ /dev/null @@ -1,165 +0,0 @@ -package keeper - -import ( - "context" - "crypto/sha256" - "fmt" - "time" - - nftkeeper "cosmossdk.io/x/nft/keeper" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ipfs/boxo/path" - "github.com/ipfs/kubo/client/rpc" - "github.com/ipfs/kubo/core/coreiface/options" - "github.com/onsonr/sonr/pkg/vault" - "github.com/onsonr/sonr/x/did/types" - "google.golang.org/grpc/peer" - "gopkg.in/macaroon.v2" -) - -func (k Keeper) UnwrapCtx(goCtx context.Context) Context { - ctx := sdk.UnwrapSDKContext(goCtx) - peer, _ := peer.FromContext(goCtx) - return Context{SDKCtx: ctx, Peer: peer, Keeper: k} -} - -type Context struct { - SDKCtx sdk.Context - Keeper Keeper - Peer *peer.Peer - NFTKeeper nftkeeper.Keeper -} - -// AssembleVault assembles the initial vault -func (k Keeper) AssembleVault(ctx Context, subject string, origin string) (string, int64, error) { - v, err := vault.New(subject, origin, "sonr-testnet") - if err != nil { - return "", 0, err - } - cid, err := k.ipfsClient.Unixfs().Add(context.Background(), v.FS) - if err != nil { - return "", 0, err - } - return cid.String(), ctx.CalculateExpiration(time.Second * 15), nil -} - -// AverageBlockTime returns the average block time in seconds -func (c Context) AverageBlockTime() float64 { - return float64(c.SDK().BlockTime().Sub(c.SDK().BlockTime()).Seconds()) -} - -// GetExpirationBlockHeight returns the block height at which the given duration will have passed -func (c Context) CalculateExpiration(duration time.Duration) int64 { - return c.SDKCtx.BlockHeight() + int64(duration.Seconds()/c.AverageBlockTime()) -} - -// IPFSConnected returns true if the IPFS client is initialized -func (c Context) IPFSConnected() bool { - if c.Keeper.ipfsClient == nil { - ipfsClient, err := rpc.NewLocalApi() - if err != nil { - return false - } - c.Keeper.ipfsClient = ipfsClient - } - return c.Keeper.ipfsClient != nil -} - -func (c Context) IsAnonymous() bool { - if c.Peer == nil { - return true - } - return c.Peer.Addr == nil -} - -// IssueMacaroon creates a macaroon with the specified parameters. -func (c Context) IssueMacaroon(sharedMPCPubKey, location, id string, blockExpiry uint64) (*macaroon.Macaroon, error) { - // Derive the root key by hashing the shared MPC public key - rootKey := sha256.Sum256([]byte(sharedMPCPubKey)) - // Create the macaroon - m, err := macaroon.New(rootKey[:], []byte(id), location, macaroon.LatestVersion) - if err != nil { - return nil, err - } - - // Add the block expiry caveat - caveat := fmt.Sprintf("block-expiry=%d", blockExpiry) - err = m.AddFirstPartyCaveat([]byte(caveat)) - if err != nil { - return nil, err - } - - return m, nil -} - -func (c Context) Params() *types.Params { - p, err := c.Keeper.Params.Get(c.SDK()) - if err != nil { - p = types.DefaultParams() - } - params := p.ActiveParams(c.IPFSConnected()) - return ¶ms -} - -func (c Context) PeerID() string { - if c.Peer == nil { - return "" - } - return c.Peer.Addr.String() -} - -// PinVaultController pins the initial vault to the local IPFS node -func (k Keeper) PinVaultController(_ sdk.Context, cid string, address string) (bool, error) { - // Resolve the path - path, err := path.NewPath(cid) - if err != nil { - return false, err - } - - // 1. Initialize vault.db sqlite database in local IPFS with Mount - - // 2. Insert the InitialWalletAccounts - - // 3. Publish the path to the IPNS - _, err = k.ipfsClient.Name().Publish(context.Background(), path, options.Name.Key(address)) - if err != nil { - return false, err - } - - // 4. Insert the accounts into x/auth - - // 5. Insert the controller into state - return true, nil -} - -func (c Context) SDK() sdk.Context { - return c.SDKCtx -} - -// ValidateOrigin checks if a service origin is valid -func (c Context) ValidateOrigin(origin string) error { - if origin == "localhost" { - return nil - } - return types.ErrInvalidServiceOrigin -} - -// VerifyMinimumStake checks if a validator has a minimum stake -func (c Context) VerifyMinimumStake(addr string) bool { - address, err := sdk.AccAddressFromBech32(addr) - if err != nil { - return false - } - addval, err := sdk.ValAddressFromBech32(addr) - if err != nil { - return false - } - del, err := c.Keeper.StakingKeeper.GetDelegation(c.SDK(), address, addval) - if err != nil { - return false - } - if del.Shares.IsZero() { - return false - } - return del.Shares.IsPositive() -} diff --git a/x/did/keeper/controller.go b/x/did/keeper/controller.go new file mode 100644 index 000000000..20f1a3763 --- /dev/null +++ b/x/did/keeper/controller.go @@ -0,0 +1,27 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onsonr/crypto/mpc" + "github.com/onsonr/sonr/x/did/types" +) + +func (k Keeper) NewController(ctx sdk.Context) (uint64, types.ControllerI, error) { + shares, err := mpc.GenerateKeyshares() + if err != nil { + return 0, nil, err + } + controller, err := types.NewController(shares) + if err != nil { + return 0, nil, err + } + entry, err := controller.GetTableEntry() + if err != nil { + return 0, nil, err + } + num, err := k.OrmDB.ControllerTable().InsertReturningNumber(ctx, entry) + if err != nil { + return 0, nil, err + } + return num, controller, nil +} diff --git a/x/did/keeper/genesis.go b/x/did/keeper/genesis.go index a1b904878..74ba610c4 100644 --- a/x/did/keeper/genesis.go +++ b/x/did/keeper/genesis.go @@ -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 } diff --git a/x/did/keeper/keeper.go b/x/did/keeper/keeper.go index 20a10ea34..86523a2ad 100644 --- a/x/did/keeper/keeper.go +++ b/x/did/keeper/keeper.go @@ -7,13 +7,11 @@ import ( "cosmossdk.io/orm/model/ormdb" nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "github.com/ipfs/kubo/client/rpc" apiv1 "github.com/onsonr/sonr/api/did/v1" "github.com/onsonr/sonr/x/did/types" @@ -34,8 +32,7 @@ type Keeper struct { NftKeeper nftkeeper.Keeper StakingKeeper *stakkeeper.Keeper - authority string - ipfsClient *rpc.HttpApi + authority string } // NewKeeper creates a new poa Keeper instance @@ -66,11 +63,9 @@ func NewKeeper( } // Initialize IPFS client - ipfsClient, _ := rpc.NewLocalApi() k := Keeper{ - ipfsClient: ipfsClient, - cdc: cdc, - logger: logger, + cdc: cdc, + logger: logger, Params: collections.NewItem( sb, types.ParamsKey, @@ -91,13 +86,3 @@ func NewKeeper( k.Schema = schema return k } - -// VerifyServicePermissions checks if a service has permission -func (k Keeper) VerifyServicePermissions( - ctx sdk.Context, - addr string, - service string, - permissions string, -) bool { - return false -} diff --git a/x/did/keeper/macaroon.go b/x/did/keeper/macaroon.go new file mode 100644 index 000000000..b2bb9dd75 --- /dev/null +++ b/x/did/keeper/macaroon.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "crypto/sha256" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "gopkg.in/macaroon.v2" +) + +// IssueMacaroon creates a macaroon with the specified parameters. +func (k Keeper) IssueMacaroon(ctx sdk.Context, sharedMPCPubKey, location, id string, blockExpiry uint64) (*macaroon.Macaroon, error) { + // Derive the root key by hashing the shared MPC public key + rootKey := sha256.Sum256([]byte(sharedMPCPubKey)) + // Create the macaroon + m, err := macaroon.New(rootKey[:], []byte(id), location, macaroon.LatestVersion) + if err != nil { + return nil, err + } + + // Add the block expiry caveat + caveat := fmt.Sprintf("block-expiry=%d", blockExpiry) + err = m.AddFirstPartyCaveat([]byte(caveat)) + if err != nil { + return nil, err + } + + return m, nil +} diff --git a/x/did/keeper/querier.go b/x/did/keeper/querier.go index d95f04018..ef7ec9cfe 100644 --- a/x/did/keeper/querier.go +++ b/x/did/keeper/querier.go @@ -3,6 +3,7 @@ package keeper import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/onsonr/sonr/x/did/types" ) @@ -17,25 +18,16 @@ func NewQuerier(keeper Keeper) Querier { } // Params returns the total set of did parameters. -func (k Querier) Params( - goCtx context.Context, - req *types.QueryRequest, -) (*types.QueryParamsResponse, error) { - ctx := k.UnwrapCtx(goCtx) - return &types.QueryParamsResponse{Params: ctx.Params()}, nil +func (k Querier) Params(goCtx context.Context, req *types.QueryRequest) (*types.QueryParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + p, err := k.Keeper.CurrentParams(ctx) + if err != nil { + return nil, err + } + return &types.QueryParamsResponse{Params: p}, nil } // Resolve implements types.QueryServer. -func (k Querier) Resolve( - goCtx context.Context, - req *types.QueryRequest, -) (*types.QueryResolveResponse, error) { - _ = k.UnwrapCtx(goCtx) +func (k Querier) Resolve(goCtx context.Context, req *types.QueryRequest) (*types.QueryResolveResponse, error) { return &types.QueryResolveResponse{}, nil } - -// Sync implements types.QueryServer. -func (k Querier) Sync(goCtx context.Context, req *types.SyncRequest) (*types.SyncResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - return &types.SyncResponse{}, nil -} diff --git a/x/did/keeper/server.go b/x/did/keeper/server.go index 8796dbf41..ed453f671 100644 --- a/x/did/keeper/server.go +++ b/x/did/keeper/server.go @@ -21,50 +21,14 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{k: keeper} } -// # AllocateVault -// -// AllocateVault implements types.MsgServer. -func (ms msgServer) AllocateVault( - goCtx context.Context, - msg *types.MsgAllocateVault, -) (*types.MsgAllocateVaultResponse, error) { - // 1.Check if the service origin is valid - ctx := ms.k.UnwrapCtx(goCtx) - if err := ctx.ValidateOrigin(msg.Origin); err != nil { - return nil, err - } - - // 2.Allocate the vault - cid, expiryBlock, err := ms.k.AssembleVault(ctx, msg.GetSubject(), msg.GetOrigin()) - if err != nil { - return nil, err - } - - // 3.Return the response - return &types.MsgAllocateVaultResponse{ - ExpiryBlock: expiryBlock, - Cid: cid, - }, nil -} - -// # RegisterController -// // RegisterController implements types.MsgServer. -func (ms msgServer) RegisterController( - goCtx context.Context, - msg *types.MsgRegisterController, -) (*types.MsgRegisterControllerResponse, error) { +func (ms msgServer) RegisterController(goCtx context.Context, msg *types.MsgRegisterController) (*types.MsgRegisterControllerResponse, error) { _ = sdk.UnwrapSDKContext(goCtx) return &types.MsgRegisterControllerResponse{}, nil } -// # RegisterService -// // RegisterService implements types.MsgServer. -func (ms msgServer) RegisterService( - goCtx context.Context, - msg *types.MsgRegisterService, -) (*types.MsgRegisterServiceResponse, error) { +func (ms msgServer) RegisterService(goCtx context.Context, msg *types.MsgRegisterService) (*types.MsgRegisterServiceResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) // 1.Check if the service origin is valid @@ -74,8 +38,6 @@ func (ms msgServer) RegisterService( return nil, errors.Wrapf(types.ErrInvalidServiceOrigin, "invalid service origin") } -// # AuthorizeService -// // AuthorizeService implements types.MsgServer. func (ms msgServer) AuthorizeService(goCtx context.Context, msg *types.MsgAuthorizeService) (*types.MsgAuthorizeServiceResponse, error) { if ms.k.authority != msg.Controller { @@ -89,13 +51,8 @@ func (ms msgServer) AuthorizeService(goCtx context.Context, msg *types.MsgAuthor return &types.MsgAuthorizeServiceResponse{}, nil } -// # UpdateParams -// // UpdateParams updates the x/did module parameters. -func (ms msgServer) UpdateParams( - ctx context.Context, - msg *types.MsgUpdateParams, -) (*types.MsgUpdateParamsResponse, error) { +func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if ms.k.authority != msg.Authority { return nil, errors.Wrapf( govtypes.ErrInvalidSigner, @@ -110,6 +67,5 @@ func (ms msgServer) UpdateParams( // ExecuteTx implements types.MsgServer. func (ms msgServer) ExecuteTx(ctx context.Context, msg *types.MsgExecuteTx) (*types.MsgExecuteTxResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) - panic("ExecuteTx is unimplemented") return &types.MsgExecuteTxResponse{}, nil } diff --git a/x/did/types/account.go b/x/did/types/account.go index ab1254f4c..16be5f447 100644 --- a/x/did/types/account.go +++ b/x/did/types/account.go @@ -1 +1,12 @@ package types + +type SonrAccount struct { + ID string + Name string + Address string + PublicKey string + ChainCode string + Index string + Controller string + CreatedAt string +} diff --git a/x/did/types/address.go b/x/did/types/address.go index ab1254f4c..faf63d532 100644 --- a/x/did/types/address.go +++ b/x/did/types/address.go @@ -1 +1,56 @@ package types + +import ( + "crypto/ecdsa" + "strings" + + "github.com/cosmos/cosmos-sdk/types/bech32" + ethcrypto "github.com/ethereum/go-ethereum/crypto" + "golang.org/x/crypto/sha3" +) + +// ComputeSonrAddress computes the Sonr address from a public key +func ComputeSonrAddress(pk []byte) (string, error) { + sonrAddr, err := bech32.ConvertAndEncode("idx", pk) + if err != nil { + return "", err + } + return sonrAddr, nil +} + +// ComputeBitcoinAddress computes the Bitcoin address from a public key +func ComputeBitcoinAddress(pk []byte) (string, error) { + btcAddr, err := bech32.ConvertAndEncode("bc", pk) + if err != nil { + return "", err + } + return btcAddr, nil +} + +// ComputeEthAddress computes the Ethereum address from a public key +func ComputeEthAddress(pk *ecdsa.PublicKey) string { + // Generate Ethereum address + address := ethcrypto.PubkeyToAddress(*pk) + + // Apply ERC-55 checksum encoding + addr := address.Hex() + addr = strings.ToLower(addr) + addr = strings.TrimPrefix(addr, "0x") + hash := sha3.NewLegacyKeccak256() + hash.Write([]byte(addr)) + hashBytes := hash.Sum(nil) + + result := "0x" + for i, c := range addr { + if c >= '0' && c <= '9' { + result += string(c) + } else { + if hashBytes[i/2]>>(4-i%2*4)&0xf >= 8 { + result += strings.ToUpper(string(c)) + } else { + result += string(c) + } + } + } + return result +} diff --git a/x/did/types/codec.go b/x/did/types/codec.go index c2913f290..018e0f547 100644 --- a/x/did/types/codec.go +++ b/x/did/types/codec.go @@ -1,12 +1,6 @@ package types import ( - "crypto/ecdsa" - "strings" - - ethcrypto "github.com/ethereum/go-ethereum/crypto" - "golang.org/x/crypto/sha3" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -32,7 +26,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil) cdc.RegisterConcrete(&MsgRegisterController{}, ModuleName+"/MsgRegisterController", nil) cdc.RegisterConcrete(&MsgRegisterService{}, ModuleName+"/MsgRegisterService", nil) - cdc.RegisterConcrete(&MsgAllocateVault{}, ModuleName+"/MsgAllocateVault", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -46,34 +39,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgUpdateParams{}, &MsgRegisterController{}, &MsgRegisterService{}, - &MsgAllocateVault{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - -func ComputeEthAddress(pk ecdsa.PublicKey) string { - // Generate Ethereum address - address := ethcrypto.PubkeyToAddress(pk) - - // Apply ERC-55 checksum encoding - addr := address.Hex() - addr = strings.ToLower(addr) - addr = strings.TrimPrefix(addr, "0x") - hash := sha3.NewLegacyKeccak256() - hash.Write([]byte(addr)) - hashBytes := hash.Sum(nil) - - result := "0x" - for i, c := range addr { - if c >= '0' && c <= '9' { - result += string(c) - } else { - if hashBytes[i/2]>>(4-i%2*4)&0xf >= 8 { - result += strings.ToUpper(string(c)) - } else { - result += string(c) - } - } - } - return result -} diff --git a/x/did/types/controller.go b/x/did/types/controller.go new file mode 100644 index 000000000..ef91f6d95 --- /dev/null +++ b/x/did/types/controller.go @@ -0,0 +1,101 @@ +package types + +import ( + fmt "fmt" + + "github.com/onsonr/crypto/mpc" + didv1 "github.com/onsonr/sonr/api/did/v1" +) + +type controller struct { + userKs mpc.Share + valKs mpc.Share + address string + chainID string + ethAddr string + btcAddr string + publicKey []byte +} + +func (c *controller) GetTableEntry() (*didv1.Controller, error) { + valKs, err := c.valKs.Marshal() + if err != nil { + return nil, err + } + return &didv1.Controller{ + KsVal: valKs, + Did: fmt.Sprintf("did:sonr:%s", c.address), + SonrAddress: c.address, + EthAddress: c.ethAddr, + BtcAddress: c.btcAddr, + PublicKey: c.publicKey, + }, nil +} + +func (c *controller) ExportUserKs() (string, error) { + return c.userKs.Marshal() +} + +func (c *controller) ChainID() string { + return c.chainID +} + +func (c *controller) SonrAddress() string { + return c.address +} + +func (c *controller) EthAddress() string { + return c.ethAddr +} + +func (c *controller) BtcAddress() string { + return c.btcAddr +} + +func (c *controller) PublicKey() []byte { + return c.publicKey +} + +type ControllerI interface { + ChainID() string + SonrAddress() string + EthAddress() string + BtcAddress() string + PublicKey() []byte + GetTableEntry() (*didv1.Controller, error) + ExportUserKs() (string, error) +} + +func NewController(shares []mpc.Share) (ControllerI, error) { + var ( + valKs = shares[0] + userKs = shares[1] + ) + pbBz := valKs.GetPublicKey() + sonrAddr, err := ComputeSonrAddress(pbBz) + if err != nil { + return nil, err + } + + btcAddr, err := ComputeBitcoinAddress(pbBz) + if err != nil { + return nil, err + } + + ecdsaPub, err := valKs.ECDSAPublicKey() + if err != nil { + return nil, err + } + + ethAddr := ComputeEthAddress(ecdsaPub) + + return &controller{ + valKs: valKs, + userKs: userKs, + address: sonrAddr, + btcAddr: btcAddr, + ethAddr: ethAddr, + chainID: "sonr-testnet-1", + publicKey: pbBz, + }, nil +} diff --git a/x/did/types/genesis.go b/x/did/types/genesis.go index 2a4ea7fc6..7cfccaea8 100644 --- a/x/did/types/genesis.go +++ b/x/did/types/genesis.go @@ -6,12 +6,12 @@ import ( ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" "cosmossdk.io/collections" - "github.com/onsonr/sonr/internal/orm/assettype" - "github.com/onsonr/sonr/internal/orm/keyalgorithm" - "github.com/onsonr/sonr/internal/orm/keycurve" - "github.com/onsonr/sonr/internal/orm/keyencoding" - "github.com/onsonr/sonr/internal/orm/keyrole" - "github.com/onsonr/sonr/internal/orm/keytype" + "github.com/onsonr/sonr/x/did/types/orm/assettype" + "github.com/onsonr/sonr/x/did/types/orm/keyalgorithm" + "github.com/onsonr/sonr/x/did/types/orm/keycurve" + "github.com/onsonr/sonr/x/did/types/orm/keyencoding" + "github.com/onsonr/sonr/x/did/types/orm/keyrole" + "github.com/onsonr/sonr/x/did/types/orm/keytype" ) // ParamsKey saves the current module params. @@ -53,23 +53,13 @@ func (gs GenesisState) Validate() error { return gs.Params.Validate() } -// // DefaultNFTClasses configures the Initial DIDNamespace NFT classes -// -// func DefaultNFTClasses(nftGenesis *nft.GenesisState) error { -// for _, n := range DIDNamespace_value { -// nftGenesis.Classes = append(nftGenesis.Classes, DIDNamespace(n).GetNFTClass()) -// } -// return nil -// } -// // DefaultParams returns default module parameters. func DefaultParams() Params { return Params{ - WhitelistedAssets: DefaultAssets(), - AllowedPublicKeys: DefaultKeyInfos(), - LocalhostRegistrationEnabled: true, - ConveyancePreference: "direct", - AttestationFormats: []string{"packed", "android-key", "fido-u2f", "apple"}, + WhitelistedAssets: DefaultAssets(), + AllowedPublicKeys: DefaultKeyInfos(), + ConveyancePreference: "direct", + AttestationFormats: []string{"packed", "android-key", "fido-u2f", "apple"}, } } @@ -179,11 +169,6 @@ func DefaultKeyInfos() map[string]*KeyInfo { } } -func (p Params) ActiveParams(ipfsActive bool) Params { - p.IpfsActive = ipfsActive - return p -} - // Stringer method for Params. func (p Params) String() string { bz, err := json.Marshal(p) diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index 24b1d6dce..f80f1e1b9 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -76,14 +76,10 @@ type Params struct { WhitelistedAssets []*AssetInfo `protobuf:"bytes,1,rep,name=whitelisted_assets,json=whitelistedAssets,proto3" json:"whitelisted_assets,omitempty"` // Whitelisted Key Types AllowedPublicKeys map[string]*KeyInfo `protobuf:"bytes,2,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // IpfsActive is a flag to enable/disable ipfs - IpfsActive bool `protobuf:"varint,3,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` - // Localhost Registration Enabled - LocalhostRegistrationEnabled bool `protobuf:"varint,4,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` // ConveyancePreference defines the conveyance preference - ConveyancePreference string `protobuf:"bytes,5,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + ConveyancePreference string `protobuf:"bytes,3,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` // AttestationFormats defines the attestation formats - AttestationFormats []string `protobuf:"bytes,6,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` + AttestationFormats []string `protobuf:"bytes,4,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -132,20 +128,6 @@ func (m *Params) GetAllowedPublicKeys() map[string]*KeyInfo { return nil } -func (m *Params) GetIpfsActive() bool { - if m != nil { - return m.IpfsActive - } - return false -} - -func (m *Params) GetLocalhostRegistrationEnabled() bool { - if m != nil { - return m.LocalhostRegistrationEnabled - } - return false -} - func (m *Params) GetConveyancePreference() string { if m != nil { return m.ConveyancePreference @@ -350,7 +332,8 @@ type KeyInfo struct { Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + // "Ed25519", "Ed448", "secp256k1" + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` } func (m *KeyInfo) Reset() { *m = KeyInfo{} } @@ -709,69 +692,66 @@ func init() { func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } var fileDescriptor_fda181cae44f7c00 = []byte{ - // 983 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x7a, 0x1b, 0x3b, 0x7e, 0x8e, 0xd2, 0x64, 0xea, 0x96, 0xad, 0x55, 0x1c, 0x63, 0x51, - 0x14, 0x10, 0xb2, 0xd5, 0xf4, 0x82, 0xaa, 0x0a, 0x91, 0x90, 0x80, 0xda, 0x08, 0x29, 0xda, 0x12, - 0x55, 0xe2, 0xb2, 0x1a, 0xef, 0xbe, 0xd8, 0x83, 0xd7, 0x33, 0xab, 0x99, 0xb1, 0x93, 0x3d, 0x72, - 0xe5, 0x04, 0x37, 0xb8, 0x55, 0xfc, 0x02, 0xf8, 0x17, 0x3d, 0xf6, 0xc8, 0xa9, 0x42, 0xc9, 0x01, - 0x7e, 0x06, 0x9a, 0xd9, 0xb1, 0xbd, 0x98, 0x5c, 0xb8, 0x70, 0x59, 0xbf, 0xf7, 0xbd, 0x37, 0xef, - 0xbd, 0x79, 0xdf, 0x9b, 0x67, 0x68, 0x26, 0x2c, 0xe9, 0xcf, 0x1e, 0xf5, 0x87, 0xc8, 0x51, 0x31, - 0xd5, 0xcb, 0xa4, 0xd0, 0x82, 0x54, 0x13, 0x96, 0xf4, 0x66, 0x8f, 0x5a, 0x3b, 0x74, 0xc2, 0xb8, - 0xe8, 0xdb, 0x6f, 0x61, 0x6a, 0x35, 0x87, 0x62, 0x28, 0xac, 0xd8, 0x37, 0x52, 0x81, 0x76, 0x9f, - 0xc2, 0xe6, 0x97, 0x45, 0x84, 0x17, 0x9a, 0x6a, 0x24, 0x1f, 0x43, 0x35, 0xa3, 0x92, 0x4e, 0x54, - 0xe0, 0x75, 0xbc, 0xbd, 0xc6, 0xfe, 0x56, 0xaf, 0x88, 0xd8, 0x3b, 0xb5, 0xe8, 0xe1, 0xad, 0xd7, - 0x6f, 0x77, 0xd7, 0x42, 0xe7, 0xd3, 0x7d, 0xeb, 0x43, 0xb5, 0x30, 0x90, 0xcf, 0x80, 0x5c, 0x8c, - 0x98, 0xc6, 0x94, 0x29, 0x8d, 0x49, 0x44, 0x95, 0x42, 0x6d, 0x82, 0xf8, 0x7b, 0x8d, 0xfd, 0x9d, - 0x79, 0x90, 0x03, 0x83, 0x3e, 0xe3, 0xe7, 0x22, 0xdc, 0x29, 0x39, 0x5b, 0x54, 0x91, 0x33, 0xb8, - 0x43, 0xd3, 0x54, 0x5c, 0x60, 0x12, 0x65, 0xd3, 0x41, 0xca, 0xe2, 0x68, 0x8c, 0xb9, 0x0a, 0x2a, - 0x36, 0xc4, 0xc3, 0x7f, 0xd6, 0xd1, 0x3b, 0x28, 0x3c, 0x4f, 0xad, 0xe3, 0x09, 0xe6, 0xea, 0x98, - 0x6b, 0x99, 0x87, 0x3b, 0x74, 0x15, 0x27, 0xbb, 0xd0, 0x60, 0xd9, 0xb9, 0x8a, 0x68, 0xac, 0xd9, - 0x0c, 0x03, 0xbf, 0xe3, 0xed, 0x6d, 0x84, 0x60, 0xa0, 0x03, 0x8b, 0x90, 0x23, 0x68, 0xa7, 0x22, - 0xa6, 0xe9, 0x48, 0x28, 0x1d, 0x49, 0x1c, 0x32, 0xa5, 0x25, 0xd5, 0x4c, 0xf0, 0x08, 0x39, 0x1d, - 0xa4, 0x98, 0x04, 0xb7, 0xec, 0x99, 0x07, 0x0b, 0xaf, 0xb0, 0xe4, 0x74, 0x5c, 0xf8, 0x90, 0xc7, - 0x70, 0x37, 0x16, 0x7c, 0x86, 0x39, 0xe5, 0x31, 0x46, 0x99, 0xc4, 0x73, 0x94, 0xc8, 0x63, 0x0c, - 0xd6, 0x3b, 0xde, 0x5e, 0x3d, 0x6c, 0x2e, 0x8d, 0xa7, 0x0b, 0x1b, 0xe9, 0xc3, 0x1d, 0xaa, 0x35, - 0x2a, 0x5d, 0xe4, 0x3b, 0x17, 0x72, 0x42, 0xb5, 0x0a, 0xaa, 0x1d, 0x7f, 0xaf, 0x1e, 0x92, 0x92, - 0xe9, 0x8b, 0xc2, 0xd2, 0x3a, 0x83, 0x7b, 0x37, 0xdf, 0x9c, 0x6c, 0x83, 0x3f, 0xc6, 0xdc, 0xb2, - 0x56, 0x0f, 0x8d, 0x48, 0x1e, 0xc2, 0xfa, 0x8c, 0xa6, 0x53, 0x0c, 0x2a, 0x96, 0xc9, 0xdb, 0xf3, - 0x0e, 0x9e, 0x60, 0x6e, 0x29, 0x28, 0xac, 0x4f, 0x2a, 0x9f, 0x78, 0x4f, 0xde, 0xf9, 0xe9, 0xd5, - 0xee, 0xda, 0x5f, 0xaf, 0x76, 0xbd, 0xef, 0xff, 0xfc, 0xf5, 0x23, 0x30, 0x93, 0xe5, 0x08, 0xfe, - 0xd9, 0x83, 0xfa, 0x82, 0x34, 0xd2, 0x84, 0x75, 0xc6, 0x13, 0xbc, 0xb4, 0x59, 0xfc, 0xb0, 0x50, - 0x4c, 0xe6, 0x91, 0xcc, 0x6c, 0x96, 0x7a, 0x68, 0x44, 0x72, 0x0f, 0xaa, 0x2a, 0x9f, 0x0c, 0x44, - 0x6a, 0xbb, 0x5d, 0x0f, 0x9d, 0x46, 0xde, 0x05, 0xb0, 0x73, 0x11, 0xe9, 0x3c, 0x43, 0xdb, 0xd5, - 0x7a, 0x58, 0xb7, 0xc8, 0xd7, 0x79, 0x86, 0x84, 0xc0, 0x2d, 0x4e, 0x27, 0xf3, 0x8e, 0x59, 0x99, - 0xdc, 0x87, 0x0d, 0x16, 0x0b, 0x1e, 0x4d, 0x65, 0x1a, 0x54, 0x2d, 0x5e, 0x33, 0xfa, 0x99, 0x4c, - 0xbb, 0x3f, 0x56, 0x60, 0xe3, 0x48, 0xc4, 0xd3, 0x09, 0x72, 0x4d, 0xb6, 0xa0, 0xc2, 0x12, 0x77, - 0xfb, 0x0a, 0x4b, 0x48, 0x1b, 0x20, 0x16, 0x5c, 0x4b, 0x91, 0xa6, 0x28, 0x5d, 0x6d, 0x25, 0x84, - 0x7c, 0x00, 0x5b, 0x74, 0xaa, 0x47, 0xc8, 0x35, 0x8b, 0x6d, 0x87, 0x03, 0xdf, 0x36, 0x7d, 0x05, - 0x25, 0x1f, 0xc2, 0xb6, 0x29, 0x50, 0x5a, 0x7e, 0x26, 0xa8, 0x47, 0xc2, 0x8c, 0x83, 0xf1, 0xbc, - 0xbd, 0xc0, 0xbf, 0xb2, 0xb0, 0x9d, 0x00, 0x9a, 0xd1, 0x01, 0x4b, 0x99, 0xce, 0xa3, 0x04, 0x53, - 0x1c, 0x16, 0x91, 0xd7, 0xad, 0x7f, 0x73, 0x69, 0x3c, 0x5a, 0xd8, 0x56, 0x0e, 0x31, 0x3e, 0x13, - 0xae, 0x9c, 0xea, 0xea, 0xa1, 0x67, 0x0b, 0x1b, 0x09, 0xa0, 0xa6, 0x50, 0xce, 0x58, 0x8c, 0x41, - 0xcd, 0xba, 0xcd, 0xd5, 0xee, 0x77, 0x1e, 0xd4, 0x1c, 0xbf, 0xa6, 0x9d, 0x52, 0xa4, 0xe8, 0x9a, - 0x62, 0x65, 0xf2, 0x00, 0xea, 0x34, 0x1d, 0x0a, 0xc9, 0xf4, 0x68, 0xe2, 0xba, 0xb2, 0x04, 0x48, - 0x0b, 0x36, 0x90, 0xc7, 0x22, 0x61, 0x7c, 0xe8, 0x98, 0x5b, 0xe8, 0x86, 0xfb, 0x78, 0x2a, 0x67, - 0x73, 0xda, 0x0a, 0xc5, 0xe4, 0xb0, 0x5c, 0x3a, 0xca, 0x8c, 0xdc, 0xfd, 0xa5, 0x02, 0xd5, 0xd3, - 0xe9, 0xe0, 0x04, 0xf3, 0xff, 0xa5, 0x84, 0xfb, 0xb0, 0x31, 0xc6, 0x3c, 0x2a, 0x95, 0x51, 0x1b, - 0x63, 0x6e, 0x07, 0x6a, 0x1b, 0x7c, 0x49, 0x2f, 0xec, 0xdc, 0x6c, 0x86, 0x46, 0x24, 0xef, 0x83, - 0xff, 0xed, 0xc5, 0x38, 0xa8, 0xd9, 0x17, 0x41, 0x16, 0x3b, 0xc5, 0x56, 0xdb, 0x7b, 0xfe, 0xf2, - 0x24, 0x34, 0xe6, 0x16, 0x05, 0xff, 0xf9, 0xcb, 0x13, 0xfb, 0xa4, 0xf4, 0xf2, 0x49, 0x69, 0xfb, - 0xc8, 0x62, 0x39, 0x9b, 0x8f, 0x7a, 0x2c, 0x67, 0x64, 0x13, 0xbc, 0x4b, 0x57, 0xa8, 0x77, 0x69, - 0xb4, 0xdc, 0x55, 0xe7, 0xe5, 0x46, 0xe3, 0xae, 0x24, 0x8f, 0x1b, 0x0d, 0xdd, 0x08, 0x7b, 0xd8, - 0xfd, 0xcd, 0x87, 0xda, 0x8b, 0x82, 0xb4, 0x7f, 0xcd, 0xee, 0x7b, 0xb0, 0xe9, 0xf8, 0x2c, 0x6e, - 0x55, 0xa4, 0x6b, 0x38, 0xcc, 0xde, 0xcc, 0x34, 0x71, 0xaa, 0x47, 0xa6, 0x69, 0xb9, 0x4b, 0xbf, - 0x04, 0xcc, 0xfb, 0x13, 0x92, 0x0d, 0x19, 0x77, 0xb5, 0x38, 0x8d, 0x74, 0xa0, 0x91, 0xa0, 0x8a, - 0x25, 0xcb, 0xdc, 0x5c, 0xda, 0xb8, 0x25, 0x88, 0x84, 0xb0, 0x33, 0x4f, 0x8d, 0x3c, 0xc9, 0x04, - 0xe3, 0x6e, 0x1d, 0x95, 0x36, 0xb0, 0x2b, 0x7b, 0xfe, 0x7b, 0x3c, 0xf7, 0x2b, 0x36, 0xf0, 0xb6, - 0x5a, 0x81, 0xc9, 0x21, 0x34, 0x32, 0x94, 0x13, 0xa6, 0x14, 0x13, 0x5c, 0xd9, 0x89, 0x6d, 0xec, - 0x77, 0x56, 0xa3, 0x9d, 0x2e, 0x5d, 0x8a, 0x40, 0xe5, 0x43, 0xad, 0xcf, 0xe1, 0xee, 0x8d, 0xe9, - 0x6e, 0x58, 0x7b, 0xcd, 0xf2, 0xda, 0xab, 0x97, 0xb6, 0x5c, 0xeb, 0x53, 0xd8, 0x5e, 0xcd, 0xf2, - 0x5f, 0xce, 0x1f, 0x3e, 0x7d, 0x7d, 0xd5, 0xf6, 0xde, 0x5c, 0xb5, 0xbd, 0x3f, 0xae, 0xda, 0xde, - 0x0f, 0xd7, 0xed, 0xb5, 0x37, 0xd7, 0xed, 0xb5, 0xdf, 0xaf, 0xdb, 0x6b, 0xdf, 0x74, 0x87, 0x4c, - 0x8f, 0xa6, 0x83, 0x5e, 0x2c, 0x26, 0x7d, 0xc1, 0x95, 0xe0, 0xb2, 0x6f, 0x3f, 0x97, 0x7d, 0xb3, - 0x4b, 0x0d, 0x89, 0x6a, 0x50, 0xb5, 0x7f, 0xb8, 0x8f, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x96, - 0x98, 0xb5, 0xcd, 0xb9, 0x07, 0x00, 0x00, + // 929 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x7a, 0x13, 0x3b, 0x7e, 0x8e, 0x52, 0x7b, 0xea, 0x96, 0xad, 0x05, 0x8e, 0xb1, 0x28, + 0x0a, 0x08, 0xd9, 0x6a, 0x7a, 0x41, 0x55, 0x85, 0x68, 0x68, 0x41, 0xad, 0x85, 0x14, 0x6d, 0x89, + 0x2a, 0x71, 0xb1, 0xc6, 0xbb, 0x2f, 0xf6, 0xe0, 0xdd, 0x99, 0xd5, 0xcc, 0xd8, 0xc9, 0x1e, 0xb9, + 0x72, 0x82, 0x1b, 0xdc, 0x2a, 0x3e, 0x01, 0x7c, 0x8b, 0x1e, 0x7b, 0xe4, 0x84, 0x50, 0x72, 0x80, + 0x6f, 0xc0, 0x15, 0xcd, 0xec, 0xf8, 0x0f, 0x26, 0x17, 0x2e, 0xbd, 0xac, 0xdf, 0xfb, 0xbd, 0x37, + 0xef, 0xbd, 0x79, 0xbf, 0xf7, 0xc6, 0xd0, 0x8c, 0x59, 0xdc, 0x9f, 0xdf, 0xeb, 0x8f, 0x91, 0xa3, + 0x62, 0xaa, 0x97, 0x49, 0xa1, 0x05, 0x29, 0xc7, 0x2c, 0xee, 0xcd, 0xef, 0xb5, 0x1a, 0x34, 0x65, + 0x5c, 0xf4, 0xed, 0xb7, 0x30, 0xb5, 0x9a, 0x63, 0x31, 0x16, 0x56, 0xec, 0x1b, 0xa9, 0x40, 0xbb, + 0x0f, 0x61, 0xef, 0x8b, 0x22, 0xc2, 0x73, 0x4d, 0x35, 0x92, 0x8f, 0xa0, 0x9c, 0x51, 0x49, 0x53, + 0x15, 0x78, 0x1d, 0xef, 0xb0, 0x76, 0xb4, 0xdf, 0x2b, 0x22, 0xf6, 0x4e, 0x2c, 0x7a, 0xbc, 0xfd, + 0xea, 0xf7, 0x83, 0xad, 0xd0, 0xf9, 0x74, 0xff, 0x2e, 0x41, 0xb9, 0x30, 0x90, 0x4f, 0x81, 0x9c, + 0x4f, 0x98, 0xc6, 0x84, 0x29, 0x8d, 0xf1, 0x90, 0x2a, 0x85, 0xda, 0x04, 0xf1, 0x0f, 0x6b, 0x47, + 0x8d, 0x45, 0x90, 0x47, 0x06, 0x7d, 0xca, 0xcf, 0x44, 0xd8, 0x58, 0x73, 0xb6, 0xa8, 0x22, 0xa7, + 0x70, 0x93, 0x26, 0x89, 0x38, 0xc7, 0x78, 0x98, 0xcd, 0x46, 0x09, 0x8b, 0x86, 0x53, 0xcc, 0x55, + 0x50, 0xb2, 0x21, 0xee, 0xfe, 0xbb, 0x8e, 0xde, 0xa3, 0xc2, 0xf3, 0xc4, 0x3a, 0x0e, 0x30, 0x57, + 0x4f, 0xb8, 0x96, 0x79, 0xd8, 0xa0, 0x9b, 0x38, 0xb9, 0x0f, 0xb7, 0x22, 0xc1, 0xe7, 0x98, 0x53, + 0x1e, 0xe1, 0x30, 0x93, 0x78, 0x86, 0x12, 0x79, 0x84, 0x81, 0xdf, 0xf1, 0x0e, 0xab, 0x61, 0x73, + 0x65, 0x3c, 0x59, 0xda, 0x48, 0x1f, 0x6e, 0x52, 0xad, 0x51, 0x69, 0xaa, 0x99, 0xe0, 0xc3, 0x33, + 0x21, 0x53, 0xaa, 0x55, 0xb0, 0xdd, 0xf1, 0x0f, 0xab, 0x21, 0x59, 0x33, 0x7d, 0x5e, 0x58, 0x5a, + 0xa7, 0x70, 0xfb, 0xfa, 0x92, 0x48, 0x1d, 0xfc, 0x29, 0xe6, 0xb6, 0x9d, 0xd5, 0xd0, 0x88, 0xe4, + 0x2e, 0xec, 0xcc, 0x69, 0x32, 0xc3, 0xa0, 0x64, 0x5b, 0x7c, 0x63, 0x71, 0xb5, 0x01, 0xe6, 0xb6, + 0x37, 0x85, 0xf5, 0x41, 0xe9, 0x63, 0xef, 0xc1, 0x5b, 0x3f, 0xbe, 0x3c, 0xd8, 0xfa, 0xeb, 0xe5, + 0x81, 0xf7, 0xdd, 0x9f, 0xbf, 0x7c, 0x08, 0x86, 0x72, 0xd7, 0xf9, 0x9f, 0x3c, 0xa8, 0x2e, 0xbb, + 0x49, 0x9a, 0xb0, 0xc3, 0x78, 0x8c, 0x17, 0x36, 0x8b, 0x1f, 0x16, 0x8a, 0xc9, 0x3c, 0x91, 0x99, + 0xcd, 0x52, 0x0d, 0x8d, 0x48, 0x6e, 0x43, 0x59, 0xe5, 0xe9, 0x48, 0x24, 0xee, 0xf2, 0x4e, 0x23, + 0xef, 0x00, 0x58, 0xc2, 0x86, 0x3a, 0xcf, 0x30, 0xd8, 0xb6, 0xb6, 0xaa, 0x45, 0xbe, 0xca, 0x33, + 0x24, 0x04, 0xb6, 0x39, 0x4d, 0x31, 0xd8, 0xb1, 0x06, 0x2b, 0x93, 0x3b, 0xb0, 0xcb, 0x22, 0xc1, + 0x87, 0x33, 0x99, 0x04, 0x65, 0x8b, 0x57, 0x8c, 0x7e, 0x2a, 0x93, 0xee, 0x0f, 0x25, 0xd8, 0x7d, + 0x2c, 0xa2, 0x59, 0x8a, 0x5c, 0x93, 0x7d, 0x28, 0xb1, 0xd8, 0xdd, 0xbe, 0xc4, 0x62, 0xd2, 0x06, + 0x88, 0x04, 0xd7, 0x52, 0x24, 0x09, 0x4a, 0x57, 0xdb, 0x1a, 0x42, 0xde, 0x87, 0x7d, 0x3a, 0xd3, + 0x13, 0xe4, 0x9a, 0x45, 0xb6, 0xc3, 0x81, 0x6f, 0x9b, 0xbe, 0x81, 0x92, 0x0f, 0xa0, 0x6e, 0x0a, + 0x94, 0x96, 0x9f, 0x14, 0xf5, 0x44, 0xc4, 0x8e, 0x9e, 0x1b, 0x4b, 0xfc, 0x4b, 0x0b, 0xdb, 0x09, + 0xa0, 0x19, 0x1d, 0xb1, 0x84, 0xe9, 0x7c, 0x18, 0x63, 0x82, 0xe3, 0x22, 0xf2, 0x8e, 0xf5, 0x6f, + 0xae, 0x8c, 0x8f, 0x97, 0xb6, 0x8d, 0x43, 0x8c, 0xcf, 0x85, 0x2b, 0xa7, 0xbc, 0x79, 0xe8, 0xe9, + 0xd2, 0x46, 0x02, 0xa8, 0x28, 0x94, 0x73, 0x16, 0x61, 0x50, 0xb1, 0x6e, 0x0b, 0xb5, 0xfb, 0xad, + 0x07, 0x15, 0xc7, 0xaf, 0x69, 0xa7, 0x14, 0x09, 0xba, 0xa6, 0x58, 0x99, 0xbc, 0x0d, 0x55, 0x9a, + 0x8c, 0x85, 0x64, 0x7a, 0x92, 0xba, 0xae, 0xac, 0x00, 0xd2, 0x82, 0x5d, 0xe4, 0x91, 0x88, 0x19, + 0x1f, 0x3b, 0xe6, 0x96, 0xba, 0xe1, 0x3e, 0x9a, 0xc9, 0xf9, 0x82, 0xb6, 0x42, 0x31, 0x39, 0x2c, + 0x97, 0x8e, 0x32, 0x23, 0x77, 0x7f, 0x36, 0xdb, 0x3a, 0x1b, 0x0d, 0x30, 0x7f, 0x23, 0x25, 0xdc, + 0x81, 0xdd, 0x29, 0xe6, 0xc3, 0xb5, 0x32, 0x2a, 0x53, 0xcc, 0xed, 0x40, 0xd5, 0xc1, 0x97, 0xf4, + 0xdc, 0xce, 0xcd, 0x5e, 0x68, 0x44, 0xf2, 0x1e, 0xf8, 0xdf, 0x9c, 0x4f, 0x83, 0x8a, 0xdd, 0x08, + 0xb2, 0x5c, 0x76, 0x5b, 0x6d, 0xef, 0xd9, 0x8b, 0x41, 0x68, 0xcc, 0x2d, 0x0a, 0xfe, 0xb3, 0x17, + 0x03, 0xbb, 0x52, 0x7a, 0xb5, 0x52, 0xda, 0x2e, 0x59, 0x24, 0xe7, 0x8b, 0x51, 0x8f, 0xe4, 0x9c, + 0xec, 0x81, 0x77, 0xe1, 0x0a, 0xf5, 0x2e, 0x8c, 0x96, 0xbb, 0xea, 0xbc, 0xdc, 0x68, 0xdc, 0x95, + 0xe4, 0x71, 0xa3, 0xa1, 0x1b, 0x61, 0x0f, 0xbb, 0xbf, 0xfa, 0x50, 0x79, 0x5e, 0x90, 0xf6, 0x9f, + 0xd9, 0x7d, 0x17, 0xf6, 0x1c, 0x9f, 0xc5, 0xad, 0x8a, 0x74, 0x35, 0x87, 0xd9, 0x9b, 0x99, 0x26, + 0xce, 0xf4, 0xc4, 0x34, 0x2d, 0x77, 0xe9, 0x57, 0x80, 0xd9, 0x3f, 0x21, 0xd9, 0x98, 0x71, 0x57, + 0x8b, 0xd3, 0x48, 0x07, 0x6a, 0x31, 0xaa, 0x48, 0xb2, 0xcc, 0xcd, 0xa5, 0x8d, 0xbb, 0x06, 0x91, + 0x10, 0x1a, 0x8b, 0xd4, 0xc8, 0xe3, 0x4c, 0x30, 0xae, 0x95, 0x1d, 0xc5, 0xb5, 0xa7, 0xd1, 0x95, + 0xbd, 0xf8, 0x7d, 0xb2, 0xf0, 0x2b, 0x9e, 0xc6, 0xba, 0xda, 0x80, 0xc9, 0x31, 0xd4, 0x32, 0x94, + 0x29, 0x53, 0x8a, 0x09, 0xae, 0xec, 0xc4, 0xd6, 0x8e, 0x3a, 0x9b, 0xd1, 0x4e, 0x56, 0x2e, 0x45, + 0xa0, 0xf5, 0x43, 0xad, 0xcf, 0xe0, 0xd6, 0xb5, 0xe9, 0xae, 0x79, 0xf6, 0x9a, 0xeb, 0xcf, 0x5e, + 0x75, 0xed, 0x95, 0x6b, 0x7d, 0x02, 0xf5, 0xcd, 0x2c, 0xff, 0xe7, 0xfc, 0xf1, 0xc3, 0x57, 0x97, + 0x6d, 0xef, 0xf5, 0x65, 0xdb, 0xfb, 0xe3, 0xb2, 0xed, 0x7d, 0x7f, 0xd5, 0xde, 0x7a, 0x7d, 0xd5, + 0xde, 0xfa, 0xed, 0xaa, 0xbd, 0xf5, 0x75, 0x77, 0xcc, 0xf4, 0x64, 0x36, 0xea, 0x45, 0x22, 0xed, + 0x0b, 0xae, 0x04, 0x97, 0x7d, 0xfb, 0xb9, 0xe8, 0x9b, 0xb7, 0xd4, 0x90, 0xa8, 0x46, 0x65, 0xfb, + 0x4f, 0x78, 0xff, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x47, 0x39, 0xad, 0x38, 0x52, 0x07, 0x00, + 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -809,12 +789,6 @@ func (this *Params) Equal(that interface{}) bool { return false } } - if this.IpfsActive != that1.IpfsActive { - return false - } - if this.LocalhostRegistrationEnabled != that1.LocalhostRegistrationEnabled { - return false - } if this.ConveyancePreference != that1.ConveyancePreference { return false } @@ -887,7 +861,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.AttestationFormats[iNdEx]) i = encodeVarintGenesis(dAtA, i, uint64(len(m.AttestationFormats[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x22 } } if len(m.ConveyancePreference) > 0 { @@ -895,27 +869,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.ConveyancePreference) i = encodeVarintGenesis(dAtA, i, uint64(len(m.ConveyancePreference))) i-- - dAtA[i] = 0x2a - } - if m.LocalhostRegistrationEnabled { - i-- - if m.LocalhostRegistrationEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.IpfsActive { - i-- - if m.IpfsActive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } if len(m.AllowedPublicKeys) > 0 { for k := range m.AllowedPublicKeys { @@ -1448,12 +1402,6 @@ func (m *Params) Size() (n int) { n += mapEntrySize + 1 + sovGenesis(uint64(mapEntrySize)) } } - if m.IpfsActive { - n += 2 - } - if m.LocalhostRegistrationEnabled { - n += 2 - } l = len(m.ConveyancePreference) if l > 0 { n += 1 + l + sovGenesis(uint64(l)) @@ -1972,46 +1920,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { m.AllowedPublicKeys[mapkey] = mapvalue iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IpfsActive = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LocalhostRegistrationEnabled = bool(v != 0) - case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) } @@ -2043,7 +1951,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.ConveyancePreference = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType) } diff --git a/x/did/types/msgs.go b/x/did/types/msgs.go index 4901c802e..1ec676945 100644 --- a/x/did/types/msgs.go +++ b/x/did/types/msgs.go @@ -83,39 +83,6 @@ func (msg *MsgRegisterService) Validate() error { return nil } -// -// [AllocateVault] -// - -// NewMsgAllocateVault creates a new instance of MsgAllocateVault -func NewMsgAllocateVault( - sender sdk.Address, -) (*MsgAllocateVault, error) { - return &MsgAllocateVault{}, nil -} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (msg *MsgAllocateVault) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{addr} -} - -// Route returns the name of the module -func (msg MsgAllocateVault) Route() string { return ModuleName } - -// Type returns the the action -func (msg MsgAllocateVault) Type() string { return "allocate_vault" } - -// GetSignBytes implements the LegacyMsg interface. -func (msg MsgAllocateVault) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) -} - -// Vaalidate does a sanity check on the provided data. -func (msg *MsgAllocateVault) Validate() error { - return nil -} - // // [RegisterController] // diff --git a/internal/orm/Account.pkl.go b/x/did/types/orm/Account.pkl.go similarity index 89% rename from internal/orm/Account.pkl.go rename to x/did/types/orm/Account.pkl.go index 9bf3f02f4..b9e3a5cf8 100644 --- a/internal/orm/Account.pkl.go +++ b/x/did/types/orm/Account.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm type Account struct { diff --git a/internal/orm/Asset.pkl.go b/x/did/types/orm/Asset.pkl.go similarity index 86% rename from internal/orm/Asset.pkl.go rename to x/did/types/orm/Asset.pkl.go index 7fdfaebc0..5d4be0935 100644 --- a/internal/orm/Asset.pkl.go +++ b/x/did/types/orm/Asset.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm type Asset struct { diff --git a/internal/orm/Chain.pkl.go b/x/did/types/orm/Chain.pkl.go similarity index 85% rename from internal/orm/Chain.pkl.go rename to x/did/types/orm/Chain.pkl.go index 6fa443c58..a47a250f9 100644 --- a/internal/orm/Chain.pkl.go +++ b/x/did/types/orm/Chain.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm type Chain struct { diff --git a/internal/orm/Credential.pkl.go b/x/did/types/orm/Credential.pkl.go similarity index 95% rename from internal/orm/Credential.pkl.go rename to x/did/types/orm/Credential.pkl.go index 138ce7f88..e17391216 100644 --- a/internal/orm/Credential.pkl.go +++ b/x/did/types/orm/Credential.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm type Credential struct { diff --git a/internal/orm/Grant.pkl.go b/x/did/types/orm/Grant.pkl.go similarity index 89% rename from internal/orm/Grant.pkl.go rename to x/did/types/orm/Grant.pkl.go index b5b4d1e3d..25538ef1b 100644 --- a/internal/orm/Grant.pkl.go +++ b/x/did/types/orm/Grant.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm type Grant struct { diff --git a/internal/orm/JWK.pkl.go b/x/did/types/orm/JWK.pkl.go similarity index 83% rename from internal/orm/JWK.pkl.go rename to x/did/types/orm/JWK.pkl.go index 3cd3f044f..45ab091ef 100644 --- a/internal/orm/JWK.pkl.go +++ b/x/did/types/orm/JWK.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm type JWK struct { diff --git a/internal/orm/Keyshare.pkl.go b/x/did/types/orm/Keyshare.pkl.go similarity index 85% rename from internal/orm/Keyshare.pkl.go rename to x/did/types/orm/Keyshare.pkl.go index cbc8b356f..251505f7b 100644 --- a/internal/orm/Keyshare.pkl.go +++ b/x/did/types/orm/Keyshare.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm type Keyshare struct { diff --git a/internal/orm/Orm.pkl.go b/x/did/types/orm/Models.pkl.go similarity index 72% rename from internal/orm/Orm.pkl.go rename to x/did/types/orm/Models.pkl.go index 0c1f09dbc..24d9aa3fa 100644 --- a/internal/orm/Orm.pkl.go +++ b/x/did/types/orm/Models.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm import ( @@ -7,14 +7,14 @@ import ( "github.com/apple/pkl-go/pkl" ) -type Orm struct { +type Models struct { DbName string `pkl:"db_name"` DbVersion int `pkl:"db_version"` } -// LoadFromPath loads the pkl module at the given path and evaluates it into a Orm -func LoadFromPath(ctx context.Context, path string) (ret *Orm, err error) { +// LoadFromPath loads the pkl module at the given path and evaluates it into a Models +func LoadFromPath(ctx context.Context, path string) (ret *Models, err error) { evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) if err != nil { return nil, err @@ -29,9 +29,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *Orm, err error) { return ret, err } -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Orm -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Orm, error) { - var ret Orm +// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Models +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Models, error) { + var ret Models if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { return nil, err } diff --git a/internal/orm/Profile.pkl.go b/x/did/types/orm/Profile.pkl.go similarity index 90% rename from internal/orm/Profile.pkl.go rename to x/did/types/orm/Profile.pkl.go index 794e4e352..276f30704 100644 --- a/internal/orm/Profile.pkl.go +++ b/x/did/types/orm/Profile.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm type Profile struct { diff --git a/internal/orm/PublicKey.pkl.go b/x/did/types/orm/PublicKey.pkl.go similarity index 53% rename from internal/orm/PublicKey.pkl.go rename to x/did/types/orm/PublicKey.pkl.go index a81904913..c07beb191 100644 --- a/internal/orm/PublicKey.pkl.go +++ b/x/did/types/orm/PublicKey.pkl.go @@ -1,12 +1,12 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package orm import ( - "github.com/onsonr/sonr/internal/orm/keyalgorithm" - "github.com/onsonr/sonr/internal/orm/keycurve" - "github.com/onsonr/sonr/internal/orm/keyencoding" - "github.com/onsonr/sonr/internal/orm/keyrole" - "github.com/onsonr/sonr/internal/orm/keytype" + "github.com/onsonr/sonr/x/did/types/orm/keyalgorithm" + "github.com/onsonr/sonr/x/did/types/orm/keycurve" + "github.com/onsonr/sonr/x/did/types/orm/keyencoding" + "github.com/onsonr/sonr/x/did/types/orm/keyrole" + "github.com/onsonr/sonr/x/did/types/orm/keytype" ) type PublicKey struct { diff --git a/internal/orm/assettype/AssetType.pkl.go b/x/did/types/orm/assettype/AssetType.pkl.go similarity index 93% rename from internal/orm/assettype/AssetType.pkl.go rename to x/did/types/orm/assettype/AssetType.pkl.go index ba491f869..fbc580b0e 100644 --- a/internal/orm/assettype/AssetType.pkl.go +++ b/x/did/types/orm/assettype/AssetType.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package assettype import ( diff --git a/internal/orm/didmethod/DIDMethod.pkl.go b/x/did/types/orm/didmethod/DIDMethod.pkl.go similarity index 94% rename from internal/orm/didmethod/DIDMethod.pkl.go rename to x/did/types/orm/didmethod/DIDMethod.pkl.go index 4d6c583d6..e7b5140e2 100644 --- a/internal/orm/didmethod/DIDMethod.pkl.go +++ b/x/did/types/orm/didmethod/DIDMethod.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package didmethod import ( diff --git a/x/did/types/orm/init.pkl.go b/x/did/types/orm/init.pkl.go new file mode 100644 index 000000000..b44425ea5 --- /dev/null +++ b/x/did/types/orm/init.pkl.go @@ -0,0 +1,17 @@ +// Code generated from Pkl module `models`. DO NOT EDIT. +package orm + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("models", Models{}) + pkl.RegisterMapping("models#Account", Account{}) + pkl.RegisterMapping("models#Asset", Asset{}) + pkl.RegisterMapping("models#Chain", Chain{}) + pkl.RegisterMapping("models#Credential", Credential{}) + pkl.RegisterMapping("models#JWK", JWK{}) + pkl.RegisterMapping("models#Grant", Grant{}) + pkl.RegisterMapping("models#Keyshare", Keyshare{}) + pkl.RegisterMapping("models#PublicKey", PublicKey{}) + pkl.RegisterMapping("models#Profile", Profile{}) +} diff --git a/internal/orm/keyalgorithm/KeyAlgorithm.pkl.go b/x/did/types/orm/keyalgorithm/KeyAlgorithm.pkl.go similarity index 94% rename from internal/orm/keyalgorithm/KeyAlgorithm.pkl.go rename to x/did/types/orm/keyalgorithm/KeyAlgorithm.pkl.go index 16f47ac66..68a875097 100644 --- a/internal/orm/keyalgorithm/KeyAlgorithm.pkl.go +++ b/x/did/types/orm/keyalgorithm/KeyAlgorithm.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package keyalgorithm import ( diff --git a/internal/orm/keycurve/KeyCurve.pkl.go b/x/did/types/orm/keycurve/KeyCurve.pkl.go similarity index 95% rename from internal/orm/keycurve/KeyCurve.pkl.go rename to x/did/types/orm/keycurve/KeyCurve.pkl.go index 773b59ab1..1b8acf64a 100644 --- a/internal/orm/keycurve/KeyCurve.pkl.go +++ b/x/did/types/orm/keycurve/KeyCurve.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package keycurve import ( diff --git a/internal/orm/keyencoding/KeyEncoding.pkl.go b/x/did/types/orm/keyencoding/KeyEncoding.pkl.go similarity index 92% rename from internal/orm/keyencoding/KeyEncoding.pkl.go rename to x/did/types/orm/keyencoding/KeyEncoding.pkl.go index dab253554..15a80c3c4 100644 --- a/internal/orm/keyencoding/KeyEncoding.pkl.go +++ b/x/did/types/orm/keyencoding/KeyEncoding.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package keyencoding import ( diff --git a/internal/orm/keyrole/KeyRole.pkl.go b/x/did/types/orm/keyrole/KeyRole.pkl.go similarity index 93% rename from internal/orm/keyrole/KeyRole.pkl.go rename to x/did/types/orm/keyrole/KeyRole.pkl.go index ee5437cee..21d26a099 100644 --- a/internal/orm/keyrole/KeyRole.pkl.go +++ b/x/did/types/orm/keyrole/KeyRole.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package keyrole import ( diff --git a/internal/orm/keysharerole/KeyShareRole.pkl.go b/x/did/types/orm/keysharerole/KeyShareRole.pkl.go similarity index 92% rename from internal/orm/keysharerole/KeyShareRole.pkl.go rename to x/did/types/orm/keysharerole/KeyShareRole.pkl.go index 84394745e..846c411df 100644 --- a/internal/orm/keysharerole/KeyShareRole.pkl.go +++ b/x/did/types/orm/keysharerole/KeyShareRole.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package keysharerole import ( diff --git a/internal/orm/keytype/KeyType.pkl.go b/x/did/types/orm/keytype/KeyType.pkl.go similarity index 94% rename from internal/orm/keytype/KeyType.pkl.go rename to x/did/types/orm/keytype/KeyType.pkl.go index d3f9808ad..d7ed78d27 100644 --- a/internal/orm/keytype/KeyType.pkl.go +++ b/x/did/types/orm/keytype/KeyType.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package keytype import ( diff --git a/internal/orm/permissiongrant/PermissionGrant.pkl.go b/x/did/types/orm/permissiongrant/PermissionGrant.pkl.go similarity index 94% rename from internal/orm/permissiongrant/PermissionGrant.pkl.go rename to x/did/types/orm/permissiongrant/PermissionGrant.pkl.go index bdeea225f..c21195185 100644 --- a/internal/orm/permissiongrant/PermissionGrant.pkl.go +++ b/x/did/types/orm/permissiongrant/PermissionGrant.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package permissiongrant import ( diff --git a/internal/orm/permissionscope/PermissionScope.pkl.go b/x/did/types/orm/permissionscope/PermissionScope.pkl.go similarity index 95% rename from internal/orm/permissionscope/PermissionScope.pkl.go rename to x/did/types/orm/permissionscope/PermissionScope.pkl.go index 2af42ee43..87756e20a 100644 --- a/internal/orm/permissionscope/PermissionScope.pkl.go +++ b/x/did/types/orm/permissionscope/PermissionScope.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. +// Code generated from Pkl module `models`. DO NOT EDIT. package permissionscope import ( diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index 7f51d14fa..0fcddd8d2 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -97,75 +97,6 @@ func (m *QueryRequest) GetAsset() string { return "" } -// QueryResolveResponse is the response type for the Query/Resolve RPC method. -type QueryResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - Document *Document `protobuf:"bytes,3,opt,name=document,proto3" json:"document,omitempty"` - Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *QueryResponse) Reset() { *m = QueryResponse{} } -func (m *QueryResponse) String() string { return proto.CompactTextString(m) } -func (*QueryResponse) ProtoMessage() {} -func (*QueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{1} -} -func (m *QueryResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResponse.Merge(m, src) -} -func (m *QueryResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResponse proto.InternalMessageInfo - -func (m *QueryResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func (m *QueryResponse) GetQuery() string { - if m != nil { - return m.Query - } - return "" -} - -func (m *QueryResponse) GetDocument() *Document { - if m != nil { - return m.Document - } - return nil -} - -func (m *QueryResponse) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - // QueryParamsResponse is the response type for the Query/Params RPC method. type QueryParamsResponse struct { // params defines the parameters of the module. @@ -176,7 +107,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{2} + return fileDescriptor_ae1fa9bb626e2869, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -222,7 +153,7 @@ func (m *QueryResolveResponse) Reset() { *m = QueryResolveResponse{} } func (m *QueryResolveResponse) String() string { return proto.CompactTextString(m) } func (*QueryResolveResponse) ProtoMessage() {} func (*QueryResolveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{3} + return fileDescriptor_ae1fa9bb626e2869, []int{2} } func (m *QueryResolveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -258,137 +189,39 @@ func (m *QueryResolveResponse) GetDocument() *Document { return nil } -// SyncRequest is the request type for the Sync RPC method. -type SyncRequest struct { - Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` -} - -func (m *SyncRequest) Reset() { *m = SyncRequest{} } -func (m *SyncRequest) String() string { return proto.CompactTextString(m) } -func (*SyncRequest) ProtoMessage() {} -func (*SyncRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{4} -} -func (m *SyncRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SyncRequest.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 *SyncRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncRequest.Merge(m, src) -} -func (m *SyncRequest) XXX_Size() int { - return m.Size() -} -func (m *SyncRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SyncRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SyncRequest proto.InternalMessageInfo - -func (m *SyncRequest) GetDid() string { - if m != nil { - return m.Did - } - return "" -} - -// SyncResponse is the response type for the Sync RPC method. -type SyncResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` -} - -func (m *SyncResponse) Reset() { *m = SyncResponse{} } -func (m *SyncResponse) String() string { return proto.CompactTextString(m) } -func (*SyncResponse) ProtoMessage() {} -func (*SyncResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{5} -} -func (m *SyncResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SyncResponse.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 *SyncResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncResponse.Merge(m, src) -} -func (m *SyncResponse) XXX_Size() int { - return m.Size() -} -func (m *SyncResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SyncResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SyncResponse proto.InternalMessageInfo - -func (m *SyncResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - func init() { proto.RegisterType((*QueryRequest)(nil), "did.v1.QueryRequest") - proto.RegisterType((*QueryResponse)(nil), "did.v1.QueryResponse") proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse") proto.RegisterType((*QueryResolveResponse)(nil), "did.v1.QueryResolveResponse") - proto.RegisterType((*SyncRequest)(nil), "did.v1.SyncRequest") - proto.RegisterType((*SyncResponse)(nil), "did.v1.SyncResponse") } func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) } var fileDescriptor_ae1fa9bb626e2869 = []byte{ - // 446 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x4f, 0x6b, 0xd4, 0x40, - 0x14, 0xdf, 0x69, 0xbb, 0xd9, 0xf6, 0x75, 0xab, 0xe5, 0x35, 0x48, 0x58, 0x4b, 0x94, 0x39, 0x48, - 0x0f, 0x92, 0xa1, 0xf5, 0xaa, 0x20, 0xd2, 0xa3, 0x07, 0x1b, 0x6f, 0x9e, 0x4c, 0x33, 0x43, 0x1c, - 0xda, 0x9d, 0x49, 0x33, 0xc9, 0x62, 0x10, 0x2f, 0x7e, 0x02, 0x41, 0xfc, 0x4e, 0x1e, 0x0b, 0x5e, - 0x3c, 0xca, 0xae, 0x27, 0x3f, 0x85, 0x64, 0x66, 0x52, 0x77, 0x85, 0xba, 0x97, 0x65, 0xdf, 0xef, - 0xbd, 0xf7, 0xfb, 0xf3, 0x32, 0x80, 0x5c, 0x72, 0x36, 0x3b, 0x66, 0x57, 0x8d, 0xa8, 0xda, 0xa4, - 0xac, 0x74, 0xad, 0x31, 0xe0, 0x92, 0x27, 0xb3, 0xe3, 0x49, 0xe8, 0x7b, 0x85, 0x50, 0xc2, 0x48, - 0xe3, 0xba, 0x93, 0xc3, 0x42, 0xeb, 0xe2, 0x52, 0xb0, 0xac, 0x94, 0x2c, 0x53, 0x4a, 0xd7, 0x59, - 0x2d, 0xb5, 0xf2, 0x5d, 0xfa, 0x16, 0xc6, 0x67, 0x1d, 0x55, 0x2a, 0xae, 0x1a, 0x61, 0x6a, 0xdc, - 0x87, 0x4d, 0x2e, 0x79, 0x44, 0x1e, 0x92, 0xa3, 0x9d, 0xb4, 0xfb, 0x8b, 0xf7, 0x20, 0xd0, 0x95, - 0x2c, 0xa4, 0x8a, 0x36, 0x2c, 0xe8, 0xab, 0x6e, 0xf2, 0x42, 0xb4, 0xd1, 0xa6, 0x9b, 0xbc, 0x10, - 0x2d, 0x86, 0x30, 0xcc, 0x8c, 0x11, 0x75, 0xb4, 0x65, 0x31, 0x57, 0xd0, 0xaf, 0x04, 0xf6, 0xbc, - 0x84, 0x29, 0xb5, 0x32, 0x02, 0x23, 0x18, 0x99, 0x26, 0xcf, 0x85, 0x31, 0x56, 0x67, 0x3b, 0xed, - 0xcb, 0x8e, 0xc1, 0x06, 0xf3, 0x52, 0xae, 0xc0, 0xc7, 0xb0, 0xcd, 0x75, 0xde, 0x4c, 0x85, 0xaa, - 0xad, 0xdc, 0xee, 0xc9, 0x7e, 0xe2, 0x22, 0x27, 0xa7, 0x1e, 0x4f, 0x6f, 0x26, 0xf0, 0x11, 0x04, - 0x65, 0x56, 0x65, 0x53, 0x13, 0x0d, 0xed, 0xec, 0x9d, 0x7e, 0xf6, 0x95, 0x45, 0x53, 0xdf, 0xa5, - 0xcf, 0xe0, 0xc0, 0xda, 0xf2, 0x70, 0x6f, 0xee, 0xef, 0x3a, 0xf9, 0xef, 0xfa, 0x29, 0x84, 0x7d, - 0x2a, 0x7d, 0x39, 0x13, 0x37, 0xfb, 0xcb, 0x66, 0xc9, 0x3a, 0xb3, 0xf4, 0x01, 0xec, 0xbe, 0x6e, - 0x55, 0x7e, 0xeb, 0xf5, 0xe9, 0x11, 0x8c, 0xdd, 0xc0, 0xba, 0xdb, 0x9d, 0xfc, 0x26, 0x30, 0xb4, - 0x8e, 0xf0, 0x25, 0x04, 0xce, 0x2c, 0x86, 0xbd, 0xf4, 0xf2, 0x37, 0x9e, 0xdc, 0x5f, 0x41, 0x57, - 0xf3, 0xd3, 0xbb, 0x9f, 0xbe, 0xff, 0xfa, 0xb2, 0xb1, 0x83, 0x23, 0xe6, 0x82, 0xe2, 0x19, 0x8c, - 0x7c, 0xc6, 0x5b, 0xe8, 0x0e, 0xff, 0x41, 0x57, 0xee, 0x41, 0xd1, 0xf2, 0x8d, 0x11, 0x58, 0xf7, - 0x3a, 0x3f, 0x70, 0xc9, 0x3f, 0xe2, 0x73, 0xd8, 0xea, 0x42, 0xe1, 0x41, 0xbf, 0xb9, 0x74, 0x83, - 0x49, 0xb8, 0x0a, 0x7a, 0x9a, 0x3d, 0x4b, 0x33, 0xa2, 0x43, 0x66, 0x5a, 0x95, 0xbf, 0x78, 0xfa, - 0x6d, 0x1e, 0x93, 0xeb, 0x79, 0x4c, 0x7e, 0xce, 0x63, 0xf2, 0x79, 0x11, 0x0f, 0xae, 0x17, 0xf1, - 0xe0, 0xc7, 0x22, 0x1e, 0xbc, 0xa1, 0x85, 0xac, 0xdf, 0x35, 0xe7, 0x49, 0xae, 0xa7, 0x4c, 0x2b, - 0xa3, 0x55, 0xc5, 0xec, 0xcf, 0x7b, 0xab, 0x5f, 0xb7, 0xa5, 0x30, 0xe7, 0x81, 0x7d, 0xfb, 0x4f, - 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x31, 0x4b, 0x75, 0xe8, 0x4d, 0x03, 0x00, 0x00, + // 362 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x51, 0xc1, 0x4e, 0xea, 0x40, + 0x14, 0xa5, 0xf0, 0x28, 0x8f, 0x79, 0xe4, 0x3d, 0x32, 0xaf, 0x31, 0x0d, 0x92, 0xc6, 0x74, 0x61, + 0x5c, 0x98, 0x4e, 0xc0, 0xad, 0x6e, 0x0c, 0x4b, 0x17, 0xd2, 0xa5, 0x2b, 0x0b, 0x73, 0x53, 0x27, + 0xc0, 0x4c, 0xe9, 0x4c, 0x89, 0x8d, 0x71, 0xe3, 0x17, 0x98, 0xf8, 0x13, 0x7e, 0x8a, 0x4b, 0x12, + 0x37, 0x2e, 0x0d, 0xf8, 0x21, 0xa6, 0xd3, 0x81, 0x88, 0x89, 0x9b, 0xa6, 0xf7, 0x9c, 0x73, 0xcf, + 0x3d, 0x77, 0x2e, 0xc2, 0x94, 0x51, 0xb2, 0xe8, 0x91, 0x79, 0x06, 0x69, 0x1e, 0x24, 0xa9, 0x50, + 0x02, 0xdb, 0x94, 0xd1, 0x60, 0xd1, 0xeb, 0x38, 0x86, 0x8b, 0x81, 0x83, 0x64, 0xb2, 0x64, 0x3b, + 0xdd, 0x58, 0x88, 0x78, 0x0a, 0x24, 0x4a, 0x18, 0x89, 0x38, 0x17, 0x2a, 0x52, 0x4c, 0x70, 0xc3, + 0xfa, 0xd7, 0xa8, 0x35, 0x2c, 0xac, 0x42, 0x98, 0x67, 0x20, 0x15, 0x6e, 0xa3, 0x1a, 0x65, 0xd4, + 0xb5, 0x0e, 0xac, 0xa3, 0x66, 0x58, 0xfc, 0xe2, 0x3d, 0x64, 0x8b, 0x94, 0xc5, 0x8c, 0xbb, 0x55, + 0x0d, 0x9a, 0xaa, 0x50, 0x4e, 0x20, 0x77, 0x6b, 0xa5, 0x72, 0x02, 0x39, 0x76, 0x50, 0x3d, 0x92, + 0x12, 0x94, 0xfb, 0x4b, 0x63, 0x65, 0xe1, 0x9f, 0xa1, 0xff, 0x7a, 0xc2, 0x65, 0x94, 0x46, 0x33, + 0x19, 0x82, 0x4c, 0x04, 0x97, 0x80, 0x0f, 0x91, 0x9d, 0x68, 0x44, 0xcf, 0xfa, 0xd3, 0xff, 0x1b, + 0x94, 0x5b, 0x04, 0x46, 0x67, 0x58, 0x7f, 0x80, 0x1c, 0x13, 0x50, 0x8a, 0xe9, 0x02, 0xb6, 0xfd, + 0xc7, 0xe8, 0x37, 0x15, 0xe3, 0x6c, 0x06, 0x5c, 0x19, 0x87, 0xf6, 0xc6, 0x61, 0x60, 0xf0, 0x70, + 0xab, 0xe8, 0x3f, 0x5b, 0xa8, 0xae, 0x6d, 0xf0, 0x05, 0xb2, 0xcb, 0x09, 0xd8, 0xd9, 0xe8, 0xbf, + 0x3e, 0x40, 0x67, 0x7f, 0x07, 0xdd, 0x0d, 0xed, 0xff, 0x7b, 0x78, 0xfd, 0x78, 0xaa, 0x36, 0x71, + 0x83, 0x94, 0xe9, 0xf0, 0x10, 0x35, 0x4c, 0xb0, 0x1f, 0xec, 0xba, 0xdf, 0xd0, 0x9d, 0x25, 0x7c, + 0xac, 0xfd, 0x5a, 0x18, 0x91, 0xe2, 0x74, 0x77, 0x94, 0xd1, 0xfb, 0xf3, 0xd3, 0x97, 0x95, 0x67, + 0x2d, 0x57, 0x9e, 0xf5, 0xbe, 0xf2, 0xac, 0xc7, 0xb5, 0x57, 0x59, 0xae, 0xbd, 0xca, 0xdb, 0xda, + 0xab, 0x5c, 0xf9, 0x31, 0x53, 0x37, 0xd9, 0x28, 0x18, 0x8b, 0x19, 0x11, 0x5c, 0x0a, 0x9e, 0x12, + 0xfd, 0xb9, 0xd5, 0xdd, 0x2a, 0x4f, 0x40, 0x8e, 0x6c, 0x7d, 0xd6, 0x93, 0xcf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x7d, 0xbe, 0x9f, 0x67, 0x28, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -407,8 +240,6 @@ type QueryClient interface { Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) - // Sync queries the DID document by its id. And returns the required PKL information - Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) } type queryClient struct { @@ -437,23 +268,12 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } -func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) { - out := new(SyncResponse) - err := c.cc.Invoke(ctx, "/did.v1.Query/Sync", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) - // Sync queries the DID document by its id. And returns the required PKL information - Sync(context.Context, *SyncRequest) (*SyncResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -466,9 +286,6 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest) func (*UnimplementedQueryServer) Resolve(ctx context.Context, req *QueryRequest) (*QueryResolveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } -func (*UnimplementedQueryServer) Sync(ctx context.Context, req *SyncRequest) (*SyncResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -510,24 +327,6 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SyncRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Sync(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/did.v1.Query/Sync", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Sync(ctx, req.(*SyncRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "did.v1.Query", HandlerType: (*QueryServer)(nil), @@ -540,10 +339,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Resolve", Handler: _Query_Resolve_Handler, }, - { - MethodName: "Sync", - Handler: _Query_Sync_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "did/v1/query.proto", @@ -600,70 +395,6 @@ func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Document != nil { - { - size, err := m.Document.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0x12 - } - if m.Success { - i-- - if m.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -734,69 +465,6 @@ func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SyncRequest) 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 *SyncRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Did) > 0 { - i -= len(m.Did) - copy(dAtA[i:], m.Did) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SyncResponse) 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 *SyncResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Success { - i-- - if m.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -833,30 +501,6 @@ func (m *QueryRequest) Size() (n int) { return n } -func (m *QueryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Success { - n += 2 - } - l = len(m.Query) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Document != nil { - l = m.Document.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - func (m *QueryParamsResponse) Size() (n int) { if m == nil { return 0 @@ -883,31 +527,6 @@ func (m *QueryResolveResponse) Size() (n int) { return n } -func (m *SyncRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Did) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *SyncResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Success { - n += 2 - } - return n -} - func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1092,180 +711,6 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryResponse) 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 ErrIntOverflowQuery - } - 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: QueryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Success = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Document == nil { - m.Document = &Document{} - } - if err := m.Document.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = &Params{} - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1438,158 +883,6 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *SyncRequest) 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 ErrIntOverflowQuery - } - 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: SyncRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SyncRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Did = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SyncResponse) 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 ErrIntOverflowQuery - } - 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: SyncResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SyncResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Success = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/query.pb.gw.go b/x/did/types/query.pb.gw.go index 4080b92e3..224c10b85 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -141,42 +141,6 @@ func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marsha } -var ( - filter_Query_Sync_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Sync_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sync_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Sync(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Sync_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sync_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Sync(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -229,29 +193,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Sync_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sync_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -333,26 +274,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Sync_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sync_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -360,14 +281,10 @@ var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0}, []string{"did"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"sync"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_Resolve_0 = runtime.ForwardResponseMessage - - forward_Query_Sync_0 = runtime.ForwardResponseMessage ) diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index 2ae9ec672..3b9ecbf9c 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -90,23 +90,21 @@ func (m *Alias) GetOrigin() string { // Controller represents a Sonr DWN Vault type Controller struct { // The unique identifier of the controller - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + // The unique identifier of the controller + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` // The DID of the controller - SonrAddress string `protobuf:"bytes,2,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` + SonrAddress string `protobuf:"bytes,3,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` // The DID of the controller - EthAddress string `protobuf:"bytes,3,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` + EthAddress string `protobuf:"bytes,4,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` // The DID of the controller - BtcAddress string `protobuf:"bytes,4,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` - // Aliases of the controller - Aliases []string `protobuf:"bytes,5,rep,name=aliases,proto3" json:"aliases,omitempty"` + BtcAddress string `protobuf:"bytes,5,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The vault address or identifier - VaultCid string `protobuf:"bytes,7,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` - // The Authentications of the controller - Authentication []string `protobuf:"bytes,8,rep,name=authentication,proto3" json:"authentication,omitempty"` + PublicKey []byte `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // Val Keyshare + KsVal string `protobuf:"bytes,7,opt,name=ks_val,json=ksVal,proto3" json:"ks_val,omitempty"` // The Status of the claims for the controller - Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"` + Claimed bool `protobuf:"varint,8,opt,name=claimed,proto3" json:"claimed,omitempty"` } func (m *Controller) Reset() { *m = Controller{} } @@ -142,9 +140,16 @@ func (m *Controller) XXX_DiscardUnknown() { var xxx_messageInfo_Controller proto.InternalMessageInfo -func (m *Controller) GetId() string { +func (m *Controller) GetNumber() uint64 { if m != nil { - return m.Id + return m.Number + } + return 0 +} + +func (m *Controller) GetDid() string { + if m != nil { + return m.Did } return "" } @@ -170,45 +175,31 @@ func (m *Controller) GetBtcAddress() string { return "" } -func (m *Controller) GetAliases() []string { - if m != nil { - return m.Aliases - } - return nil -} - -func (m *Controller) GetPublicKey() *PubKey { +func (m *Controller) GetPublicKey() []byte { if m != nil { return m.PublicKey } return nil } -func (m *Controller) GetVaultCid() string { +func (m *Controller) GetKsVal() string { if m != nil { - return m.VaultCid + return m.KsVal } return "" } -func (m *Controller) GetAuthentication() []string { +func (m *Controller) GetClaimed() bool { if m != nil { - return m.Authentication + return m.Claimed } - return nil -} - -func (m *Controller) GetStatus() string { - if m != nil { - return m.Status - } - return "" + return false } // Verification reprsents a method of verifying membership in a DID type Verification struct { // The unique identifier of the verification - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` // The controller of the verification Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The DIDNamespace of the verification @@ -219,7 +210,8 @@ type Verification struct { Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The Verification Type (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + // The Verification Type (Authentication, Assertion, CapabilityDelegation, + // CapabilityInvocation) VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` } @@ -256,9 +248,9 @@ func (m *Verification) XXX_DiscardUnknown() { var xxx_messageInfo_Verification proto.InternalMessageInfo -func (m *Verification) GetId() string { +func (m *Verification) GetDid() string { if m != nil { - return m.Id + return m.Did } return "" } @@ -314,42 +306,42 @@ func init() { func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 557 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0xed, 0xd8, 0x79, 0x34, 0x37, 0x55, 0x70, 0x47, 0x55, 0x19, 0x15, 0x30, 0x21, 0x42, 0x55, - 0x25, 0x42, 0xac, 0xc2, 0x2e, 0x62, 0x53, 0xba, 0xac, 0x90, 0x50, 0x85, 0x58, 0xb0, 0x89, 0x6c, - 0xcf, 0x90, 0x4c, 0x9b, 0x78, 0x82, 0x67, 0x1c, 0x91, 0x9f, 0x40, 0xac, 0x59, 0xf0, 0x3d, 0x2c, - 0x2b, 0xb1, 0x61, 0x83, 0x84, 0x92, 0x3f, 0xe0, 0x0b, 0xd0, 0x3c, 0x92, 0x38, 0xed, 0x8a, 0x8d, - 0xa5, 0x7b, 0xe6, 0x78, 0xce, 0xbd, 0xe7, 0xdc, 0x01, 0x4c, 0x39, 0x8d, 0x66, 0xa7, 0x91, 0x54, - 0xb1, 0x62, 0xbd, 0x69, 0x2e, 0x94, 0xc0, 0x35, 0xca, 0x69, 0x6f, 0x76, 0x7a, 0x74, 0x3f, 0x15, - 0x72, 0x22, 0x64, 0x24, 0xf2, 0x89, 0xa6, 0x88, 0x7c, 0x62, 0x09, 0x47, 0x07, 0xee, 0xa7, 0x21, - 0xcb, 0x98, 0xe4, 0xd2, 0xa2, 0x1d, 0x01, 0xd5, 0xb3, 0x31, 0x8f, 0x25, 0x6e, 0x81, 0xc7, 0x29, - 0x41, 0x6d, 0x74, 0xd2, 0xb8, 0xf4, 0x38, 0xc5, 0x04, 0xea, 0xb2, 0x48, 0xae, 0x58, 0xaa, 0x88, - 0x67, 0xc0, 0x55, 0x89, 0x0f, 0xa1, 0x26, 0x72, 0x3e, 0xe4, 0x19, 0xf1, 0xcd, 0x81, 0xab, 0xfa, - 0x4f, 0xff, 0x7e, 0xff, 0xf9, 0xc5, 0x0f, 0xa1, 0xa2, 0x6f, 0xc2, 0x07, 0xd0, 0x72, 0x3f, 0x74, - 0xed, 0x79, 0x80, 0x08, 0x22, 0xa8, 0xf3, 0xcd, 0x07, 0x38, 0x17, 0x99, 0xca, 0xc5, 0x78, 0xcc, - 0xf2, 0x3b, 0xb2, 0x4f, 0x60, 0x4f, 0x8a, 0x2c, 0x1f, 0xc4, 0x94, 0xe6, 0x4c, 0x4a, 0xa7, 0xdd, - 0xd4, 0xd8, 0x99, 0x85, 0xf0, 0x63, 0x68, 0x32, 0x35, 0x5a, 0x33, 0x6c, 0x13, 0xc0, 0xd4, 0xa8, - 0x44, 0x48, 0x54, 0xba, 0x26, 0x54, 0x2c, 0x21, 0x51, 0xe9, 0x8a, 0x40, 0xa0, 0x1e, 0xeb, 0xa1, - 0x99, 0x24, 0xd5, 0xb6, 0xaf, 0x67, 0x73, 0x25, 0x7e, 0x0e, 0x30, 0x2d, 0x92, 0x31, 0x4f, 0x07, - 0xd7, 0x6c, 0x4e, 0x6a, 0x6d, 0x74, 0xd2, 0x7c, 0xd1, 0xea, 0x59, 0x6b, 0x7b, 0x6f, 0x8b, 0xe4, - 0x82, 0xcd, 0x2f, 0x1b, 0x96, 0x71, 0xc1, 0xe6, 0xf8, 0x01, 0x34, 0x66, 0x71, 0x31, 0x56, 0x83, - 0x94, 0x53, 0x52, 0x37, 0x3a, 0xbb, 0x06, 0x38, 0xe7, 0x14, 0x1f, 0x43, 0x2b, 0x2e, 0xd4, 0x88, - 0x65, 0x8a, 0xa7, 0xb1, 0xe2, 0x22, 0x23, 0xbb, 0x46, 0xec, 0x16, 0xaa, 0xfd, 0xd4, 0x41, 0x16, - 0x92, 0x34, 0xac, 0x9f, 0xb6, 0xea, 0x7f, 0x32, 0x7e, 0x5e, 0x3b, 0x3f, 0xf1, 0xb6, 0x31, 0xda, - 0x4d, 0xbc, 0xbf, 0xe5, 0x44, 0xe0, 0x59, 0xa8, 0x34, 0x7b, 0xe0, 0x13, 0x84, 0xef, 0x95, 0x9a, - 0x0c, 0x2a, 0x04, 0xe1, 0x43, 0x08, 0xac, 0x44, 0x77, 0x83, 0x57, 0x09, 0x22, 0x5e, 0xe7, 0xb7, - 0x07, 0x7b, 0xef, 0x59, 0xce, 0x3f, 0xae, 0x7a, 0xbb, 0x1d, 0x4f, 0x08, 0x90, 0xae, 0xc3, 0x73, - 0xe1, 0x94, 0x10, 0xfc, 0x08, 0x80, 0x72, 0x3a, 0x98, 0x30, 0x35, 0x12, 0xd4, 0x45, 0xd3, 0xa0, - 0x9c, 0xbe, 0x31, 0x80, 0x1e, 0x95, 0x4b, 0x59, 0xb0, 0xdc, 0x85, 0xe2, 0xaa, 0xf2, 0xb2, 0x55, - 0xb7, 0x97, 0xed, 0x3f, 0x03, 0x79, 0x06, 0xfb, 0xb3, 0x52, 0xff, 0x03, 0x35, 0x9f, 0x32, 0x17, - 0x4c, 0x50, 0x3e, 0x78, 0x37, 0x9f, 0xb2, 0xfe, 0xd4, 0x18, 0x7c, 0xb5, 0x59, 0x58, 0xdb, 0x4d, - 0xd7, 0x69, 0x1b, 0x8b, 0x3b, 0xf0, 0x70, 0x33, 0x5e, 0x77, 0x33, 0x5b, 0xd7, 0x72, 0x8d, 0xe7, - 0xc7, 0xd0, 0xbe, 0x23, 0xba, 0xba, 0x64, 0xc5, 0xf3, 0x09, 0x22, 0x95, 0xd7, 0xaf, 0x7e, 0x2c, - 0x42, 0x74, 0xb3, 0x08, 0xd1, 0x9f, 0x45, 0x88, 0xbe, 0x2e, 0xc3, 0x9d, 0x9b, 0x65, 0xb8, 0xf3, - 0x6b, 0x19, 0xee, 0x7c, 0xe8, 0x0c, 0xb9, 0x1a, 0x15, 0x49, 0x2f, 0x15, 0x93, 0x48, 0x64, 0x3a, - 0xe9, 0xc8, 0x7c, 0x3e, 0x47, 0xfa, 0xd9, 0xea, 0x1b, 0x65, 0x52, 0x33, 0x4f, 0xf6, 0xe5, 0xbf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x53, 0x80, 0x70, 0xff, 0x03, 0x00, 0x00, + // 550 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x93, 0xcf, 0x8e, 0xd3, 0x3e, + 0x10, 0xc7, 0xd7, 0xe9, 0x9f, 0xdd, 0x4e, 0xab, 0x2a, 0x6b, 0xed, 0xef, 0x87, 0xb5, 0x82, 0x50, + 0x2a, 0x84, 0x2a, 0x51, 0x1a, 0x2d, 0xdc, 0x2a, 0x2e, 0x0b, 0xc7, 0x15, 0x12, 0x2a, 0x68, 0x25, + 0xb8, 0x54, 0x49, 0x6c, 0x5a, 0xd3, 0x24, 0x2e, 0xb1, 0x53, 0xd1, 0x97, 0x40, 0x3c, 0x01, 0x8f, + 0x83, 0x38, 0xae, 0xc4, 0x85, 0xe3, 0xaa, 0x7d, 0x03, 0x9e, 0x00, 0xd9, 0x71, 0xda, 0x54, 0x7b, + 0x89, 0x32, 0x5f, 0x7f, 0x3d, 0xe3, 0xf9, 0x78, 0x0c, 0x98, 0x72, 0xea, 0xaf, 0x2e, 0x7c, 0xa9, + 0x02, 0xc5, 0x46, 0xcb, 0x4c, 0x28, 0x81, 0x9b, 0x94, 0xd3, 0xd1, 0xea, 0xe2, 0xfc, 0x5e, 0x24, + 0x64, 0x22, 0xa4, 0x2f, 0xb2, 0x44, 0x5b, 0x44, 0x96, 0x14, 0x86, 0xf3, 0x33, 0xbb, 0x69, 0xc6, + 0x52, 0x26, 0xb9, 0x2c, 0xd4, 0xbe, 0x80, 0xc6, 0x65, 0xcc, 0x03, 0x89, 0xbb, 0xe0, 0x70, 0x4a, + 0x50, 0x0f, 0x0d, 0x5a, 0x13, 0x87, 0x53, 0x4c, 0xe0, 0x58, 0xe6, 0xe1, 0x67, 0x16, 0x29, 0xe2, + 0x18, 0xb1, 0x0c, 0xf1, 0xff, 0xd0, 0x14, 0x19, 0x9f, 0xf1, 0x94, 0xd4, 0xcc, 0x82, 0x8d, 0xc6, + 0x8f, 0xff, 0xfe, 0xf8, 0xfd, 0xad, 0xe6, 0x41, 0x5d, 0x67, 0xc2, 0x67, 0xd0, 0xb5, 0x1b, 0x86, + 0xc5, 0xba, 0x8b, 0x08, 0x22, 0xa8, 0xff, 0xd3, 0x01, 0x78, 0x2d, 0x52, 0x95, 0x89, 0x38, 0x66, + 0x99, 0x4e, 0x96, 0xe6, 0x49, 0xc8, 0x32, 0x53, 0xba, 0x3e, 0xb1, 0x11, 0x76, 0xa1, 0x46, 0x39, + 0xb5, 0xa5, 0xf5, 0x2f, 0x7e, 0x04, 0x1d, 0x29, 0xd2, 0x6c, 0x1a, 0x50, 0x9a, 0x31, 0x29, 0x6d, + 0xf1, 0xb6, 0xd6, 0x2e, 0x0b, 0x09, 0x3f, 0x84, 0x36, 0x53, 0xf3, 0x9d, 0xa3, 0x6e, 0x1c, 0xc0, + 0xd4, 0xbc, 0x62, 0x08, 0x55, 0xb4, 0x33, 0x34, 0x0a, 0x43, 0xa8, 0xa2, 0xd2, 0xf0, 0x00, 0x60, + 0x99, 0x87, 0x31, 0x8f, 0xa6, 0x0b, 0xb6, 0x26, 0xcd, 0x1e, 0x1a, 0x74, 0x26, 0xad, 0x42, 0xb9, + 0x62, 0x6b, 0xfc, 0x1f, 0x34, 0x17, 0x72, 0xba, 0x0a, 0x62, 0x72, 0x6c, 0xb6, 0x36, 0x16, 0xf2, + 0x3a, 0x88, 0x35, 0xab, 0x28, 0x0e, 0x78, 0xc2, 0x28, 0x39, 0xe9, 0xa1, 0xc1, 0xc9, 0xa4, 0x0c, + 0xc7, 0x1f, 0x0c, 0x93, 0x77, 0x00, 0x65, 0x9b, 0x2e, 0xc2, 0xf8, 0xb0, 0x11, 0xcd, 0x05, 0x9f, + 0x1e, 0x9c, 0xdc, 0x75, 0x0a, 0xa9, 0x72, 0x56, 0xb7, 0x46, 0x10, 0x6e, 0x19, 0x28, 0x6e, 0x9d, + 0x20, 0xe2, 0xf4, 0x6f, 0x1d, 0xe8, 0x5c, 0xb3, 0x8c, 0x7f, 0xe2, 0x51, 0xa0, 0xb8, 0x48, 0x4b, + 0x64, 0x68, 0x8f, 0xcc, 0x03, 0x88, 0x76, 0xa8, 0x2d, 0xcb, 0x8a, 0xa2, 0xbb, 0xa5, 0x9c, 0x4e, + 0x13, 0xa6, 0xe6, 0x82, 0x5a, 0xa0, 0x2d, 0xca, 0xe9, 0x1b, 0x23, 0xe8, 0xbb, 0xe1, 0x52, 0xe6, + 0x2c, 0xb3, 0x24, 0x6d, 0x54, 0x1d, 0x8d, 0xc6, 0xe1, 0x68, 0x3c, 0xbb, 0x83, 0xaf, 0xfd, 0xbc, + 0x3b, 0x2a, 0x26, 0x73, 0xf4, 0x36, 0x0f, 0xaf, 0xd8, 0xba, 0x8a, 0xf3, 0x29, 0x9c, 0xae, 0x2a, + 0x1d, 0x4c, 0xd5, 0x7a, 0xc9, 0x2c, 0x59, 0xb7, 0xba, 0xf0, 0x7e, 0xbd, 0x64, 0xe3, 0x2f, 0x06, + 0xe5, 0x02, 0x1a, 0xa6, 0x4d, 0x3d, 0x5f, 0xc5, 0x71, 0x86, 0xb6, 0xb8, 0xe1, 0xd8, 0x87, 0xfb, + 0xfb, 0xfe, 0x86, 0xfb, 0xe6, 0x86, 0x85, 0xd7, 0x80, 0x7d, 0x02, 0xbd, 0x3b, 0x55, 0xcb, 0x24, + 0xa5, 0xaf, 0x46, 0x10, 0xa9, 0xbf, 0x7a, 0xf9, 0x6b, 0xe3, 0xa1, 0x9b, 0x8d, 0x87, 0x6e, 0x37, + 0x1e, 0xfa, 0xbe, 0xf5, 0x8e, 0x6e, 0xb6, 0xde, 0xd1, 0x9f, 0xad, 0x77, 0xf4, 0xb1, 0x3f, 0xe3, + 0x6a, 0x9e, 0x87, 0xa3, 0x48, 0x24, 0xbe, 0x48, 0xf5, 0x75, 0xfa, 0xe6, 0xf3, 0xd5, 0xd7, 0xaf, + 0x4c, 0x67, 0x94, 0x61, 0xd3, 0xbc, 0xb0, 0x17, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x9f, + 0x1c, 0x50, 0xae, 0x03, 0x00, 0x00, } func (m *Alias) Marshal() (dAtA []byte, err error) { @@ -416,77 +408,62 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintState(dAtA, i, uint64(len(m.Status))) + if m.Claimed { i-- - dAtA[i] = 0x4a - } - if len(m.Authentication) > 0 { - for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Authentication[iNdEx]) - copy(dAtA[i:], m.Authentication[iNdEx]) - i = encodeVarintState(dAtA, i, uint64(len(m.Authentication[iNdEx]))) - i-- - dAtA[i] = 0x42 + if m.Claimed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x40 } - if len(m.VaultCid) > 0 { - i -= len(m.VaultCid) - copy(dAtA[i:], m.VaultCid) - i = encodeVarintState(dAtA, i, uint64(len(m.VaultCid))) + if len(m.KsVal) > 0 { + i -= len(m.KsVal) + copy(dAtA[i:], m.KsVal) + i = encodeVarintState(dAtA, i, uint64(len(m.KsVal))) i-- dAtA[i] = 0x3a } - if m.PublicKey != nil { - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintState(dAtA, i, uint64(len(m.PublicKey))) i-- dAtA[i] = 0x32 } - if len(m.Aliases) > 0 { - for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Aliases[iNdEx]) - copy(dAtA[i:], m.Aliases[iNdEx]) - i = encodeVarintState(dAtA, i, uint64(len(m.Aliases[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } if len(m.BtcAddress) > 0 { i -= len(m.BtcAddress) copy(dAtA[i:], m.BtcAddress) i = encodeVarintState(dAtA, i, uint64(len(m.BtcAddress))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } if len(m.EthAddress) > 0 { i -= len(m.EthAddress) copy(dAtA[i:], m.EthAddress) i = encodeVarintState(dAtA, i, uint64(len(m.EthAddress))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(m.SonrAddress) > 0 { i -= len(m.SonrAddress) copy(dAtA[i:], m.SonrAddress) i = encodeVarintState(dAtA, i, uint64(len(m.SonrAddress))) i-- + dAtA[i] = 0x1a + } + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintState(dAtA, i, uint64(len(m.Did))) + i-- dAtA[i] = 0x12 } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintState(dAtA, i, uint64(len(m.Id))) + if m.Number != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Number)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -558,10 +535,10 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintState(dAtA, i, uint64(len(m.Id))) + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintState(dAtA, i, uint64(len(m.Did))) i-- dAtA[i] = 0xa } @@ -606,7 +583,10 @@ func (m *Controller) Size() (n int) { } var l int _ = l - l = len(m.Id) + if m.Number != 0 { + n += 1 + sovState(uint64(m.Number)) + } + l = len(m.Did) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -622,30 +602,17 @@ func (m *Controller) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if len(m.Aliases) > 0 { - for _, s := range m.Aliases { - l = len(s) - n += 1 + l + sovState(uint64(l)) - } - } - if m.PublicKey != nil { - l = m.PublicKey.Size() - n += 1 + l + sovState(uint64(l)) - } - l = len(m.VaultCid) + l = len(m.PublicKey) if l > 0 { n += 1 + l + sovState(uint64(l)) } - if len(m.Authentication) > 0 { - for _, s := range m.Authentication { - l = len(s) - n += 1 + l + sovState(uint64(l)) - } - } - l = len(m.Status) + l = len(m.KsVal) if l > 0 { n += 1 + l + sovState(uint64(l)) } + if m.Claimed { + n += 2 + } return n } @@ -655,7 +622,7 @@ func (m *Verification) Size() (n int) { } var l int _ = l - l = len(m.Id) + l = len(m.Did) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -868,8 +835,27 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + m.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Number |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -897,9 +883,9 @@ func (m *Controller) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SonrAddress", wireType) } @@ -931,7 +917,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } m.SonrAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EthAddress", wireType) } @@ -963,7 +949,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } m.EthAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BtcAddress", wireType) } @@ -995,43 +981,11 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } m.BtcAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aliases", 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.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1041,31 +995,29 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) if m.PublicKey == nil { - m.PublicKey = &PubKey{} - } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.PublicKey = []byte{} } iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VaultCid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field KsVal", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1093,13 +1045,13 @@ func (m *Controller) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.VaultCid = string(dAtA[iNdEx:postIndex]) + m.KsVal = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Claimed", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1109,56 +1061,12 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(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.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.Claimed = bool(v != 0) default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) @@ -1211,7 +1119,7 @@ func (m *Verification) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1239,7 +1147,7 @@ func (m *Verification) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/did/types/tx.pb.go b/x/did/types/tx.pb.go index b2dea3f72..fb1fac3b4 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -30,143 +30,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgAllocateVault is the message type for the AllocateVault RPC. -type MsgAllocateVault struct { - // authority is the address of the service account. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // subject is a unique human-defined identifier to associate with the vault. - Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` - // origin is the origin of the request in wildcard form. - Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` -} - -func (m *MsgAllocateVault) Reset() { *m = MsgAllocateVault{} } -func (m *MsgAllocateVault) String() string { return proto.CompactTextString(m) } -func (*MsgAllocateVault) ProtoMessage() {} -func (*MsgAllocateVault) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{0} -} -func (m *MsgAllocateVault) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAllocateVault) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAllocateVault.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 *MsgAllocateVault) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAllocateVault.Merge(m, src) -} -func (m *MsgAllocateVault) XXX_Size() int { - return m.Size() -} -func (m *MsgAllocateVault) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAllocateVault.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAllocateVault proto.InternalMessageInfo - -func (m *MsgAllocateVault) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgAllocateVault) GetSubject() string { - if m != nil { - return m.Subject - } - return "" -} - -func (m *MsgAllocateVault) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. -type MsgAllocateVaultResponse struct { - // CID is the content identifier of the vault. - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - // ExpiryBlock is the block number at which the vault will expire. - ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` - // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn - Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` - // IsLocalhost is a flag to indicate if the vault is localhost - Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"` -} - -func (m *MsgAllocateVaultResponse) Reset() { *m = MsgAllocateVaultResponse{} } -func (m *MsgAllocateVaultResponse) String() string { return proto.CompactTextString(m) } -func (*MsgAllocateVaultResponse) ProtoMessage() {} -func (*MsgAllocateVaultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{1} -} -func (m *MsgAllocateVaultResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAllocateVaultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAllocateVaultResponse.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 *MsgAllocateVaultResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAllocateVaultResponse.Merge(m, src) -} -func (m *MsgAllocateVaultResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgAllocateVaultResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAllocateVaultResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAllocateVaultResponse proto.InternalMessageInfo - -func (m *MsgAllocateVaultResponse) GetCid() string { - if m != nil { - return m.Cid - } - return "" -} - -func (m *MsgAllocateVaultResponse) GetExpiryBlock() int64 { - if m != nil { - return m.ExpiryBlock - } - return 0 -} - -func (m *MsgAllocateVaultResponse) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func (m *MsgAllocateVaultResponse) GetLocalhost() bool { - if m != nil { - return m.Localhost - } - return false -} - // MsgRegisterController is the message type for the InitializeController RPC. type MsgRegisterController struct { // authority is the address of the governance account. @@ -175,7 +38,8 @@ type MsgRegisterController struct { Assertions [][]byte `protobuf:"bytes,2,rep,name=assertions,proto3" json:"assertions,omitempty"` // Keyshares is the list of keyshares to initialize the controller with. Keyshares [][]byte `protobuf:"bytes,3,rep,name=keyshares,proto3" json:"keyshares,omitempty"` - // Verifications is the list of verifications to initialize the controller with. + // Verifications is the list of verifications to initialize the controller + // with. Verifications [][]byte `protobuf:"bytes,4,rep,name=verifications,proto3" json:"verifications,omitempty"` } @@ -183,7 +47,7 @@ func (m *MsgRegisterController) Reset() { *m = MsgRegisterController{} } func (m *MsgRegisterController) String() string { return proto.CompactTextString(m) } func (*MsgRegisterController) ProtoMessage() {} func (*MsgRegisterController) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{2} + return fileDescriptor_d73284df019ff211, []int{0} } func (m *MsgRegisterController) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,9 +104,11 @@ func (m *MsgRegisterController) GetVerifications() [][]byte { return nil } -// MsgRegisterControllerResponse is the response type for the InitializeController RPC. +// MsgRegisterControllerResponse is the response type for the +// InitializeController RPC. type MsgRegisterControllerResponse struct { - // Success returns true if the specified cid is valid and not already encrypted. + // Success returns true if the specified cid is valid and not already + // encrypted. Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Controller is the address of the initialized controller. Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` @@ -254,7 +120,7 @@ func (m *MsgRegisterControllerResponse) Reset() { *m = MsgRegisterContro func (m *MsgRegisterControllerResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterControllerResponse) ProtoMessage() {} func (*MsgRegisterControllerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{3} + return fileDescriptor_d73284df019ff211, []int{1} } func (m *MsgRegisterControllerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -318,7 +184,7 @@ func (m *MsgExecuteTx) Reset() { *m = MsgExecuteTx{} } func (m *MsgExecuteTx) String() string { return proto.CompactTextString(m) } func (*MsgExecuteTx) ProtoMessage() {} func (*MsgExecuteTx) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{4} + return fileDescriptor_d73284df019ff211, []int{2} } func (m *MsgExecuteTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -378,7 +244,7 @@ func (m *MsgExecuteTxResponse) Reset() { *m = MsgExecuteTxResponse{} } func (m *MsgExecuteTxResponse) String() string { return proto.CompactTextString(m) } func (*MsgExecuteTxResponse) ProtoMessage() {} func (*MsgExecuteTxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{5} + return fileDescriptor_d73284df019ff211, []int{3} } func (m *MsgExecuteTxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -437,7 +303,7 @@ func (m *MsgAuthorizeService) Reset() { *m = MsgAuthorizeService{} } func (m *MsgAuthorizeService) String() string { return proto.CompactTextString(m) } func (*MsgAuthorizeService) ProtoMessage() {} func (*MsgAuthorizeService) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{6} + return fileDescriptor_d73284df019ff211, []int{4} } func (m *MsgAuthorizeService) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -494,7 +360,8 @@ func (m *MsgAuthorizeService) GetToken() string { return "" } -// MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. +// MsgAuthorizeServiceResponse is the response type for the AuthorizeService +// RPC. type MsgAuthorizeServiceResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` @@ -504,7 +371,7 @@ func (m *MsgAuthorizeServiceResponse) Reset() { *m = MsgAuthorizeService func (m *MsgAuthorizeServiceResponse) String() string { return proto.CompactTextString(m) } func (*MsgAuthorizeServiceResponse) ProtoMessage() {} func (*MsgAuthorizeServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{7} + return fileDescriptor_d73284df019ff211, []int{5} } func (m *MsgAuthorizeServiceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -551,7 +418,8 @@ func (m *MsgAuthorizeServiceResponse) GetToken() string { type MsgRegisterService struct { // authority is the address of the governance account. Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` - // origin is the origin of the request in wildcard form. Requires valid TXT record in DNS. + // origin is the origin of the request in wildcard form. Requires valid TXT + // record in DNS. Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` } @@ -559,7 +427,7 @@ func (m *MsgRegisterService) Reset() { *m = MsgRegisterService{} } func (m *MsgRegisterService) String() string { return proto.CompactTextString(m) } func (*MsgRegisterService) ProtoMessage() {} func (*MsgRegisterService) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{8} + return fileDescriptor_d73284df019ff211, []int{6} } func (m *MsgRegisterService) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -612,7 +480,7 @@ func (m *MsgRegisterServiceResponse) Reset() { *m = MsgRegisterServiceRe func (m *MsgRegisterServiceResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterServiceResponse) ProtoMessage() {} func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{9} + return fileDescriptor_d73284df019ff211, []int{7} } func (m *MsgRegisterServiceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -671,7 +539,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParams) ProtoMessage() {} func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{10} + return fileDescriptor_d73284df019ff211, []int{8} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -732,7 +600,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParamsResponse) ProtoMessage() {} func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{11} + return fileDescriptor_d73284df019ff211, []int{9} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -762,8 +630,6 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgAllocateVault)(nil), "did.v1.MsgAllocateVault") - proto.RegisterType((*MsgAllocateVaultResponse)(nil), "did.v1.MsgAllocateVaultResponse") proto.RegisterType((*MsgRegisterController)(nil), "did.v1.MsgRegisterController") proto.RegisterType((*MsgRegisterControllerResponse)(nil), "did.v1.MsgRegisterControllerResponse") proto.RegisterMapType((map[string]string)(nil), "did.v1.MsgRegisterControllerResponse.AccountsEntry") @@ -782,65 +648,58 @@ func init() { func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) } var fileDescriptor_d73284df019ff211 = []byte{ - // 922 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xda, 0xa9, 0x93, 0x3c, 0x3b, 0xb1, 0x35, 0x18, 0xb2, 0xdd, 0xb6, 0x6e, 0x58, 0xa8, - 0x14, 0xaa, 0x62, 0xab, 0xa9, 0x84, 0xaa, 0x80, 0x8a, 0x12, 0x54, 0x29, 0x08, 0x19, 0xca, 0x36, - 0x70, 0xe8, 0x25, 0xda, 0xec, 0x0e, 0xeb, 0xc1, 0xf6, 0x8e, 0x35, 0x6f, 0x6c, 0xd9, 0x9c, 0xf8, - 0x73, 0x43, 0x1c, 0xf8, 0x02, 0xf0, 0x19, 0x7a, 0xe0, 0x1b, 0x70, 0xe9, 0xb1, 0xe2, 0xc4, 0x09, - 0xa1, 0xe4, 0x50, 0xf1, 0x21, 0x90, 0xd0, 0xee, 0xec, 0xae, 0xc7, 0x7f, 0x62, 0xdc, 0xe6, 0x62, - 0xed, 0xbc, 0xf7, 0xe6, 0x37, 0xbf, 0xdf, 0x9b, 0xdf, 0xbe, 0x35, 0x94, 0x7d, 0xe6, 0x37, 0x06, - 0x77, 0x1b, 0x72, 0x58, 0xef, 0x09, 0x2e, 0x39, 0x29, 0xf8, 0xcc, 0xaf, 0x0f, 0xee, 0x5a, 0xdb, - 0x1e, 0xc7, 0x2e, 0xc7, 0x46, 0x17, 0x83, 0x28, 0xdf, 0xc5, 0x40, 0x15, 0x58, 0x57, 0x55, 0xe2, - 0x24, 0x5e, 0x35, 0xd4, 0x22, 0x49, 0x55, 0x13, 0xb0, 0x80, 0x86, 0x14, 0x59, 0x16, 0x0d, 0x78, - 0xc0, 0x55, 0x75, 0xf4, 0xa4, 0xa2, 0xf6, 0x4f, 0x06, 0x54, 0x9a, 0x18, 0x1c, 0x74, 0x3a, 0xdc, - 0x73, 0x25, 0xfd, 0xd2, 0xed, 0x77, 0x24, 0x79, 0x0f, 0x36, 0xdc, 0xbe, 0x6c, 0x71, 0xc1, 0xe4, - 0xc8, 0x34, 0x76, 0x8c, 0xdd, 0x8d, 0x43, 0xf3, 0x8f, 0xdf, 0xde, 0xad, 0x26, 0xa7, 0x1c, 0xf8, - 0xbe, 0xa0, 0x88, 0x8f, 0xa5, 0x60, 0x61, 0xe0, 0x8c, 0x4b, 0x89, 0x09, 0x6b, 0xd8, 0x3f, 0xfd, - 0x9a, 0x7a, 0xd2, 0xcc, 0x45, 0xbb, 0x9c, 0x74, 0x49, 0xde, 0x80, 0x02, 0x17, 0x2c, 0x60, 0xa1, - 0x99, 0x8f, 0x13, 0xc9, 0x6a, 0x7f, 0xeb, 0xfb, 0x17, 0x4f, 0x6f, 0x8f, 0x11, 0xec, 0x1f, 0x0c, - 0x30, 0xa7, 0xe9, 0x38, 0x14, 0x7b, 0x3c, 0x44, 0x4a, 0x2a, 0x90, 0xf7, 0x98, 0xaf, 0x08, 0x39, - 0xd1, 0x23, 0x79, 0x13, 0x4a, 0x74, 0xd8, 0x63, 0x62, 0x74, 0x72, 0xda, 0xe1, 0x5e, 0x3b, 0x3e, - 0x35, 0xef, 0x14, 0x55, 0xec, 0x30, 0x0a, 0x91, 0x2a, 0x5c, 0x91, 0xbc, 0x4d, 0xd3, 0x83, 0xd5, - 0x82, 0x5c, 0x87, 0x8d, 0xe8, 0x84, 0x4e, 0x8b, 0xa3, 0x34, 0x57, 0x77, 0x8c, 0xdd, 0x75, 0x67, - 0x1c, 0xb0, 0x7f, 0x37, 0xe0, 0xf5, 0x26, 0x06, 0x0e, 0x0d, 0x18, 0x4a, 0x2a, 0x3e, 0xe2, 0xa1, - 0x14, 0xbc, 0xd3, 0xa1, 0xe2, 0x95, 0x3b, 0x53, 0x03, 0x70, 0x11, 0xa9, 0x90, 0x8c, 0x87, 0x68, - 0xe6, 0x76, 0xf2, 0xbb, 0x25, 0x47, 0x8b, 0x44, 0x7c, 0xda, 0x74, 0x84, 0x2d, 0x57, 0x50, 0x34, - 0xf3, 0x71, 0x7a, 0x1c, 0x20, 0x6f, 0xc3, 0xe6, 0x80, 0x0a, 0xf6, 0x15, 0xf3, 0x5c, 0x05, 0xb0, - 0x1a, 0x57, 0x4c, 0x06, 0x67, 0x7a, 0xf9, 0x5d, 0x0e, 0x6e, 0xcc, 0x55, 0x91, 0x35, 0x34, 0xbe, - 0x2f, 0xcf, 0xa3, 0x88, 0xb1, 0x96, 0x75, 0x27, 0x5d, 0x92, 0xfb, 0x00, 0x5e, 0x56, 0xaf, 0x2e, - 0x73, 0x81, 0x50, 0xad, 0x96, 0x7c, 0x06, 0xeb, 0xae, 0xe7, 0xf1, 0x7e, 0x28, 0x95, 0x90, 0xe2, - 0xde, 0xbd, 0xba, 0xf2, 0x72, 0x7d, 0x21, 0x99, 0xfa, 0x41, 0xb2, 0xeb, 0x61, 0x28, 0xc5, 0xc8, - 0xc9, 0x40, 0xac, 0xf7, 0x61, 0x73, 0x22, 0x15, 0xd9, 0xa0, 0x4d, 0x47, 0xa9, 0x0d, 0xda, 0x74, - 0x14, 0xdd, 0xf1, 0xc0, 0xed, 0xf4, 0x69, 0xe2, 0x3a, 0xb5, 0xd8, 0xcf, 0xdd, 0x37, 0xec, 0x7f, - 0x0d, 0x28, 0x35, 0x31, 0x78, 0x38, 0xa4, 0x5e, 0x5f, 0xd2, 0xe3, 0xe1, 0x94, 0x30, 0xe3, 0x25, - 0x84, 0x3d, 0x80, 0xf5, 0x2e, 0x45, 0x74, 0x03, 0xaa, 0x2e, 0xb0, 0xb8, 0x67, 0x6b, 0xc2, 0xb2, - 0x13, 0xea, 0xcd, 0xa4, 0x28, 0xd1, 0x91, 0xee, 0x21, 0xb7, 0x60, 0xab, 0xeb, 0x7a, 0xae, 0xe0, - 0x3c, 0x3c, 0xd1, 0x1d, 0xb9, 0x99, 0x46, 0x8f, 0xa3, 0x60, 0x24, 0x77, 0x02, 0xe1, 0xff, 0xe4, - 0x96, 0x34, 0xb9, 0xfb, 0xe5, 0xc8, 0x02, 0x1a, 0x69, 0xfb, 0x63, 0xa8, 0xea, 0xe4, 0x96, 0xb8, - 0xf9, 0x6d, 0x58, 0x93, 0xc3, 0x93, 0x96, 0x8b, 0xad, 0xa4, 0x9b, 0x05, 0x39, 0x3c, 0x72, 0xb1, - 0x65, 0xff, 0x9a, 0x83, 0xd7, 0xa2, 0x57, 0x53, 0xf9, 0xeb, 0x1b, 0xfa, 0x98, 0x8a, 0x01, 0xf3, - 0xe8, 0x25, 0x3a, 0x3a, 0x1e, 0x0a, 0x39, 0x7d, 0x28, 0x90, 0x4f, 0xa1, 0xd8, 0xa3, 0xa2, 0xcb, - 0x10, 0x63, 0xb3, 0x2b, 0x17, 0xdd, 0xd1, 0x9a, 0x3d, 0xcd, 0xa1, 0xfe, 0x68, 0x5c, 0xae, 0xda, - 0xae, 0x03, 0x8c, 0x47, 0xc0, 0xaa, 0x36, 0x02, 0xac, 0x07, 0x50, 0x99, 0xde, 0xf6, 0x32, 0xd6, - 0x9a, 0xed, 0x75, 0x13, 0xae, 0xcd, 0xe1, 0xb6, 0x44, 0xcb, 0x33, 0x7e, 0x39, 0x8d, 0x9f, 0xfd, - 0xa3, 0x01, 0x44, 0x7b, 0x63, 0x2e, 0xdf, 0xee, 0x77, 0x60, 0x0d, 0x15, 0x48, 0x7c, 0x50, 0x71, - 0xaf, 0x9c, 0xb6, 0x34, 0xa5, 0x9a, 0xe6, 0x67, 0xb5, 0x1d, 0x81, 0x35, 0xcb, 0x65, 0x09, 0x69, - 0x15, 0xc8, 0xfb, 0xcc, 0x4f, 0x84, 0x45, 0x8f, 0xf6, 0x2f, 0x06, 0x94, 0x9b, 0x18, 0x7c, 0xd1, - 0xf3, 0x5d, 0x49, 0x1f, 0xb9, 0xc2, 0xed, 0xe2, 0x2b, 0x4f, 0xd5, 0x3b, 0x50, 0xe8, 0xc5, 0x08, - 0x89, 0xa0, 0xad, 0x54, 0x90, 0xc2, 0x3d, 0x5c, 0x7d, 0xf6, 0xd7, 0xcd, 0x15, 0x27, 0xa9, 0x99, - 0xff, 0x25, 0x98, 0x99, 0x9a, 0x57, 0x61, 0x7b, 0x8a, 0x5e, 0x2a, 0x73, 0xef, 0x9f, 0x3c, 0xe4, - 0x9b, 0x18, 0x90, 0x4f, 0x60, 0x73, 0xf2, 0x7b, 0x69, 0xea, 0xde, 0xd4, 0x33, 0xd6, 0xce, 0x45, - 0x99, 0xac, 0x77, 0xc7, 0x50, 0x99, 0x79, 0xa5, 0xae, 0x2d, 0xf0, 0xba, 0xf5, 0xd6, 0x82, 0x64, - 0x86, 0xfa, 0x21, 0x6c, 0x8c, 0x67, 0x5e, 0x75, 0xde, 0x9c, 0xb2, 0xae, 0xcf, 0x8b, 0x66, 0x00, - 0x4f, 0x80, 0xcc, 0xf9, 0xfc, 0xdd, 0x58, 0x38, 0xca, 0xad, 0x5b, 0x4b, 0x4d, 0x7a, 0xf2, 0x39, - 0x94, 0xa7, 0x5d, 0x6d, 0xcd, 0xd9, 0x99, 0x0a, 0xb6, 0x2f, 0xce, 0x65, 0x90, 0x47, 0x50, 0x9a, - 0x70, 0xd4, 0xb6, 0xb6, 0x47, 0x4f, 0x58, 0x37, 0x2f, 0x48, 0xa4, 0x48, 0xd6, 0x95, 0x6f, 0x5f, - 0x3c, 0xbd, 0x6d, 0x1c, 0x7e, 0xf0, 0xec, 0xac, 0x66, 0x3c, 0x3f, 0xab, 0x19, 0x7f, 0x9f, 0xd5, - 0x8c, 0x9f, 0xcf, 0x6b, 0x2b, 0xcf, 0xcf, 0x6b, 0x2b, 0x7f, 0x9e, 0xd7, 0x56, 0x9e, 0xd8, 0x01, - 0x93, 0xad, 0xfe, 0x69, 0xdd, 0xe3, 0xdd, 0x06, 0x0f, 0x91, 0x87, 0xa2, 0x11, 0xff, 0x0c, 0x1b, - 0xd1, 0xdf, 0x2e, 0x39, 0xea, 0x51, 0x3c, 0x2d, 0xc4, 0x7f, 0xae, 0xee, 0xfd, 0x17, 0x00, 0x00, - 0xff, 0xff, 0x68, 0x43, 0x51, 0x0c, 0xd7, 0x09, 0x00, 0x00, + // 809 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0xe3, 0x6e, 0xda, 0xbc, 0xa4, 0x4d, 0x34, 0x04, 0x92, 0xf5, 0xee, 0x66, 0x57, 0x86, + 0x95, 0x96, 0xd5, 0xe2, 0x68, 0xb3, 0x12, 0x5a, 0x15, 0xb4, 0xa8, 0x45, 0x2b, 0x95, 0x43, 0xa0, + 0xb8, 0xe5, 0xd2, 0x4b, 0xe5, 0xda, 0x83, 0x63, 0xb5, 0xf6, 0x44, 0xf3, 0x26, 0x51, 0xc2, 0x09, + 0x38, 0x72, 0xe2, 0x03, 0x00, 0x9f, 0xa1, 0x07, 0xbe, 0x01, 0x97, 0x1e, 0x2b, 0x4e, 0x9c, 0x10, + 0x6a, 0x0f, 0xfd, 0x14, 0x48, 0xc8, 0x1e, 0xdb, 0x71, 0xfe, 0x34, 0x4d, 0xe9, 0x25, 0xf2, 0xbc, + 0xf7, 0xe6, 0x37, 0xbf, 0xdf, 0x6f, 0x9e, 0x9f, 0x03, 0x15, 0xc7, 0x73, 0x5a, 0x83, 0x97, 0x2d, + 0x31, 0x34, 0x7a, 0x9c, 0x09, 0x46, 0x0a, 0x8e, 0xe7, 0x18, 0x83, 0x97, 0x5a, 0xdd, 0x66, 0xe8, + 0x33, 0x6c, 0xf9, 0xe8, 0x86, 0x79, 0x1f, 0x5d, 0x59, 0xa0, 0xdd, 0x97, 0x89, 0xc3, 0x68, 0xd5, + 0x92, 0x8b, 0x38, 0x55, 0x8b, 0xc1, 0x5c, 0x1a, 0x50, 0xf4, 0xd2, 0xa8, 0xcb, 0x5c, 0x26, 0xab, + 0xc3, 0x27, 0x19, 0xd5, 0xff, 0x50, 0xe0, 0xdd, 0x0e, 0xba, 0x26, 0x75, 0x3d, 0x14, 0x94, 0x7f, + 0xce, 0x02, 0xc1, 0xd9, 0xc9, 0x09, 0xe5, 0xe4, 0x63, 0x28, 0x5a, 0x7d, 0xd1, 0x65, 0xdc, 0x13, + 0xa3, 0x86, 0xf2, 0x44, 0x79, 0x56, 0xdc, 0x6e, 0xfc, 0xf9, 0xfb, 0x47, 0xb5, 0xf8, 0xa8, 0x2d, + 0xc7, 0xe1, 0x14, 0x71, 0x4f, 0x70, 0x2f, 0x70, 0xcd, 0x71, 0x29, 0x69, 0x02, 0x58, 0x88, 0x94, + 0x0b, 0x8f, 0x05, 0xd8, 0xc8, 0x3f, 0x51, 0x9f, 0x95, 0xcd, 0x4c, 0x84, 0x3c, 0x84, 0xe2, 0x31, + 0x1d, 0x61, 0xd7, 0xe2, 0x14, 0x1b, 0x6a, 0x94, 0x1e, 0x07, 0xc8, 0x07, 0xb0, 0x3e, 0xa0, 0xdc, + 0xfb, 0xd6, 0xb3, 0x2d, 0x09, 0xb0, 0x12, 0x55, 0x4c, 0x06, 0x37, 0x37, 0x7e, 0xbc, 0x3a, 0x7d, + 0x3e, 0x3e, 0x53, 0xff, 0x21, 0x0f, 0x8f, 0xe6, 0xaa, 0x30, 0x29, 0xf6, 0x58, 0x80, 0x94, 0x34, + 0x60, 0x15, 0xfb, 0xb6, 0x4d, 0x11, 0x23, 0x2d, 0x6b, 0x66, 0xb2, 0x24, 0xaf, 0x01, 0xec, 0xb4, + 0xbe, 0x91, 0xbf, 0x41, 0x68, 0xa6, 0x96, 0x7c, 0x05, 0x6b, 0x96, 0x6d, 0xb3, 0x7e, 0x20, 0xa4, + 0x90, 0x52, 0xfb, 0x95, 0x21, 0xaf, 0xcd, 0x58, 0x48, 0xc6, 0xd8, 0x8a, 0x77, 0xbd, 0x0d, 0x04, + 0x1f, 0x99, 0x29, 0x88, 0xf6, 0x09, 0xac, 0x4f, 0xa4, 0x48, 0x15, 0xd4, 0x63, 0x1a, 0xbb, 0x6f, + 0x86, 0x8f, 0xa4, 0x06, 0xf7, 0x06, 0xd6, 0x49, 0x9f, 0x4a, 0xa2, 0xa6, 0x5c, 0x6c, 0xe6, 0x5f, + 0x2b, 0xfa, 0xbf, 0x0a, 0x94, 0x3b, 0xe8, 0xbe, 0x1d, 0x52, 0xbb, 0x2f, 0xe8, 0xfe, 0x70, 0x4a, + 0x98, 0x72, 0x0b, 0x61, 0x6f, 0x60, 0xcd, 0xa7, 0x88, 0x96, 0x4b, 0xe5, 0x05, 0x96, 0xda, 0x7a, + 0x46, 0x58, 0x7a, 0x82, 0xd1, 0x89, 0x8b, 0x62, 0x1d, 0xc9, 0x1e, 0xf2, 0x14, 0x36, 0x7c, 0xcb, + 0xb6, 0x38, 0x63, 0xc1, 0xa1, 0x60, 0xc7, 0x34, 0x68, 0xa8, 0x11, 0xdb, 0xf5, 0x24, 0xba, 0x1f, + 0x06, 0x43, 0xb9, 0x13, 0x08, 0x37, 0xc9, 0x2d, 0x67, 0xe4, 0x6e, 0x56, 0xc2, 0x16, 0xc8, 0x90, + 0xd6, 0xbf, 0x80, 0x5a, 0x96, 0xdc, 0x12, 0x37, 0x5f, 0x87, 0x55, 0x31, 0x3c, 0xec, 0x5a, 0xd8, + 0x8d, 0xdd, 0x2c, 0x88, 0xe1, 0x8e, 0x85, 0x5d, 0xfd, 0xb7, 0x3c, 0xbc, 0xd3, 0x41, 0x77, 0x4b, + 0xf6, 0xd7, 0x77, 0x74, 0x8f, 0xf2, 0x81, 0x67, 0xd3, 0x3b, 0x38, 0xfa, 0x1e, 0x14, 0x18, 0xf7, + 0x5c, 0x2f, 0x48, 0x4e, 0x92, 0x2b, 0xf2, 0x25, 0x94, 0x7a, 0x94, 0xfb, 0x1e, 0x62, 0xd4, 0xec, + 0xb2, 0x8b, 0x5e, 0x64, 0xcc, 0x9e, 0xe6, 0x60, 0xec, 0x8e, 0xcb, 0xa5, 0xed, 0x59, 0x80, 0xd0, + 0x2f, 0x69, 0xf8, 0x8a, 0x6c, 0x8f, 0x68, 0xa1, 0xbd, 0x81, 0xea, 0xf4, 0xb6, 0xdb, 0xb4, 0xd6, + 0xac, 0xd7, 0x1d, 0x78, 0x30, 0x87, 0xdb, 0x12, 0x96, 0xa7, 0xfc, 0xf2, 0x19, 0x7e, 0xfa, 0x4f, + 0x0a, 0x90, 0xcc, 0x1b, 0x73, 0x77, 0xbb, 0x3f, 0x84, 0x55, 0x94, 0x20, 0xd1, 0x41, 0xa5, 0x76, + 0x25, 0xb1, 0x34, 0xa1, 0x9a, 0xe4, 0x67, 0xb5, 0xed, 0x80, 0x36, 0xcb, 0x65, 0x09, 0x69, 0x55, + 0x50, 0x1d, 0xcf, 0x89, 0x85, 0x85, 0x8f, 0xfa, 0xaf, 0x0a, 0x54, 0x3a, 0xe8, 0x7e, 0xd3, 0x73, + 0x2c, 0x41, 0x77, 0x2d, 0x6e, 0xf9, 0xf8, 0xbf, 0xa7, 0xea, 0x0b, 0x28, 0xf4, 0x22, 0x84, 0x58, + 0xd0, 0x46, 0x22, 0x48, 0xe2, 0x6e, 0xaf, 0x9c, 0xfd, 0xfd, 0x38, 0x67, 0xc6, 0x35, 0x63, 0x9b, + 0xd5, 0x8c, 0xcd, 0x33, 0x53, 0xf3, 0x3e, 0xd4, 0xa7, 0xe8, 0x25, 0x32, 0xdb, 0xbf, 0xa8, 0xa0, + 0x76, 0xd0, 0x25, 0xfb, 0x50, 0x9d, 0x79, 0x0b, 0x1e, 0x2c, 0x68, 0x4f, 0xed, 0xfd, 0x05, 0xc9, + 0xd4, 0xc4, 0xcf, 0xa0, 0x38, 0x1e, 0x53, 0xb5, 0x79, 0xa3, 0x45, 0x7b, 0x38, 0x2f, 0x9a, 0x02, + 0x1c, 0x00, 0x99, 0xf3, 0xc5, 0x7a, 0xb4, 0x70, 0xfa, 0x6a, 0x4f, 0x97, 0x1a, 0xce, 0xe4, 0x6b, + 0xa8, 0x4c, 0x37, 0xa2, 0x36, 0x67, 0x67, 0x22, 0x58, 0xbf, 0x3e, 0x97, 0x42, 0xee, 0x40, 0x79, + 0xa2, 0x09, 0xea, 0x99, 0x3d, 0xd9, 0x84, 0xf6, 0xf8, 0x9a, 0x44, 0x82, 0xa4, 0xdd, 0xfb, 0xfe, + 0xea, 0xf4, 0xb9, 0xb2, 0xfd, 0xe9, 0xd9, 0x45, 0x53, 0x39, 0xbf, 0x68, 0x2a, 0xff, 0x5c, 0x34, + 0x95, 0x9f, 0x2f, 0x9b, 0xb9, 0xf3, 0xcb, 0x66, 0xee, 0xaf, 0xcb, 0x66, 0xee, 0x40, 0x77, 0x3d, + 0xd1, 0xed, 0x1f, 0x19, 0x36, 0xf3, 0x5b, 0x2c, 0x40, 0x16, 0xf0, 0x56, 0xf4, 0x33, 0x6c, 0x85, + 0x7f, 0x0a, 0xc4, 0xa8, 0x47, 0xf1, 0xa8, 0x10, 0x7d, 0xfa, 0x5f, 0xfd, 0x17, 0x00, 0x00, 0xff, + 0xff, 0x70, 0x88, 0x77, 0x6a, 0x75, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -855,16 +714,17 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. - // this operation is called by services initiating a controller registration. - AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) - // AuthorizeService asserts the given controller is the owner of the given address. + // AuthorizeService asserts the given controller is the owner of the given + // address. AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) - // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages Macaroon for verification. + // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages + // Macaroon for verification. ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, 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) - // 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. RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error) // UpdateParams defines a governance operation for updating the parameters. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) @@ -878,15 +738,6 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) { - out := new(MsgAllocateVaultResponse) - err := c.cc.Invoke(ctx, "/did.v1.Msg/AllocateVault", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) { out := new(MsgAuthorizeServiceResponse) err := c.cc.Invoke(ctx, "/did.v1.Msg/AuthorizeService", in, out, opts...) @@ -934,16 +785,17 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. type MsgServer interface { - // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. - // this operation is called by services initiating a controller registration. - AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) - // AuthorizeService asserts the given controller is the owner of the given address. + // AuthorizeService asserts the given controller is the owner of the given + // address. AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) - // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages Macaroon for verification. + // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages + // Macaroon for verification. ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, 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) - // 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. RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error) // UpdateParams defines a governance operation for updating the parameters. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) @@ -953,9 +805,6 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) AllocateVault(ctx context.Context, req *MsgAllocateVault) (*MsgAllocateVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented") -} func (*UnimplementedMsgServer) AuthorizeService(ctx context.Context, req *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") } @@ -976,24 +825,6 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAllocateVault) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).AllocateVault(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/did.v1.Msg/AllocateVault", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgAuthorizeService) if err := dec(in); err != nil { @@ -1088,10 +919,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "did.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "AllocateVault", - Handler: _Msg_AllocateVault_Handler, - }, { MethodName: "AuthorizeService", Handler: _Msg_AuthorizeService_Handler, @@ -1117,102 +944,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "did/v1/tx.proto", } -func (m *MsgAllocateVault) 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 *MsgAllocateVault) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAllocateVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintTx(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 0x1a - } - if len(m.Subject) > 0 { - i -= len(m.Subject) - copy(dAtA[i:], m.Subject) - i = encodeVarintTx(dAtA, i, uint64(len(m.Subject))) - i-- - dAtA[i] = 0x12 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgAllocateVaultResponse) 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 *MsgAllocateVaultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAllocateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Localhost { - i-- - if m.Localhost { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0x1a - } - if m.ExpiryBlock != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ExpiryBlock)) - i-- - dAtA[i] = 0x10 - } - if len(m.Cid) > 0 { - i -= len(m.Cid) - copy(dAtA[i:], m.Cid) - i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *MsgRegisterController) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1693,50 +1424,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgAllocateVault) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Subject) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Origin) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgAllocateVaultResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Cid) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.ExpiryBlock != 0 { - n += 1 + sovTx(uint64(m.ExpiryBlock)) - } - l = len(m.Token) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Localhost { - n += 2 - } - return n -} - func (m *MsgRegisterController) Size() (n int) { if m == nil { return 0 @@ -1949,305 +1636,6 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgAllocateVault) 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 ErrIntOverflowTx - } - 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: MsgAllocateVault: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAllocateVault: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subject = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgAllocateVaultResponse) 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 ErrIntOverflowTx - } - 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: MsgAllocateVaultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAllocateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiryBlock", wireType) - } - m.ExpiryBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExpiryBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Localhost", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Localhost = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgRegisterController) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/vault/README.md b/x/vault/README.md new file mode 100644 index 000000000..d4ea1153c --- /dev/null +++ b/x/vault/README.md @@ -0,0 +1,15 @@ +# `x/vault` + +The Vault module is responsible for the management of IPFS deployed Decentralized Web Nodes (DWNs) and their associated data. + +## Concepts + +| Concept | Description | Reference | +| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| Decentralized Web Node (DWN) | A decentralized, distributed, and secure network of nodes that store and share data. It is a decentralized alternative to traditional web hosting services. | | +| Decentralized Identifier (DID) | A unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. | | +| HTMX (Hypertext Markup Language eXtensions) | A set of extensions to HTML that allow for the creation of interactive web pages. It is used to enhance the user experience and provide additional functionality to web applications. | | +| IPFS (InterPlanetary File System) | A decentralized, peer-to-peer network for storing and sharing data. It is a distributed file system that allows for the creation and sharing of content across a network of nodes. | | +| WebAuthn (Web Authentication) | A set of APIs that allow websites to request user authentication using biometric or non-biometric factors. | | +| WebAssembly (Web Assembly) | A binary instruction format for a stack-based virtual machine. | | +| Verifiable Credential (VC) | A digital statement that can be cryptographically verified. | | diff --git a/x/vault/autocli.go b/x/vault/autocli.go new file mode 100644 index 000000000..721de0298 --- /dev/null +++ b/x/vault/autocli.go @@ -0,0 +1,31 @@ +package module + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + modulev1 "github.com/onsonr/sonr/api/vault/v1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current consensus parameters", + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: false, // set to true if authority gated + }, + }, + }, + } +} diff --git a/x/vault/client/cli/query.go b/x/vault/client/cli/query.go new file mode 100644 index 000000000..fb2220253 --- /dev/null +++ b/x/vault/client/cli/query.go @@ -0,0 +1,50 @@ +package cli + +import ( + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + + "github.com/onsonr/sonr/x/vault/types" +) + +// !NOTE: Must enable in module.go (disabled in favor of autocli.go) + +func GetQueryCmd() *cobra.Command { + queryCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for " + types.ModuleName, + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + queryCmd.AddCommand( + GetCmdParams(), + ) + return queryCmd +} + +func GetCmdParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "Show all module params", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/vault/client/cli/tx.go b/x/vault/client/cli/tx.go new file mode 100644 index 000000000..6f052facd --- /dev/null +++ b/x/vault/client/cli/tx.go @@ -0,0 +1,71 @@ +package cli + +import ( + "strconv" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + + "github.com/onsonr/sonr/x/vault/types" +) + +// !NOTE: Must enable in module.go (disabled in favor of autocli.go) + +// NewTxCmd returns a root CLI command handler for certain modules +// transaction commands. +func NewTxCmd() *cobra.Command { + txCmd := &cobra.Command{ + Use: types.ModuleName, + Short: types.ModuleName + " subcommands.", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + txCmd.AddCommand( + MsgUpdateParams(), + ) + return txCmd +} + +// Returns a CLI command handler for registering a +// contract for the module. +func MsgUpdateParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-params [some-value]", + Short: "Update the params (must be submitted from the authority)", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + cliCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + senderAddress := cliCtx.GetFromAddress() + + someValue, err := strconv.ParseBool(args[0]) + if err != nil { + return err + } + + msg := &types.MsgUpdateParams{ + Authority: senderAddress.String(), + Params: types.Params{ + IpfsActive: someValue, + }, + } + + if err := msg.Validate(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/internal/dwn/main.go b/x/vault/client/dwn/main.go similarity index 90% rename from internal/dwn/main.go rename to x/vault/client/dwn/main.go index a48a8c059..d44b2ed7f 100644 --- a/internal/dwn/main.go +++ b/x/vault/client/dwn/main.go @@ -14,15 +14,19 @@ import ( "github.com/labstack/echo/v4" promise "github.com/nlepage/go-js-promise" - "github.com/onsonr/sonr/internal/dwn/middleware" - "github.com/onsonr/sonr/internal/dwn/state" - "github.com/onsonr/sonr/pkg/nebula" + "github.com/onsonr/sonr/nebula/pages" + "github.com/onsonr/sonr/x/vault/client/dwn/middleware" + "github.com/onsonr/sonr/x/vault/client/dwn/state" ) func main() { e := echo.New() e.Use(middleware.UseSession) - nebula.RegisterHandlers(e) + e.GET("/home", pages.Home) + e.GET("/login", pages.Login) + e.GET("/register", pages.Register) + e.GET("/profile", pages.Profile) + e.GET("/authorize", pages.Authorize) state.RegisterHandlers(e) Serve(e) } diff --git a/internal/dwn/middleware/headers.go b/x/vault/client/dwn/middleware/headers.go similarity index 100% rename from internal/dwn/middleware/headers.go rename to x/vault/client/dwn/middleware/headers.go diff --git a/internal/dwn/middleware/middleware.go b/x/vault/client/dwn/middleware/middleware.go similarity index 100% rename from internal/dwn/middleware/middleware.go rename to x/vault/client/dwn/middleware/middleware.go diff --git a/internal/dwn/middleware/session.go b/x/vault/client/dwn/middleware/session.go similarity index 100% rename from internal/dwn/middleware/session.go rename to x/vault/client/dwn/middleware/session.go diff --git a/internal/dwn/middleware/token.go b/x/vault/client/dwn/middleware/token.go similarity index 100% rename from internal/dwn/middleware/token.go rename to x/vault/client/dwn/middleware/token.go diff --git a/internal/dwn/state/auth.go b/x/vault/client/dwn/state/auth.go similarity index 100% rename from internal/dwn/state/auth.go rename to x/vault/client/dwn/state/auth.go diff --git a/internal/dwn/state/manifest.go b/x/vault/client/dwn/state/manifest.go similarity index 100% rename from internal/dwn/state/manifest.go rename to x/vault/client/dwn/state/manifest.go diff --git a/internal/dwn/state/openid.go b/x/vault/client/dwn/state/openid.go similarity index 100% rename from internal/dwn/state/openid.go rename to x/vault/client/dwn/state/openid.go diff --git a/internal/dwn/state/routes.go b/x/vault/client/dwn/state/routes.go similarity index 89% rename from internal/dwn/state/routes.go rename to x/vault/client/dwn/state/routes.go index 25e052343..3e0589f35 100644 --- a/internal/dwn/state/routes.go +++ b/x/vault/client/dwn/state/routes.go @@ -2,7 +2,7 @@ package state import ( "github.com/labstack/echo/v4" - middleware "github.com/onsonr/sonr/internal/dwn/middleware" + middleware "github.com/onsonr/sonr/x/vault/client/dwn/middleware" ) func RegisterHandlers(e *echo.Echo) { diff --git a/internal/dwn/state/views.go b/x/vault/client/dwn/state/views.go similarity index 100% rename from internal/dwn/state/views.go rename to x/vault/client/dwn/state/views.go diff --git a/internal/dwn/state/wellknown.go b/x/vault/client/dwn/state/wellknown.go similarity index 100% rename from internal/dwn/state/wellknown.go rename to x/vault/client/dwn/state/wellknown.go diff --git a/x/vault/depinject.go b/x/vault/depinject.go new file mode 100644 index 000000000..5be80d7a0 --- /dev/null +++ b/x/vault/depinject.go @@ -0,0 +1,65 @@ +package module + +import ( + "os" + + "github.com/cosmos/cosmos-sdk/codec" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + + modulev1 "github.com/onsonr/sonr/api/vault/module/v1" + didkeeper "github.com/onsonr/sonr/x/did/keeper" + "github.com/onsonr/sonr/x/vault/keeper" +) + +var _ appmodule.AppModule = AppModule{} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + Cdc codec.Codec + StoreService store.KVStoreService + AddressCodec address.Codec + + DidKeeper didkeeper.Keeper + StakingKeeper stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper +} + +type ModuleOutputs struct { + depinject.Out + + Module appmodule.AppModule + Keeper keeper.Keeper +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.DidKeeper) + m := NewAppModule(in.Cdc, k) + + return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}} +} diff --git a/pkg/vault/app.wasm b/x/vault/internal/app.wasm similarity index 77% rename from pkg/vault/app.wasm rename to x/vault/internal/app.wasm index 4be43299b..97f76e149 100755 Binary files a/pkg/vault/app.wasm and b/x/vault/internal/app.wasm differ diff --git a/pkg/vault/embed.go b/x/vault/internal/embed.go similarity index 100% rename from pkg/vault/embed.go rename to x/vault/internal/embed.go diff --git a/pkg/vault/index.templ b/x/vault/internal/index.templ similarity index 100% rename from pkg/vault/index.templ rename to x/vault/internal/index.templ diff --git a/pkg/vault/index_templ.go b/x/vault/internal/index_templ.go similarity index 100% rename from pkg/vault/index_templ.go rename to x/vault/internal/index_templ.go diff --git a/pkg/vault/motr.mjs b/x/vault/internal/motr.mjs similarity index 100% rename from pkg/vault/motr.mjs rename to x/vault/internal/motr.mjs diff --git a/pkg/vault/sw.js b/x/vault/internal/sw.js similarity index 100% rename from pkg/vault/sw.js rename to x/vault/internal/sw.js diff --git a/x/vault/keeper/assembly.go b/x/vault/keeper/assembly.go new file mode 100644 index 000000000..7ce5a893f --- /dev/null +++ b/x/vault/keeper/assembly.go @@ -0,0 +1,59 @@ +package keeper + +import ( + "context" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onsonr/sonr/config/dwn" + vault "github.com/onsonr/sonr/x/vault/internal" + "github.com/onsonr/sonr/x/vault/types" +) + +// AssembleVault assembles the initial vault +func (k Keeper) AssembleVault(ctx sdk.Context, subject string, origin string) (string, int64, error) { + _, con, err := k.DIDKeeper.NewController(ctx) + if err != nil { + return "", 0, err + } + usrKs, err := con.ExportUserKs() + if err != nil { + return "", 0, err + } + sch, err := k.CurrentSchema(ctx) + if err != nil { + return "", 0, err + } + cnfg := vault.NewConfig(usrKs, con.SonrAddress(), con.ChainID(), sch) + + v, err := types.NewVault(cnfg, "sonr-testnet") + if err != nil { + return "", 0, err + } + cid, err := k.ipfsClient.Unixfs().Add(context.Background(), v.FS) + if err != nil { + return "", 0, err + } + return cid.String(), k.CalculateExpiration(ctx, time.Second*15), nil +} + +// CurrentSchema returns the current schema +func (k Keeper) CurrentSchema(ctx sdk.Context) (*dwn.Schema, error) { + p, err := k.Params.Get(ctx) + if err != nil { + return nil, err + } + schema := p.Schema + return &dwn.Schema{ + Version: int(schema.Version), + Account: schema.Account, + Asset: schema.Asset, + Chain: schema.Chain, + Credential: schema.Credential, + Jwk: schema.Jwk, + Grant: schema.Grant, + Keyshare: schema.Keyshare, + PublicKey: schema.PublicKey, + Profile: schema.Profile, + }, nil +} diff --git a/x/vault/keeper/genesis_test.go b/x/vault/keeper/genesis_test.go new file mode 100644 index 000000000..97ee1dea6 --- /dev/null +++ b/x/vault/keeper/genesis_test.go @@ -0,0 +1,25 @@ +package keeper_test + +import ( + "testing" + + "github.com/onsonr/sonr/x/vault/types" + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + f := SetupTest(t) + + genesisState := &types.GenesisState{ + Params: types.DefaultParams(), + + // this line is used by starport scaffolding # genesis/test/state + } + + f.k.InitGenesis(f.ctx, genesisState) + + got := f.k.ExportGenesis(f.ctx) + require.NotNil(t, got) + + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/vault/keeper/keeper.go b/x/vault/keeper/keeper.go new file mode 100644 index 000000000..0771a06d4 --- /dev/null +++ b/x/vault/keeper/keeper.go @@ -0,0 +1,154 @@ +package keeper + +import ( + "context" + "time" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "cosmossdk.io/collections" + storetypes "cosmossdk.io/core/store" + "cosmossdk.io/log" + "cosmossdk.io/orm/model/ormdb" + + "github.com/ipfs/boxo/path" + "github.com/ipfs/kubo/client/rpc" + apiv1 "github.com/onsonr/sonr/api/vault/v1" + + "github.com/onsonr/sonr/x/vault/types" + + didkeeper "github.com/onsonr/sonr/x/did/keeper" +) + +type Keeper struct { + cdc codec.BinaryCodec + + logger log.Logger + + // state management + Schema collections.Schema + Params collections.Item[types.Params] + OrmDB apiv1.StateStore + + authority string + + ipfsClient *rpc.HttpApi + + DIDKeeper didkeeper.Keeper +} + +// NewKeeper creates a new Keeper instance +func NewKeeper( + cdc codec.BinaryCodec, + storeService storetypes.KVStoreService, + logger log.Logger, + authority string, + didk didkeeper.Keeper, +) Keeper { + logger = logger.With(log.ModuleKey, "x/"+types.ModuleName) + + sb := collections.NewSchemaBuilder(storeService) + + if authority == "" { + authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() + } + + db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService}) + if err != nil { + panic(err) + } + + store, err := apiv1.NewStateStore(db) + if err != nil { + panic(err) + } + + ipfsClient, _ := rpc.NewLocalApi() + k := Keeper{ + cdc: cdc, + logger: logger, + DIDKeeper: didk, + Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + OrmDB: store, + + ipfsClient: ipfsClient, + authority: authority, + } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + + k.Schema = schema + + return k +} + +func (k Keeper) Logger() log.Logger { + return k.logger +} + +// InitGenesis initializes the module's state from a genesis state. +func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error { + // this line is used by starport scaffolding # genesis/module/init + if err := data.Params.Validate(); err != nil { + return err + } + + return k.Params.Set(ctx, data.Params) +} + +// ExportGenesis exports the module's state to a genesis state. +func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { + params, err := k.Params.Get(ctx) + if err != nil { + panic(err) + } + + // this line is used by starport scaffolding # genesis/module/export + + return &types.GenesisState{ + Params: params, + } +} + +// IPFSConnected returns true if the IPFS client is initialized +func (c Keeper) IPFSConnected() bool { + if c.ipfsClient == nil { + ipfsClient, err := rpc.NewLocalApi() + if err != nil { + return false + } + c.ipfsClient = ipfsClient + } + return c.ipfsClient != nil +} + +// CalculateExpiration calculates the expiration time for a vault +func (k Keeper) CalculateExpiration(c sdk.Context, duration time.Duration) int64 { + blockTime := c.BlockTime() + avgBlockTime := float64(blockTime.Sub(blockTime).Seconds()) + return int64(duration.Seconds() / avgBlockTime) +} + +// 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 +} diff --git a/x/vault/keeper/keeper_test.go b/x/vault/keeper/keeper_test.go new file mode 100644 index 000000000..36838e623 --- /dev/null +++ b/x/vault/keeper/keeper_test.go @@ -0,0 +1,144 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "cosmossdk.io/core/store" + + didkeeper "github.com/onsonr/sonr/x/did/keeper" + module "github.com/onsonr/sonr/x/vault" + "github.com/onsonr/sonr/x/vault/keeper" + "github.com/onsonr/sonr/x/vault/types" +) + +var maccPerms = map[string][]string{ + authtypes.FeeCollectorName: nil, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + minttypes.ModuleName: {authtypes.Minter}, + govtypes.ModuleName: {authtypes.Burner}, +} + +type testFixture struct { + suite.Suite + + ctx sdk.Context + k keeper.Keeper + msgServer types.MsgServer + queryServer types.QueryServer + appModule *module.AppModule + + accountkeeper authkeeper.AccountKeeper + bankkeeper bankkeeper.BaseKeeper + stakingKeeper *stakingkeeper.Keeper + mintkeeper mintkeeper.Keeper + didk didkeeper.Keeper + + addrs []sdk.AccAddress + govModAddr string +} + +func SetupTest(t *testing.T) *testFixture { + t.Helper() + f := new(testFixture) + require := require.New(t) + + // Base setup + logger := log.NewTestLogger(t) + encCfg := moduletestutil.MakeTestEncodingConfig() + + f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String() + f.addrs = simtestutil.CreateIncrementalAccounts(3) + + key := storetypes.NewKVStoreKey(types.ModuleName) + storeService := runtime.NewKVStoreService(key) + testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) + + f.ctx = testCtx.Ctx + + // Register SDK modules. + registerBaseSDKModules(f, encCfg, storeService, logger, require) + + // Setup Keeper. + f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr, f.didk) + f.msgServer = keeper.NewMsgServerImpl(f.k) + f.queryServer = keeper.NewQuerier(f.k) + f.appModule = module.NewAppModule(encCfg.Codec, f.k) + + return f +} + +func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) { + authtypes.RegisterInterfaces(encCfg.InterfaceRegistry) + stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry) + + types.RegisterInterfaces(encCfg.InterfaceRegistry) +} + +func registerBaseSDKModules( + f *testFixture, + encCfg moduletestutil.TestEncodingConfig, + storeService store.KVStoreService, + logger log.Logger, + require *require.Assertions, +) { + registerModuleInterfaces(encCfg) + + // Auth Keeper. + f.accountkeeper = authkeeper.NewAccountKeeper( + encCfg.Codec, storeService, + authtypes.ProtoBaseAccount, + maccPerms, + authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, + f.govModAddr, + ) + + // Bank Keeper. + f.bankkeeper = bankkeeper.NewBaseKeeper( + encCfg.Codec, storeService, + f.accountkeeper, + nil, + f.govModAddr, logger, + ) + + // Staking Keeper. + f.stakingKeeper = stakingkeeper.NewKeeper( + encCfg.Codec, storeService, + f.accountkeeper, f.bankkeeper, f.govModAddr, + authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), + authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), + ) + require.NoError(f.stakingKeeper.SetParams(f.ctx, stakingtypes.DefaultParams())) + f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetNotBondedPool(f.ctx)) + f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetBondedPool(f.ctx)) + + // Mint Keeper. + f.mintkeeper = mintkeeper.NewKeeper( + encCfg.Codec, storeService, + f.stakingKeeper, f.accountkeeper, f.bankkeeper, + authtypes.FeeCollectorName, f.govModAddr, + ) + f.accountkeeper.SetModuleAccount(f.ctx, f.accountkeeper.GetModuleAccount(f.ctx, minttypes.ModuleName)) + f.mintkeeper.InitGenesis(f.ctx, f.accountkeeper, minttypes.DefaultGenesisState()) +} diff --git a/x/vault/keeper/orm_test.go b/x/vault/keeper/orm_test.go new file mode 100644 index 000000000..192ef82ac --- /dev/null +++ b/x/vault/keeper/orm_test.go @@ -0,0 +1,31 @@ +package keeper_test + +import ( + "testing" + + apiv1 "github.com/onsonr/sonr/api/vault/v1" + "github.com/stretchr/testify/require" +) + +func TestORM(t *testing.T) { + f := SetupTest(t) + + dt := f.k.OrmDB.DWNTable() + acc := []byte("test_acc") + amt := uint64(7) + + err := dt.Insert(f.ctx, &apiv1.DWN{ + Account: acc, + Amount: amt, + }) + require.NoError(t, err) + + d, err := dt.Has(f.ctx, []byte("test_acc")) + require.NoError(t, err) + require.True(t, d) + + res, err := dt.Get(f.ctx, []byte("test_acc")) + require.NoError(t, err) + require.NotNil(t, res) + require.EqualValues(t, amt, res.Amount) +} diff --git a/x/vault/keeper/querier.go b/x/vault/keeper/querier.go new file mode 100644 index 000000000..329eb59d3 --- /dev/null +++ b/x/vault/keeper/querier.go @@ -0,0 +1,42 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/onsonr/sonr/x/vault/types" +) + +var _ types.QueryServer = Querier{} + +type Querier struct { + Keeper +} + +func NewQuerier(keeper Keeper) Querier { + return Querier{Keeper: keeper} +} + +func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + p, err := k.Keeper.Params.Get(ctx) + if err != nil { + return nil, err + } + + return &types.QueryParamsResponse{Params: &p}, nil +} + +// Sync implements types.QueryServer. +func (k Querier) Sync(goCtx context.Context, req *types.SyncRequest) (*types.SyncResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + return &types.SyncResponse{}, nil +} + +// BuildTx implements types.QueryServer. +func (k Querier) BuildTx(goCtx context.Context, req *types.BuildTxRequest) (*types.BuildTxResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + return &types.BuildTxResponse{}, nil +} diff --git a/x/vault/keeper/server.go b/x/vault/keeper/server.go new file mode 100644 index 000000000..33c159263 --- /dev/null +++ b/x/vault/keeper/server.go @@ -0,0 +1,48 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "cosmossdk.io/errors" + "github.com/onsonr/sonr/x/vault/types" +) + +type msgServer struct { + k Keeper +} + +var _ types.MsgServer = msgServer{} + +// NewMsgServerImpl returns an implementation of the module MsgServer interface. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{k: keeper} +} + +func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if ms.k.authority != msg.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) + } + + return nil, ms.k.Params.Set(ctx, msg.Params) +} + +// AllocateVault implements types.MsgServer. +func (ms msgServer) AllocateVault(goCtx context.Context, msg *types.MsgAllocateVault) (*types.MsgAllocateVaultResponse, error) { + // 1.Check if the service origin is valid + ctx := sdk.UnwrapSDKContext(goCtx) + + // 2.Allocate the vault + cid, expiryBlock, err := ms.k.AssembleVault(ctx, msg.GetSubject(), msg.GetOrigin()) + if err != nil { + return nil, err + } + + // 3.Return the response + return &types.MsgAllocateVaultResponse{ + ExpiryBlock: expiryBlock, + Cid: cid, + }, nil +} diff --git a/x/vault/keeper/server_test.go b/x/vault/keeper/server_test.go new file mode 100644 index 000000000..05afe506f --- /dev/null +++ b/x/vault/keeper/server_test.go @@ -0,0 +1,56 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/onsonr/sonr/x/vault/types" +) + +func TestParams(t *testing.T) { + f := SetupTest(t) + require := require.New(t) + + testCases := []struct { + name string + request *types.MsgUpdateParams + err bool + }{ + { + name: "fail; invalid authority", + request: &types.MsgUpdateParams{ + Authority: f.addrs[0].String(), + Params: types.DefaultParams(), + }, + err: true, + }, + { + name: "success", + request: &types.MsgUpdateParams{ + Authority: f.govModAddr, + Params: types.DefaultParams(), + }, + err: false, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + _, err := f.msgServer.UpdateParams(f.ctx, tc.request) + + if tc.err { + require.Error(err) + } else { + require.NoError(err) + + r, err := f.queryServer.Params(f.ctx, &types.QueryParamsRequest{}) + require.NoError(err) + + require.EqualValues(&tc.request.Params, r.Params) + } + + }) + } +} diff --git a/x/vault/module.go b/x/vault/module.go new file mode 100644 index 000000000..5f63f2846 --- /dev/null +++ b/x/vault/module.go @@ -0,0 +1,152 @@ +package module + +import ( + "context" + "encoding/json" + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + + abci "github.com/cometbft/cometbft/abci/types" + + "cosmossdk.io/client/v2/autocli" + errorsmod "cosmossdk.io/errors" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + didkeeper "github.com/onsonr/sonr/x/did/keeper" + + "github.com/onsonr/sonr/x/vault/keeper" + "github.com/onsonr/sonr/x/vault/types" + // this line is used by starport scaffolding # 1 +) + +const ( + // ConsensusVersion defines the current x/vault module consensus version. + ConsensusVersion = 1 + +// this line is used by starport scaffolding # simapp/module/const +) + +var ( + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleGenesis = AppModule{} + _ module.AppModule = AppModule{} + + _ autocli.HasAutoCLIConfig = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the wasm module. +type AppModuleBasic struct { + cdc codec.Codec +} + +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + didk didkeeper.Keeper +} + +// NewAppModule constructor +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, +) *AppModule { + return &AppModule{ + AppModuleBasic: AppModuleBasic{cdc: cdc}, + keeper: keeper, + } +} + +func (a AppModuleBasic) Name() string { + return types.ModuleName +} + +func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(&types.GenesisState{ + Params: types.DefaultParams(), + }) +} + +func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error { + var data types.GenesisState + err := marshaler.UnmarshalJSON(message, &data) + if err != nil { + return err + } + if err := data.Params.Validate(); err != nil { + return errorsmod.Wrap(err, "params") + } + return nil +} + +func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { +} + +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } +} + +// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods. +/* +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd() +} + +func (a AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} +*/ + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) { + types.RegisterInterfaces(r) +} + +func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + marshaler.MustUnmarshalJSON(message, &genesisState) + + if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil { + panic(err) + } + + return nil +} + +func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { + genState := a.keeper.ExportGenesis(ctx) + return marshaler.MustMarshalJSON(genState) +} + +func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { +} + +func (a AppModule) QuerierRoute() string { + return types.QuerierRoute +} + +func (a AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(a.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(a.keeper)) +} + +// ConsensusVersion is a sequence number for state-breaking change of the +// module. It should be incremented on each consensus-breaking change +// introduced by the module. To avoid wrong/empty versions, the initial version +// should be set to 1. +func (a AppModule) ConsensusVersion() uint64 { + return ConsensusVersion +} diff --git a/x/vault/types/codec.go b/x/vault/types/codec.go new file mode 100644 index 000000000..991711e70 --- /dev/null +++ b/x/vault/types/codec.go @@ -0,0 +1,39 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + // this line is used by starport scaffolding # 1 +) + +var ( + amino = codec.NewLegacyAmino() + AminoCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + sdk.RegisterLegacyAminoCodec(amino) +} + +// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil) + cdc.RegisterConcrete(&MsgAllocateVault{}, ModuleName+"/MsgAllocateVault", nil) +} + +func RegisterInterfaces(registry types.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgUpdateParams{}, + &MsgAllocateVault{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/vault/types/genesis.go b/x/vault/types/genesis.go new file mode 100644 index 000000000..d95f64e07 --- /dev/null +++ b/x/vault/types/genesis.go @@ -0,0 +1,59 @@ +package types + +// this line is used by starport scaffolding # genesis/types/import + +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} + +func (s *Schema) Equal(that *Schema) bool { + if that == nil { + return false + } + if s.Version != that.Version { + return false + } + if s.Account != that.Account { + return false + } + if s.Asset != that.Asset { + return false + } + if s.Chain != that.Chain { + return false + } + if s.Credential != that.Credential { + return false + } + if s.Jwk != that.Jwk { + return false + } + if s.Grant != that.Grant { + return false + } + if s.Keyshare != that.Keyshare { + return false + } + if s.PublicKey != that.PublicKey { + return false + } + if s.Profile != that.Profile { + return false + } + return true +} diff --git a/x/vault/types/genesis.pb.go b/x/vault/types/genesis.pb.go new file mode 100644 index 000000000..47a8c8042 --- /dev/null +++ b/x/vault/types/genesis.pb.go @@ -0,0 +1,1242 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vault/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the module genesis state +type GenesisState struct { + // Params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_4c971b352fb6cc17, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// Params defines the set of module parameters. +type Params struct { + IpfsActive bool `protobuf:"varint,1,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + LocalRegistrationEnabled bool `protobuf:"varint,2,opt,name=local_registration_enabled,json=localRegistrationEnabled,proto3" json:"local_registration_enabled,omitempty"` + Schema *Schema `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_4c971b352fb6cc17, []int{1} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetIpfsActive() bool { + if m != nil { + return m.IpfsActive + } + return false +} + +func (m *Params) GetLocalRegistrationEnabled() bool { + if m != nil { + return m.LocalRegistrationEnabled + } + return false +} + +func (m *Params) GetSchema() *Schema { + if m != nil { + return m.Schema + } + return nil +} + +type Schema struct { + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` + Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` + Chain string `protobuf:"bytes,4,opt,name=chain,proto3" json:"chain,omitempty"` + Credential string `protobuf:"bytes,5,opt,name=credential,proto3" json:"credential,omitempty"` + Jwk string `protobuf:"bytes,6,opt,name=jwk,proto3" json:"jwk,omitempty"` + Grant string `protobuf:"bytes,7,opt,name=grant,proto3" json:"grant,omitempty"` + Keyshare string `protobuf:"bytes,8,opt,name=keyshare,proto3" json:"keyshare,omitempty"` + PublicKey string `protobuf:"bytes,9,opt,name=publicKey,proto3" json:"publicKey,omitempty"` + Profile string `protobuf:"bytes,10,opt,name=profile,proto3" json:"profile,omitempty"` +} + +func (m *Schema) Reset() { *m = Schema{} } +func (m *Schema) String() string { return proto.CompactTextString(m) } +func (*Schema) ProtoMessage() {} +func (*Schema) Descriptor() ([]byte, []int) { + return fileDescriptor_4c971b352fb6cc17, []int{2} +} +func (m *Schema) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Schema.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 *Schema) XXX_Merge(src proto.Message) { + xxx_messageInfo_Schema.Merge(m, src) +} +func (m *Schema) XXX_Size() int { + return m.Size() +} +func (m *Schema) XXX_DiscardUnknown() { + xxx_messageInfo_Schema.DiscardUnknown(m) +} + +var xxx_messageInfo_Schema proto.InternalMessageInfo + +func (m *Schema) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *Schema) GetAccount() string { + if m != nil { + return m.Account + } + return "" +} + +func (m *Schema) GetAsset() string { + if m != nil { + return m.Asset + } + return "" +} + +func (m *Schema) GetChain() string { + if m != nil { + return m.Chain + } + return "" +} + +func (m *Schema) GetCredential() string { + if m != nil { + return m.Credential + } + return "" +} + +func (m *Schema) GetJwk() string { + if m != nil { + return m.Jwk + } + return "" +} + +func (m *Schema) GetGrant() string { + if m != nil { + return m.Grant + } + return "" +} + +func (m *Schema) GetKeyshare() string { + if m != nil { + return m.Keyshare + } + return "" +} + +func (m *Schema) GetPublicKey() string { + if m != nil { + return m.PublicKey + } + return "" +} + +func (m *Schema) GetProfile() string { + if m != nil { + return m.Profile + } + return "" +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "vault.v1.GenesisState") + proto.RegisterType((*Params)(nil), "vault.v1.Params") + proto.RegisterType((*Schema)(nil), "vault.v1.Schema") +} + +func init() { proto.RegisterFile("vault/v1/genesis.proto", fileDescriptor_4c971b352fb6cc17) } + +var fileDescriptor_4c971b352fb6cc17 = []byte{ + // 440 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xb1, 0x6f, 0xd3, 0x40, + 0x14, 0xc6, 0xed, 0xb6, 0x71, 0x93, 0xd7, 0x0e, 0xe5, 0x54, 0xa1, 0x23, 0x42, 0x0e, 0xaa, 0x18, + 0x2a, 0x06, 0x5b, 0x85, 0x0d, 0xa1, 0x4a, 0x54, 0x42, 0x0c, 0x2c, 0xc8, 0xdd, 0x58, 0xa2, 0xcb, + 0xf5, 0xd5, 0x39, 0xea, 0xdc, 0x59, 0x77, 0x17, 0x43, 0x76, 0x26, 0x26, 0x46, 0xc6, 0xfe, 0x01, + 0x0c, 0xfc, 0x19, 0x1d, 0x3b, 0x32, 0x21, 0x94, 0x0c, 0xf0, 0x67, 0x20, 0xbf, 0x73, 0x20, 0xea, + 0x72, 0x7a, 0xdf, 0xef, 0xfb, 0xfc, 0xf4, 0xdd, 0xc9, 0x70, 0xbf, 0x11, 0xf3, 0xca, 0xe7, 0xcd, + 0x49, 0x5e, 0xa2, 0x46, 0xa7, 0x5c, 0x56, 0x5b, 0xe3, 0x0d, 0xeb, 0x13, 0xcf, 0x9a, 0x93, 0xe1, + 0x3d, 0x31, 0x53, 0xda, 0xe4, 0x74, 0x06, 0x73, 0x78, 0x58, 0x9a, 0xd2, 0xd0, 0x98, 0xb7, 0x53, + 0xa0, 0x47, 0xa7, 0xb0, 0xff, 0x3a, 0xec, 0x38, 0xf7, 0xc2, 0x23, 0xcb, 0x20, 0xa9, 0x85, 0x15, + 0x33, 0xc7, 0xe3, 0x47, 0xf1, 0xf1, 0xde, 0xd3, 0x83, 0x6c, 0xbd, 0x33, 0x7b, 0x4b, 0xfc, 0x6c, + 0xe7, 0xe6, 0xe7, 0x28, 0x2a, 0xba, 0xd4, 0xd1, 0xb7, 0x18, 0x92, 0x60, 0xb0, 0x11, 0xec, 0xa9, + 0xfa, 0xd2, 0x8d, 0x85, 0xf4, 0xaa, 0x41, 0xfa, 0xbe, 0x5f, 0x40, 0x8b, 0x5e, 0x12, 0x61, 0x2f, + 0x60, 0x58, 0x19, 0x29, 0xaa, 0xb1, 0xc5, 0x52, 0x39, 0x6f, 0x85, 0x57, 0x46, 0x8f, 0x51, 0x8b, + 0x49, 0x85, 0x17, 0x7c, 0x8b, 0xf2, 0x9c, 0x12, 0xc5, 0x46, 0xe0, 0x55, 0xf0, 0xd9, 0x31, 0x24, + 0x4e, 0x4e, 0x71, 0x26, 0xf8, 0xf6, 0xdd, 0x66, 0xe7, 0xc4, 0x8b, 0xce, 0x7f, 0xfe, 0xe0, 0xeb, + 0xf5, 0x28, 0xfa, 0x73, 0x3d, 0x8a, 0x3f, 0xff, 0xfe, 0xfe, 0x64, 0x3f, 0xbc, 0x55, 0x57, 0xf7, + 0xd3, 0x16, 0x24, 0x21, 0xcd, 0x38, 0xec, 0x36, 0x68, 0x9d, 0x32, 0x9a, 0xaa, 0xf6, 0x8a, 0xb5, + 0x6c, 0x1d, 0x21, 0xa5, 0x99, 0x6b, 0x4f, 0xa5, 0x06, 0xc5, 0x5a, 0xb2, 0x43, 0xe8, 0x09, 0xe7, + 0xd0, 0x53, 0x85, 0x41, 0x11, 0x44, 0x4b, 0xe5, 0x54, 0x28, 0xcd, 0x77, 0x02, 0x25, 0xc1, 0x52, + 0x00, 0x69, 0xf1, 0x02, 0xb5, 0x57, 0xa2, 0xe2, 0x3d, 0xb2, 0x36, 0x08, 0x3b, 0x80, 0xed, 0xf7, + 0x1f, 0xae, 0x78, 0x42, 0x46, 0x3b, 0xb6, 0x7b, 0x4a, 0x2b, 0xb4, 0xe7, 0xbb, 0x61, 0x0f, 0x09, + 0x36, 0x84, 0xfe, 0x15, 0x2e, 0xdc, 0x54, 0x58, 0xe4, 0x7d, 0x32, 0xfe, 0x69, 0xf6, 0x10, 0x06, + 0xf5, 0x7c, 0x52, 0x29, 0xf9, 0x06, 0x17, 0x7c, 0x40, 0xe6, 0x7f, 0xd0, 0xde, 0xa3, 0xb6, 0xe6, + 0x52, 0x55, 0xc8, 0x21, 0xdc, 0xa3, 0x93, 0x67, 0xa7, 0x37, 0xcb, 0x34, 0xbe, 0x5d, 0xa6, 0xf1, + 0xaf, 0x65, 0x1a, 0x7f, 0x59, 0xa5, 0xd1, 0xed, 0x2a, 0x8d, 0x7e, 0xac, 0xd2, 0xe8, 0xdd, 0xe3, + 0x52, 0xf9, 0xe9, 0x7c, 0x92, 0x49, 0x33, 0xcb, 0x8d, 0x76, 0x46, 0xdb, 0x9c, 0x8e, 0x8f, 0x79, + 0x78, 0x47, 0xbf, 0xa8, 0xd1, 0x4d, 0x12, 0xfa, 0x79, 0x9e, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, + 0xed, 0xdc, 0x3c, 0x7d, 0x89, 0x02, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.IpfsActive != that1.IpfsActive { + return false + } + if this.LocalRegistrationEnabled != that1.LocalRegistrationEnabled { + return false + } + if !this.Schema.Equal(that1.Schema) { + return false + } + return true +} +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Schema != nil { + { + size, err := m.Schema.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.LocalRegistrationEnabled { + i-- + if m.LocalRegistrationEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.IpfsActive { + i-- + if m.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Schema) 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 *Schema) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Schema) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Profile) > 0 { + i -= len(m.Profile) + copy(dAtA[i:], m.Profile) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Profile))) + i-- + dAtA[i] = 0x52 + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x4a + } + if len(m.Keyshare) > 0 { + i -= len(m.Keyshare) + copy(dAtA[i:], m.Keyshare) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Keyshare))) + i-- + dAtA[i] = 0x42 + } + if len(m.Grant) > 0 { + i -= len(m.Grant) + copy(dAtA[i:], m.Grant) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Grant))) + i-- + dAtA[i] = 0x3a + } + if len(m.Jwk) > 0 { + i -= len(m.Jwk) + copy(dAtA[i:], m.Jwk) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Jwk))) + i-- + dAtA[i] = 0x32 + } + if len(m.Credential) > 0 { + i -= len(m.Credential) + copy(dAtA[i:], m.Credential) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Credential))) + i-- + dAtA[i] = 0x2a + } + if len(m.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Chain))) + i-- + dAtA[i] = 0x22 + } + if len(m.Asset) > 0 { + i -= len(m.Asset) + copy(dAtA[i:], m.Asset) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Asset))) + i-- + dAtA[i] = 0x1a + } + if len(m.Account) > 0 { + i -= len(m.Account) + copy(dAtA[i:], m.Account) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Account))) + i-- + dAtA[i] = 0x12 + } + if m.Version != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IpfsActive { + n += 2 + } + if m.LocalRegistrationEnabled { + n += 2 + } + if m.Schema != nil { + l = m.Schema.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *Schema) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Version != 0 { + n += 1 + sovGenesis(uint64(m.Version)) + } + l = len(m.Account) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Asset) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Chain) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Credential) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Jwk) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Grant) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Keyshare) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Profile) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) 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 ErrIntOverflowGenesis + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IpfsActive = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalRegistrationEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LocalRegistrationEnabled = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Schema == nil { + m.Schema = &Schema{} + } + if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Schema) 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 ErrIntOverflowGenesis + } + 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: Schema: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Schema: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Account = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credential", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Credential = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Jwk = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyshare", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keyshare = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Profile = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/vault/types/genesis_test.go b/x/vault/types/genesis_test.go new file mode 100644 index 000000000..e1f7f7ff8 --- /dev/null +++ b/x/vault/types/genesis_test.go @@ -0,0 +1,42 @@ +package types_test + +import ( + "testing" + + "github.com/onsonr/sonr/x/vault/types" + + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + tests := []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/vault/types/keys.go b/x/vault/types/keys.go new file mode 100644 index 000000000..075c9510f --- /dev/null +++ b/x/vault/types/keys.go @@ -0,0 +1,27 @@ +package types + +import ( + "cosmossdk.io/collections" + + ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" +) + +var ( + // ParamsKey saves the current module params. + ParamsKey = collections.NewPrefix(0) +) + +const ( + ModuleName = "vault" + + StoreKey = ModuleName + + QuerierRoute = ModuleName +) + +var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{ + SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ + {Id: 1, ProtoFileName: "vault/v1/state.proto"}, + }, + Prefix: []byte{0}, +} diff --git a/x/vault/types/msgs.go b/x/vault/types/msgs.go new file mode 100644 index 000000000..092984344 --- /dev/null +++ b/x/vault/types/msgs.go @@ -0,0 +1,80 @@ +package types + +import ( + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +// NewMsgUpdateParams creates new instance of MsgUpdateParams +func NewMsgUpdateParams( + sender sdk.Address, + someValue bool, +) *MsgUpdateParams { + return &MsgUpdateParams{ + Authority: sender.String(), + Params: Params{ + IpfsActive: someValue, + }, + } +} + +// Route returns the name of the module +func (msg MsgUpdateParams) Route() string { return ModuleName } + +// Type returns the the action +func (msg MsgUpdateParams) Type() string { return "update_params" } + +// GetSignBytes implements the LegacyMsg interface. +func (msg MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (msg *MsgUpdateParams) Validate() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errors.Wrap(err, "invalid authority address") + } + + return msg.Params.Validate() +} + +// +// [AllocateVault] +// + +// NewMsgAllocateVault creates a new instance of MsgAllocateVault +func NewMsgAllocateVault( + sender sdk.Address, +) (*MsgAllocateVault, error) { + return &MsgAllocateVault{}, nil +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (msg *MsgAllocateVault) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +// Route returns the name of the module +func (msg MsgAllocateVault) Route() string { return ModuleName } + +// Type returns the the action +func (msg MsgAllocateVault) Type() string { return "allocate_vault" } + +// GetSignBytes implements the LegacyMsg interface. +func (msg MsgAllocateVault) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +// Vaalidate does a sanity check on the provided data. +func (msg *MsgAllocateVault) Validate() error { + return nil +} diff --git a/x/vault/types/params.go b/x/vault/types/params.go new file mode 100644 index 000000000..482089089 --- /dev/null +++ b/x/vault/types/params.go @@ -0,0 +1,46 @@ +package types + +import ( + "encoding/json" +) + +// DefaultParams returns default module parameters. +func DefaultParams() Params { + // TODO: + return Params{ + IpfsActive: true, + Schema: DefaultSchema(), + } +} + +// Stringer method for Params. +func (p Params) String() string { + bz, err := json.Marshal(p) + if err != nil { + panic(err) + } + + return string(bz) +} + +// Validate does the sanity check on the params. +func (p Params) Validate() error { + // TODO: + return nil +} + +// DefaultSchema returns the default schema +func DefaultSchema() *Schema { + return &Schema{ + Version: 1, + Account: "++, id, name, address, publicKey, chainCode, index, controller, createdAt", + Asset: "++, id, name, symbol, decimals, chainCode, createdAt", + Chain: "++, id, name, networkId, chainCode, createdAt", + Credential: "++, id, subject, controller, attestationType, origin, label, deviceId, credentialId, publicKey, transport, signCount, userPresent, userVerified, backupEligible, backupState, cloneWarning, createdAt, updatedAt", + Jwk: "++, kty, crv, x, y, n, e", + Grant: "++, subject, controller, origin, token, scopes, createdAt, updatedAt", + Keyshare: "++, id, data, role, createdAt, lastRefreshed", + PublicKey: "++, role, algorithm, encoding, curve, key_type, raw, jwk", + Profile: "++, id, subject, controller, originUri, publicMetadata, privateMetadata, createdAt, updatedAt", + } +} diff --git a/x/vault/types/query.pb.go b/x/vault/types/query.pb.go new file mode 100644 index 000000000..fec7bfb75 --- /dev/null +++ b/x/vault/types/query.pb.go @@ -0,0 +1,1676 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vault/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e6d49a2800ab3e4b, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params defines the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e6d49a2800ab3e4b, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +// QueryIPFSRequest is the request type for the Query/IPFS RPC method. +type QueryIPFSRequest struct { +} + +func (m *QueryIPFSRequest) Reset() { *m = QueryIPFSRequest{} } +func (m *QueryIPFSRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIPFSRequest) ProtoMessage() {} +func (*QueryIPFSRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e6d49a2800ab3e4b, []int{2} +} +func (m *QueryIPFSRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIPFSRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIPFSRequest.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 *QueryIPFSRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIPFSRequest.Merge(m, src) +} +func (m *QueryIPFSRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIPFSRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIPFSRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIPFSRequest proto.InternalMessageInfo + +// QueryIPFSResponse is the response type for the Query/IPFS RPC method. +type QueryIPFSResponse struct { + // IPFS is the IPFS client status. + Ipfs bool `protobuf:"varint,1,opt,name=ipfs,proto3" json:"ipfs,omitempty"` +} + +func (m *QueryIPFSResponse) Reset() { *m = QueryIPFSResponse{} } +func (m *QueryIPFSResponse) String() string { return proto.CompactTextString(m) } +func (*QueryIPFSResponse) ProtoMessage() {} +func (*QueryIPFSResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e6d49a2800ab3e4b, []int{3} +} +func (m *QueryIPFSResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIPFSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIPFSResponse.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 *QueryIPFSResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIPFSResponse.Merge(m, src) +} +func (m *QueryIPFSResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIPFSResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIPFSResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIPFSResponse proto.InternalMessageInfo + +func (m *QueryIPFSResponse) GetIpfs() bool { + if m != nil { + return m.Ipfs + } + return false +} + +// SyncRequest is the request type for the Sync RPC method. +type SyncRequest struct { + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` +} + +func (m *SyncRequest) Reset() { *m = SyncRequest{} } +func (m *SyncRequest) String() string { return proto.CompactTextString(m) } +func (*SyncRequest) ProtoMessage() {} +func (*SyncRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e6d49a2800ab3e4b, []int{4} +} +func (m *SyncRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SyncRequest.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 *SyncRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SyncRequest.Merge(m, src) +} +func (m *SyncRequest) XXX_Size() int { + return m.Size() +} +func (m *SyncRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SyncRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SyncRequest proto.InternalMessageInfo + +func (m *SyncRequest) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + +// SyncResponse is the response type for the Sync RPC method. +type SyncResponse struct { + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (m *SyncResponse) Reset() { *m = SyncResponse{} } +func (m *SyncResponse) String() string { return proto.CompactTextString(m) } +func (*SyncResponse) ProtoMessage() {} +func (*SyncResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e6d49a2800ab3e4b, []int{5} +} +func (m *SyncResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SyncResponse.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 *SyncResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SyncResponse.Merge(m, src) +} +func (m *SyncResponse) XXX_Size() int { + return m.Size() +} +func (m *SyncResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SyncResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SyncResponse proto.InternalMessageInfo + +func (m *SyncResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +// BuildTxRequest is the request type for the BuildTx RPC method. +type BuildTxRequest struct { + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Pkl string `protobuf:"bytes,2,opt,name=pkl,proto3" json:"pkl,omitempty"` +} + +func (m *BuildTxRequest) Reset() { *m = BuildTxRequest{} } +func (m *BuildTxRequest) String() string { return proto.CompactTextString(m) } +func (*BuildTxRequest) ProtoMessage() {} +func (*BuildTxRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e6d49a2800ab3e4b, []int{6} +} +func (m *BuildTxRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BuildTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BuildTxRequest.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 *BuildTxRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BuildTxRequest.Merge(m, src) +} +func (m *BuildTxRequest) XXX_Size() int { + return m.Size() +} +func (m *BuildTxRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BuildTxRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BuildTxRequest proto.InternalMessageInfo + +func (m *BuildTxRequest) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + +func (m *BuildTxRequest) GetPkl() string { + if m != nil { + return m.Pkl + } + return "" +} + +// BuildTxResponse is the response type for the BuildTx RPC method. +type BuildTxResponse struct { + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Tx string `protobuf:"bytes,2,opt,name=tx,proto3" json:"tx,omitempty"` +} + +func (m *BuildTxResponse) Reset() { *m = BuildTxResponse{} } +func (m *BuildTxResponse) String() string { return proto.CompactTextString(m) } +func (*BuildTxResponse) ProtoMessage() {} +func (*BuildTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e6d49a2800ab3e4b, []int{7} +} +func (m *BuildTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BuildTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BuildTxResponse.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 *BuildTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BuildTxResponse.Merge(m, src) +} +func (m *BuildTxResponse) XXX_Size() int { + return m.Size() +} +func (m *BuildTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BuildTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BuildTxResponse proto.InternalMessageInfo + +func (m *BuildTxResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *BuildTxResponse) GetTx() string { + if m != nil { + return m.Tx + } + return "" +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "vault.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "vault.v1.QueryParamsResponse") + proto.RegisterType((*QueryIPFSRequest)(nil), "vault.v1.QueryIPFSRequest") + proto.RegisterType((*QueryIPFSResponse)(nil), "vault.v1.QueryIPFSResponse") + proto.RegisterType((*SyncRequest)(nil), "vault.v1.SyncRequest") + proto.RegisterType((*SyncResponse)(nil), "vault.v1.SyncResponse") + proto.RegisterType((*BuildTxRequest)(nil), "vault.v1.BuildTxRequest") + proto.RegisterType((*BuildTxResponse)(nil), "vault.v1.BuildTxResponse") +} + +func init() { proto.RegisterFile("vault/v1/query.proto", fileDescriptor_e6d49a2800ab3e4b) } + +var fileDescriptor_e6d49a2800ab3e4b = []byte{ + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x8b, 0xd3, 0x40, + 0x1c, 0xc5, 0x9b, 0xb8, 0x76, 0xd7, 0xff, 0x4a, 0xcd, 0xce, 0xae, 0x25, 0x1b, 0xd6, 0x28, 0x83, + 0x60, 0x4f, 0x09, 0x5b, 0xbd, 0x09, 0x0a, 0x3d, 0x08, 0x1e, 0x84, 0xda, 0x7a, 0xd1, 0x8b, 0xa4, + 0xe9, 0x18, 0x43, 0xd3, 0x99, 0x69, 0x66, 0x52, 0x92, 0xab, 0x9f, 0x40, 0xf4, 0x4b, 0x79, 0x2c, + 0x78, 0xf1, 0x28, 0xad, 0x1f, 0x44, 0x32, 0x99, 0x34, 0xad, 0x5a, 0xbc, 0x84, 0xc9, 0x9b, 0xf7, + 0x7e, 0xff, 0xcc, 0x9b, 0xc0, 0xc5, 0x32, 0xc8, 0x12, 0xe9, 0x2f, 0xaf, 0xfd, 0x45, 0x46, 0xd2, + 0xc2, 0xe3, 0x29, 0x93, 0x0c, 0x9d, 0x28, 0xd5, 0x5b, 0x5e, 0x3b, 0x57, 0x11, 0x63, 0x51, 0x42, + 0xfc, 0x80, 0xc7, 0x7e, 0x40, 0x29, 0x93, 0x81, 0x8c, 0x19, 0x15, 0x95, 0xcf, 0xe9, 0x6e, 0xd3, + 0x11, 0xa1, 0x44, 0xc4, 0x5a, 0xc7, 0x17, 0x80, 0x5e, 0x97, 0xb8, 0x61, 0x90, 0x06, 0x73, 0x31, + 0x22, 0x8b, 0x8c, 0x08, 0x89, 0x9f, 0xc3, 0xf9, 0x9e, 0x2a, 0x38, 0xa3, 0x82, 0xa0, 0x1e, 0xb4, + 0xb9, 0x52, 0x6c, 0xe3, 0x81, 0xd1, 0x3b, 0xed, 0x5b, 0x5e, 0x3d, 0xdd, 0xd3, 0x4e, 0xbd, 0x8f, + 0x11, 0x58, 0x0a, 0xf0, 0x72, 0xf8, 0x62, 0x5c, 0x43, 0x1f, 0xc1, 0xd9, 0x8e, 0xa6, 0x91, 0x08, + 0x8e, 0x62, 0xfe, 0xa1, 0x02, 0x9e, 0x8c, 0xd4, 0x1a, 0xdf, 0x87, 0xd3, 0x71, 0x41, 0x43, 0x9d, + 0x43, 0x16, 0xdc, 0x98, 0xc6, 0x53, 0xe5, 0xb8, 0x35, 0x2a, 0x97, 0xb8, 0x07, 0xb7, 0x2b, 0x83, + 0x86, 0xd8, 0x70, 0x2c, 0xb2, 0x30, 0x24, 0xa2, 0xe6, 0xd4, 0xaf, 0xf8, 0x09, 0x74, 0x06, 0x59, + 0x9c, 0x4c, 0xdf, 0xe4, 0x07, 0x69, 0xa5, 0xc2, 0x67, 0x89, 0x6d, 0x56, 0x0a, 0x9f, 0x25, 0xf8, + 0x29, 0xdc, 0xd9, 0xa6, 0xfe, 0x37, 0x02, 0x75, 0xc0, 0x94, 0xb9, 0x4e, 0x9b, 0x32, 0xef, 0x7f, + 0x31, 0xe1, 0xa6, 0x3a, 0x27, 0x7a, 0x0f, 0xed, 0xaa, 0x16, 0x74, 0xd5, 0x14, 0xf5, 0x77, 0xdb, + 0xce, 0xbd, 0x03, 0xbb, 0xd5, 0x68, 0x6c, 0x7f, 0xfa, 0xfe, 0xeb, 0xab, 0x89, 0x90, 0xe5, 0x6f, + 0xef, 0xb0, 0x6a, 0x19, 0xbd, 0x85, 0x63, 0xfd, 0x9d, 0xc8, 0x6e, 0x18, 0xfb, 0x07, 0x76, 0x2e, + 0xff, 0xb1, 0xa3, 0xc9, 0x97, 0x8a, 0x7c, 0x8e, 0xcf, 0x1a, 0xf2, 0xa4, 0xb4, 0xc8, 0x1c, 0xbd, + 0x82, 0xa3, 0xb2, 0x62, 0x74, 0xb7, 0x49, 0xef, 0xdc, 0x89, 0xd3, 0xfd, 0x53, 0xd6, 0xc4, 0xae, + 0x22, 0x5a, 0xb8, 0xd3, 0x10, 0x45, 0x41, 0xc3, 0xc1, 0xb3, 0x6f, 0x6b, 0xd7, 0x58, 0xad, 0x5d, + 0xe3, 0xe7, 0xda, 0x35, 0x3e, 0x6f, 0xdc, 0xd6, 0x6a, 0xe3, 0xb6, 0x7e, 0x6c, 0xdc, 0xd6, 0xbb, + 0x87, 0x51, 0x2c, 0x3f, 0x66, 0x13, 0x2f, 0x64, 0x73, 0x9f, 0x51, 0xc1, 0x68, 0xea, 0xab, 0x47, + 0xae, 0x09, 0xb2, 0xe0, 0x44, 0x4c, 0xda, 0xea, 0x6f, 0x7d, 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, + 0x76, 0x05, 0xd8, 0x03, 0x05, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Params queries all parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // BuildTx builds an unsigned transaction message for the given PKL. + BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) + // Sync queries the DID document by its id. And returns the required PKL + // information + Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/vault.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) { + out := new(BuildTxResponse) + err := c.cc.Invoke(ctx, "/vault.v1.Query/BuildTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) { + out := new(SyncResponse) + err := c.cc.Invoke(ctx, "/vault.v1.Query/Sync", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries all parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // BuildTx builds an unsigned transaction message for the given PKL. + BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) + // Sync queries the DID document by its id. And returns the required PKL + // information + Sync(context.Context, *SyncRequest) (*SyncResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) BuildTx(ctx context.Context, req *BuildTxRequest) (*BuildTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuildTx not implemented") +} +func (*UnimplementedQueryServer) Sync(ctx context.Context, req *SyncRequest) (*SyncResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vault.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BuildTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BuildTxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BuildTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vault.v1.Query/BuildTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BuildTx(ctx, req.(*BuildTxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Sync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vault.v1.Query/Sync", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Sync(ctx, req.(*SyncRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "vault.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "BuildTx", + Handler: _Query_BuildTx_Handler, + }, + { + MethodName: "Sync", + Handler: _Query_Sync_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "vault/v1/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryIPFSRequest) 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 *QueryIPFSRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIPFSRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryIPFSResponse) 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 *QueryIPFSResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIPFSResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Ipfs { + i-- + if m.Ipfs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncRequest) 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 *SyncRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SyncResponse) 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 *SyncResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Success { + i-- + if m.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BuildTxRequest) 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 *BuildTxRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuildTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pkl) > 0 { + i -= len(m.Pkl) + copy(dAtA[i:], m.Pkl) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Pkl))) + i-- + dAtA[i] = 0x12 + } + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BuildTxResponse) 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 *BuildTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuildTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Tx) > 0 { + i -= len(m.Tx) + copy(dAtA[i:], m.Tx) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Tx))) + i-- + dAtA[i] = 0x12 + } + if m.Success { + i-- + if m.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryIPFSRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryIPFSResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ipfs { + n += 2 + } + return n +} + +func (m *SyncRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Did) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *SyncResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + return n +} + +func (m *BuildTxRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Did) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Pkl) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *BuildTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + l = len(m.Tx) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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 ErrIntOverflowQuery + } + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) 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 ErrIntOverflowQuery + } + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIPFSRequest) 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 ErrIntOverflowQuery + } + 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: QueryIPFSRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIPFSRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIPFSResponse) 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 ErrIntOverflowQuery + } + 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: QueryIPFSResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIPFSResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ipfs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Ipfs = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncRequest) 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 ErrIntOverflowQuery + } + 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: SyncRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncResponse) 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 ErrIntOverflowQuery + } + 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: SyncResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Success = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BuildTxRequest) 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 ErrIntOverflowQuery + } + 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: BuildTxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BuildTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pkl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pkl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BuildTxResponse) 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 ErrIntOverflowQuery + } + 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: BuildTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BuildTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Success = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tx = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/vault/types/query.pb.gw.go b/x/vault/types/query.pb.gw.go new file mode 100644 index 000000000..712b1dbe7 --- /dev/null +++ b/x/vault/types/query.pb.gw.go @@ -0,0 +1,319 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: vault/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_BuildTx_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_BuildTx_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq BuildTxRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuildTx_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BuildTx(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BuildTx_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq BuildTxRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuildTx_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BuildTx(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Sync_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Sync_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SyncRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sync_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Sync(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Sync_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SyncRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sync_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Sync(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Query_BuildTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_BuildTx_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_BuildTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Sync_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Sync_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Query_BuildTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_BuildTx_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_BuildTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Sync_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Sync_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_BuildTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "buildtx"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "sync"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_BuildTx_0 = runtime.ForwardResponseMessage + + forward_Query_Sync_0 = runtime.ForwardResponseMessage +) diff --git a/x/vault/types/state.pb.go b/x/vault/types/state.pb.go new file mode 100644 index 000000000..7440654f9 --- /dev/null +++ b/x/vault/types/state.pb.go @@ -0,0 +1,355 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vault/v1/state.proto + +package types + +import ( + _ "cosmossdk.io/orm" + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type DWN struct { + Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *DWN) Reset() { *m = DWN{} } +func (m *DWN) String() string { return proto.CompactTextString(m) } +func (*DWN) ProtoMessage() {} +func (*DWN) Descriptor() ([]byte, []int) { + return fileDescriptor_2ad3e71ba384142e, []int{0} +} +func (m *DWN) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DWN) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DWN.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 *DWN) XXX_Merge(src proto.Message) { + xxx_messageInfo_DWN.Merge(m, src) +} +func (m *DWN) XXX_Size() int { + return m.Size() +} +func (m *DWN) XXX_DiscardUnknown() { + xxx_messageInfo_DWN.DiscardUnknown(m) +} + +var xxx_messageInfo_DWN proto.InternalMessageInfo + +func (m *DWN) GetAccount() []byte { + if m != nil { + return m.Account + } + return nil +} + +func (m *DWN) GetAmount() uint64 { + if m != nil { + return m.Amount + } + return 0 +} + +func init() { + proto.RegisterType((*DWN)(nil), "vault.v1.DWN") +} + +func init() { proto.RegisterFile("vault/v1/state.proto", fileDescriptor_2ad3e71ba384142e) } + +var fileDescriptor_2ad3e71ba384142e = []byte{ + // 198 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x29, 0x4b, 0x2c, 0xcd, + 0x29, 0xd1, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0xe2, 0x00, 0x8b, 0xea, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, + 0xe7, 0x17, 0xe5, 0x82, 0x14, 0xe5, 0x17, 0xe5, 0x42, 0x94, 0x28, 0x45, 0x70, 0x31, 0xbb, 0x84, + 0xfb, 0x09, 0x49, 0x70, 0xb1, 0x27, 0x26, 0x27, 0xe7, 0x97, 0xe6, 0x95, 0x48, 0x30, 0x2a, 0x30, + 0x6a, 0xf0, 0x04, 0xc1, 0xb8, 0x42, 0x62, 0x5c, 0x6c, 0x89, 0xb9, 0x60, 0x09, 0x26, 0x05, 0x46, + 0x0d, 0x96, 0x20, 0x28, 0xcf, 0x4a, 0xfe, 0xd3, 0xbc, 0xcb, 0x7d, 0xcc, 0x92, 0x5c, 0x9c, 0x70, + 0x9d, 0x42, 0x5c, 0x30, 0xa5, 0x02, 0x8c, 0x12, 0x8c, 0x4e, 0x76, 0x27, 0x1e, 0xc9, 0x31, 0x5e, + 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, + 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x92, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, + 0xab, 0x9f, 0x9f, 0x57, 0x9c, 0x9f, 0x57, 0xa4, 0x0f, 0x26, 0x2a, 0xf4, 0x21, 0xbe, 0x28, 0xa9, + 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x3b, 0xd0, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xab, 0xea, + 0x40, 0xd9, 0xdb, 0x00, 0x00, 0x00, +} + +func (m *DWN) 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 *DWN) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DWN) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Amount != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x10 + } + if len(m.Account) > 0 { + i -= len(m.Account) + copy(dAtA[i:], m.Account) + i = encodeVarintState(dAtA, i, uint64(len(m.Account))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintState(dAtA []byte, offset int, v uint64) int { + offset -= sovState(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DWN) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Account) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.Amount != 0 { + n += 1 + sovState(uint64(m.Amount)) + } + return n +} + +func sovState(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozState(x uint64) (n int) { + return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DWN) 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: DWN: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DWN: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Account = append(m.Account[:0], dAtA[iNdEx:postIndex]...) + if m.Account == nil { + m.Account = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowState + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowState + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowState + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthState + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupState + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthState + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowState = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/vault/types/tx.pb.go b/x/vault/types/tx.pb.go new file mode 100644 index 000000000..314ab7ae5 --- /dev/null +++ b/x/vault/types/tx.pb.go @@ -0,0 +1,1231 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vault/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_311d0123a4881c5c, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_311d0123a4881c5c, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +// MsgAllocateVault is the message type for the AllocateVault RPC. +type MsgAllocateVault struct { + // authority is the address of the service account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // subject is a unique human-defined identifier to associate with the vault. + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + // origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` +} + +func (m *MsgAllocateVault) Reset() { *m = MsgAllocateVault{} } +func (m *MsgAllocateVault) String() string { return proto.CompactTextString(m) } +func (*MsgAllocateVault) ProtoMessage() {} +func (*MsgAllocateVault) Descriptor() ([]byte, []int) { + return fileDescriptor_311d0123a4881c5c, []int{2} +} +func (m *MsgAllocateVault) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllocateVault) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllocateVault.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 *MsgAllocateVault) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllocateVault.Merge(m, src) +} +func (m *MsgAllocateVault) XXX_Size() int { + return m.Size() +} +func (m *MsgAllocateVault) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllocateVault.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllocateVault proto.InternalMessageInfo + +func (m *MsgAllocateVault) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgAllocateVault) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *MsgAllocateVault) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. +type MsgAllocateVaultResponse struct { + // CID is the content identifier of the vault. + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + // ExpiryBlock is the block number at which the vault will expire. + ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` + // RegistrationOptions is a json string of the + // PublicKeyCredentialCreationOptions for WebAuthn + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + // IsLocalhost is a flag to indicate if the vault is localhost + Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"` +} + +func (m *MsgAllocateVaultResponse) Reset() { *m = MsgAllocateVaultResponse{} } +func (m *MsgAllocateVaultResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAllocateVaultResponse) ProtoMessage() {} +func (*MsgAllocateVaultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_311d0123a4881c5c, []int{3} +} +func (m *MsgAllocateVaultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllocateVaultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllocateVaultResponse.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 *MsgAllocateVaultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllocateVaultResponse.Merge(m, src) +} +func (m *MsgAllocateVaultResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAllocateVaultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllocateVaultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllocateVaultResponse proto.InternalMessageInfo + +func (m *MsgAllocateVaultResponse) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *MsgAllocateVaultResponse) GetExpiryBlock() int64 { + if m != nil { + return m.ExpiryBlock + } + return 0 +} + +func (m *MsgAllocateVaultResponse) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *MsgAllocateVaultResponse) GetLocalhost() bool { + if m != nil { + return m.Localhost + } + return false +} + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "vault.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "vault.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgAllocateVault)(nil), "vault.v1.MsgAllocateVault") + proto.RegisterType((*MsgAllocateVaultResponse)(nil), "vault.v1.MsgAllocateVaultResponse") +} + +func init() { proto.RegisterFile("vault/v1/tx.proto", fileDescriptor_311d0123a4881c5c) } + +var fileDescriptor_311d0123a4881c5c = []byte{ + // 460 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0xcf, 0x91, 0x36, 0x34, 0xaf, 0x05, 0xc2, 0x29, 0x6a, 0x1d, 0x0b, 0x99, 0x34, 0x62, 0x88, + 0x2a, 0x61, 0xab, 0x45, 0x62, 0x60, 0x40, 0x6a, 0x66, 0x22, 0x90, 0x11, 0x0c, 0x2c, 0x95, 0xe3, + 0x9c, 0x2e, 0xa6, 0xb6, 0x9f, 0xe5, 0x77, 0x89, 0x92, 0x0d, 0xc1, 0x84, 0xc4, 0xc0, 0xf7, 0x60, + 0xe9, 0xc0, 0x87, 0xe8, 0x58, 0x31, 0x31, 0x21, 0x94, 0x0c, 0xfd, 0x1a, 0xc8, 0x3e, 0xbb, 0x21, + 0x41, 0x59, 0x58, 0x2c, 0xff, 0xfe, 0xdc, 0xfb, 0xfd, 0xee, 0xf4, 0xe0, 0xfe, 0xc4, 0x1b, 0x87, + 0xca, 0x99, 0x1c, 0x3b, 0x6a, 0x6a, 0x27, 0x29, 0x2a, 0xe4, 0x3b, 0x39, 0x65, 0x4f, 0x8e, 0xcd, + 0x03, 0x1f, 0x29, 0x42, 0x72, 0x22, 0x92, 0x99, 0x23, 0x22, 0xa9, 0x2d, 0x66, 0x4b, 0x0b, 0x67, + 0x39, 0x72, 0x34, 0x28, 0xa4, 0xa6, 0x44, 0x89, 0x9a, 0xcf, 0xfe, 0x0a, 0x76, 0xff, 0x26, 0x46, + 0x8a, 0x58, 0x50, 0x50, 0xb8, 0x3b, 0x9f, 0x19, 0xdc, 0xeb, 0x93, 0x7c, 0x93, 0x0c, 0x3d, 0x25, + 0x5e, 0x79, 0xa9, 0x17, 0x11, 0x7f, 0x0a, 0x75, 0x6f, 0xac, 0x46, 0x98, 0x06, 0x6a, 0x66, 0xb0, + 0x36, 0xeb, 0xd6, 0x7b, 0xc6, 0x8f, 0xef, 0x8f, 0x9b, 0x45, 0xcc, 0xe9, 0x70, 0x98, 0x0a, 0xa2, + 0xd7, 0x2a, 0x0d, 0x62, 0xe9, 0x2e, 0xad, 0xdc, 0x86, 0x5a, 0x92, 0x4f, 0x30, 0x6e, 0xb5, 0x59, + 0x77, 0xf7, 0xa4, 0x61, 0x97, 0x17, 0xb1, 0xf5, 0xe4, 0xde, 0xd6, 0xe5, 0xaf, 0x87, 0x15, 0xb7, + 0x70, 0x3d, 0xbb, 0xfb, 0xf1, 0xfa, 0xe2, 0x68, 0x79, 0xbe, 0xd3, 0x82, 0x83, 0xb5, 0x2a, 0xae, + 0xa0, 0x04, 0x63, 0x12, 0x9d, 0x2f, 0x0c, 0x1a, 0x7d, 0x92, 0xa7, 0x61, 0x88, 0xbe, 0xa7, 0xc4, + 0xdb, 0x6c, 0xee, 0x7f, 0xf7, 0x34, 0xe0, 0x36, 0x8d, 0x07, 0xef, 0x85, 0xaf, 0xf2, 0xa2, 0x75, + 0xb7, 0x84, 0x7c, 0x1f, 0x6a, 0x98, 0x06, 0x32, 0x88, 0x8d, 0x6a, 0x2e, 0x14, 0xe8, 0x9f, 0xa6, + 0x9f, 0x18, 0x18, 0xeb, 0x75, 0xca, 0xae, 0xbc, 0x01, 0x55, 0x3f, 0x18, 0xea, 0x42, 0x6e, 0xf6, + 0xcb, 0x0f, 0x61, 0x4f, 0x4c, 0x93, 0x20, 0x9d, 0x9d, 0x0d, 0x42, 0xf4, 0xcf, 0xf3, 0xd4, 0xaa, + 0xbb, 0xab, 0xb9, 0x5e, 0x46, 0xf1, 0x26, 0x6c, 0x2b, 0x3c, 0x17, 0x65, 0xb0, 0x06, 0xfc, 0x01, + 0xd4, 0xb3, 0x84, 0x70, 0x84, 0xa4, 0x8c, 0xad, 0x36, 0xeb, 0xee, 0xb8, 0x4b, 0xe2, 0xe4, 0x1b, + 0x83, 0x6a, 0x9f, 0x24, 0x7f, 0x09, 0x77, 0x56, 0x1f, 0xc6, 0x5c, 0x3e, 0xfc, 0x7a, 0x4b, 0xb3, + 0xb3, 0x59, 0xbb, 0xb9, 0xc1, 0x0b, 0xd8, 0x5b, 0x59, 0x88, 0xd6, 0xca, 0x99, 0xbf, 0x25, 0xf3, + 0x70, 0xa3, 0x54, 0x4e, 0x33, 0xb7, 0x3f, 0x5c, 0x5f, 0x1c, 0xb1, 0xde, 0xf3, 0xcb, 0xb9, 0xc5, + 0xae, 0xe6, 0x16, 0xfb, 0x3d, 0xb7, 0xd8, 0xd7, 0x85, 0x55, 0xb9, 0x5a, 0x58, 0x95, 0x9f, 0x0b, + 0xab, 0xf2, 0xee, 0x91, 0x0c, 0xd4, 0x68, 0x3c, 0xb0, 0x7d, 0x8c, 0x1c, 0x8c, 0x09, 0xe3, 0xd4, + 0xc9, 0x3f, 0x53, 0x47, 0x2f, 0xad, 0x9a, 0x25, 0x82, 0x06, 0xb5, 0x7c, 0x61, 0x9f, 0xfc, 0x09, + 0x00, 0x00, 0xff, 0xff, 0x09, 0xf5, 0x5c, 0x1b, 0x31, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // AllocateVault assembles a sqlite3 database in a local directory and returns + // the CID of the database. this operation is called by services initiating a + // controller registration. + AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) + // UpdateParams defines a governance operation for updating the parameters. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) { + out := new(MsgAllocateVaultResponse) + err := c.cc.Invoke(ctx, "/vault.v1.Msg/AllocateVault", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/vault.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // AllocateVault assembles a sqlite3 database in a local directory and returns + // the CID of the database. this operation is called by services initiating a + // controller registration. + AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) + // UpdateParams defines a governance operation for updating the parameters. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) AllocateVault(ctx context.Context, req *MsgAllocateVault) (*MsgAllocateVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAllocateVault) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AllocateVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vault.v1.Msg/AllocateVault", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vault.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "vault.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AllocateVault", + Handler: _Msg_AllocateVault_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "vault/v1/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgAllocateVault) 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 *MsgAllocateVault) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllocateVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintTx(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintTx(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAllocateVaultResponse) 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 *MsgAllocateVaultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllocateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Localhost { + i-- + if m.Localhost { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x1a + } + if m.ExpiryBlock != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ExpiryBlock)) + i-- + dAtA[i] = 0x10 + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgAllocateVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAllocateVaultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ExpiryBlock != 0 { + n += 1 + sovTx(uint64(m.ExpiryBlock)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Localhost { + n += 2 + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAllocateVault) 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 ErrIntOverflowTx + } + 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: MsgAllocateVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllocateVault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAllocateVaultResponse) 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 ErrIntOverflowTx + } + 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: MsgAllocateVaultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllocateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryBlock", wireType) + } + m.ExpiryBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpiryBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Localhost", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Localhost = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/vault/types/vault.go b/x/vault/types/vault.go new file mode 100644 index 000000000..ded1a50c4 --- /dev/null +++ b/x/vault/types/vault.go @@ -0,0 +1,22 @@ +package types + +import ( + "github.com/ipfs/boxo/files" + + "github.com/onsonr/sonr/config/dwn" + vault "github.com/onsonr/sonr/x/vault/internal" +) + +type Vault struct { + FS files.Node +} + +func NewVault(cnfg *dwn.Config, chainID string) (*Vault, error) { + fileMap, err := vault.NewVaultDirectory(cnfg) + if err != nil { + return nil, err + } + return &Vault{ + FS: fileMap, + }, nil +}