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/Dockerfile b/Dockerfile index 19afcdb8c..69daa6b83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ 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} process-compose.yaml process-compose.yaml RUN devbox run -- echo "Installed Packages." @@ -26,7 +26,7 @@ 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} process-compose.yaml process-compose.yaml COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} . . RUN devbox run -- echo "Installed Packages." diff --git a/Makefile b/Makefile index e08652cd6..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 ./web/build/app.wasm ./web/src/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,15 +312,13 @@ 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" go install github.com/air-verse/air@latest air -c ./deploy/air.toml -ipfs-cluster-start: +ipfs: @echo "(ipfs) Starting ipfs-cluster" ipfs-cluster-service init --consensus crdt ipfs-cluster-service daemon diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index ebf2f237a..06c44bfb3 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -1268,60 +1268,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() { @@ -1329,8 +1327,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") } @@ -1412,18 +1408,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) { @@ -1431,7 +1415,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 } @@ -1455,10 +1439,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": @@ -1483,10 +1463,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": @@ -1519,20 +1495,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() { @@ -1562,15 +1532,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() { @@ -1608,12 +1574,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: @@ -1635,15 +1597,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")) @@ -1745,12 +1703,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)) @@ -1796,7 +1748,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 { @@ -1804,27 +1756,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) { @@ -2105,46 +2037,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) } @@ -2176,7 +2068,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) } @@ -7721,14 +7613,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() { @@ -7765,20 +7653,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 @@ -7968,8 +7842,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() { @@ -8282,7 +8157,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, @@ -8292,116 +8167,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 332fd4912..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, 0x05, 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 f7e93460b..48980c881 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -16,2059 +16,6 @@ import ( sync "sync" ) -var ( - md_MsgUpdateParams protoreflect.MessageDescriptor - fd_MsgUpdateParams_authority protoreflect.FieldDescriptor - fd_MsgUpdateParams_params protoreflect.FieldDescriptor - fd_MsgUpdateParams_token protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_tx_proto_init() - md_MsgUpdateParams = File_did_v1_tx_proto.Messages().ByName("MsgUpdateParams") - fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") - fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") - fd_MsgUpdateParams_token = md_MsgUpdateParams.Fields().ByName("token") -} - -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.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_MsgUpdateParams_params, value) { - return - } - } - if x.Token != "" { - value := protoreflect.ValueOfString(x.Token) - if !f(fd_MsgUpdateParams_token, 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 "did.v1.MsgUpdateParams.authority": - return x.Authority != "" - case "did.v1.MsgUpdateParams.params": - return x.Params != nil - case "did.v1.MsgUpdateParams.token": - return x.Token != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.authority": - x.Authority = "" - case "did.v1.MsgUpdateParams.params": - x.Params = nil - case "did.v1.MsgUpdateParams.token": - x.Token = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "did.v1.MsgUpdateParams.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.MsgUpdateParams.token": - value := x.Token - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.authority": - x.Authority = value.Interface().(string) - case "did.v1.MsgUpdateParams.params": - x.Params = value.Message().Interface().(*Params) - case "did.v1.MsgUpdateParams.token": - x.Token = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "did.v1.MsgUpdateParams.authority": - panic(fmt.Errorf("field authority of message did.v1.MsgUpdateParams is not mutable")) - case "did.v1.MsgUpdateParams.token": - panic(fmt.Errorf("field token of message did.v1.MsgUpdateParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.authority": - return protoreflect.ValueOfString("") - case "did.v1.MsgUpdateParams.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.MsgUpdateParams.token": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message did.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 did.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)) - } - l = len(x.Token) - 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().(*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 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.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 - 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 - 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_did_v1_tx_proto_init() - md_MsgUpdateParamsResponse = File_did_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_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_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: did.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message did.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 did.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_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[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 "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[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 "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 { @@ -2233,7 +180,7 @@ func (x *MsgRegisterController) ProtoReflect() protoreflect.Message { } func (x *MsgRegisterController) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[4] + mi := &file_did_v1_tx_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2967,7 +914,7 @@ func (x *MsgRegisterControllerResponse) ProtoReflect() protoreflect.Message { } func (x *MsgRegisterControllerResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_tx_proto_msgTypes[5] + mi := &file_did_v1_tx_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3639,6 +1586,1270 @@ func (x *fastReflection_MsgRegisterControllerResponse) ProtoMethods() *protoifac } } +var _ protoreflect.Map = (*_MsgExecuteTx_2_map)(nil) + +type _MsgExecuteTx_2_map struct { + m *map[string][]byte +} + +func (x *_MsgExecuteTx_2_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_MsgExecuteTx_2_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfBytes(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_MsgExecuteTx_2_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_MsgExecuteTx_2_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_MsgExecuteTx_2_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfBytes(v) +} + +func (x *_MsgExecuteTx_2_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.Bytes() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_MsgExecuteTx_2_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_MsgExecuteTx_2_map) NewValue() protoreflect.Value { + var v []byte + return protoreflect.ValueOfBytes(v) +} + +func (x *_MsgExecuteTx_2_map) IsValid() bool { + return x.m != nil +} + +var ( + md_MsgExecuteTx protoreflect.MessageDescriptor + fd_MsgExecuteTx_controller protoreflect.FieldDescriptor + fd_MsgExecuteTx_messages protoreflect.FieldDescriptor + fd_MsgExecuteTx_macaroon_token protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgExecuteTx = File_did_v1_tx_proto.Messages().ByName("MsgExecuteTx") + fd_MsgExecuteTx_controller = md_MsgExecuteTx.Fields().ByName("controller") + fd_MsgExecuteTx_messages = md_MsgExecuteTx.Fields().ByName("messages") + fd_MsgExecuteTx_macaroon_token = md_MsgExecuteTx.Fields().ByName("macaroon_token") +} + +var _ protoreflect.Message = (*fastReflection_MsgExecuteTx)(nil) + +type fastReflection_MsgExecuteTx MsgExecuteTx + +func (x *MsgExecuteTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecuteTx)(x) +} + +func (x *MsgExecuteTx) slowProtoReflect() protoreflect.Message { + mi := &file_did_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_MsgExecuteTx_messageType fastReflection_MsgExecuteTx_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecuteTx_messageType{} + +type fastReflection_MsgExecuteTx_messageType struct{} + +func (x fastReflection_MsgExecuteTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecuteTx)(nil) +} +func (x fastReflection_MsgExecuteTx_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecuteTx) +} +func (x fastReflection_MsgExecuteTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgExecuteTx) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteTx +} + +// 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_MsgExecuteTx) Type() protoreflect.MessageType { + return _fastReflection_MsgExecuteTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgExecuteTx) New() protoreflect.Message { + return new(fastReflection_MsgExecuteTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgExecuteTx) Interface() protoreflect.ProtoMessage { + return (*MsgExecuteTx)(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_MsgExecuteTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_MsgExecuteTx_controller, value) { + return + } + } + if len(x.Messages) != 0 { + value := protoreflect.ValueOfMap(&_MsgExecuteTx_2_map{m: &x.Messages}) + if !f(fd_MsgExecuteTx_messages, value) { + return + } + } + if x.MacaroonToken != "" { + value := protoreflect.ValueOfString(x.MacaroonToken) + if !f(fd_MsgExecuteTx_macaroon_token, 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_MsgExecuteTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgExecuteTx.controller": + return x.Controller != "" + case "did.v1.MsgExecuteTx.messages": + return len(x.Messages) != 0 + case "did.v1.MsgExecuteTx.macaroon_token": + return x.MacaroonToken != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTx")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTx 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_MsgExecuteTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgExecuteTx.controller": + x.Controller = "" + case "did.v1.MsgExecuteTx.messages": + x.Messages = nil + case "did.v1.MsgExecuteTx.macaroon_token": + x.MacaroonToken = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTx")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTx 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_MsgExecuteTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgExecuteTx.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.MsgExecuteTx.messages": + if len(x.Messages) == 0 { + return protoreflect.ValueOfMap(&_MsgExecuteTx_2_map{}) + } + mapValue := &_MsgExecuteTx_2_map{m: &x.Messages} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.MsgExecuteTx.macaroon_token": + value := x.MacaroonToken + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTx")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTx 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_MsgExecuteTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgExecuteTx.controller": + x.Controller = value.Interface().(string) + case "did.v1.MsgExecuteTx.messages": + mv := value.Map() + cmv := mv.(*_MsgExecuteTx_2_map) + x.Messages = *cmv.m + case "did.v1.MsgExecuteTx.macaroon_token": + x.MacaroonToken = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTx")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTx 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_MsgExecuteTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgExecuteTx.messages": + if x.Messages == nil { + x.Messages = make(map[string][]byte) + } + value := &_MsgExecuteTx_2_map{m: &x.Messages} + return protoreflect.ValueOfMap(value) + case "did.v1.MsgExecuteTx.controller": + panic(fmt.Errorf("field controller of message did.v1.MsgExecuteTx is not mutable")) + case "did.v1.MsgExecuteTx.macaroon_token": + panic(fmt.Errorf("field macaroon_token of message did.v1.MsgExecuteTx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTx")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTx 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_MsgExecuteTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgExecuteTx.controller": + return protoreflect.ValueOfString("") + case "did.v1.MsgExecuteTx.messages": + m := make(map[string][]byte) + return protoreflect.ValueOfMap(&_MsgExecuteTx_2_map{m: &m}) + case "did.v1.MsgExecuteTx.macaroon_token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTx")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTx 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_MsgExecuteTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgExecuteTx", 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_MsgExecuteTx) 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_MsgExecuteTx) 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_MsgExecuteTx) 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_MsgExecuteTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgExecuteTx) + 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.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Messages) > 0 { + SiZeMaP := func(k string, v []byte) { + l = 1 + len(v) + runtime.Sov(uint64(len(v))) + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Messages)) + for k := range x.Messages { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Messages[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Messages { + SiZeMaP(k, v) + } + } + } + l = len(x.MacaroonToken) + 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().(*MsgExecuteTx) + 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.MacaroonToken) > 0 { + i -= len(x.MacaroonToken) + copy(dAtA[i:], x.MacaroonToken) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MacaroonToken))) + i-- + dAtA[i] = 0x1a + } + if len(x.Messages) > 0 { + MaRsHaLmAp := func(k string, v []byte) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForMessages := make([]string, 0, len(x.Messages)) + for k := range x.Messages { + keysForMessages = append(keysForMessages, string(k)) + } + sort.Slice(keysForMessages, func(i, j int) bool { + return keysForMessages[i] < keysForMessages[j] + }) + for iNdEx := len(keysForMessages) - 1; iNdEx >= 0; iNdEx-- { + v := x.Messages[string(keysForMessages[iNdEx])] + out, err := MaRsHaLmAp(keysForMessages[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Messages { + v := x.Messages[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + 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().(*MsgExecuteTx) + 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: MsgExecuteTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteTx: 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 Controller", 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.Controller = 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 Messages", 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.Messages == nil { + x.Messages = make(map[string][]byte) + } + var mapkey string + var mapvalue []byte + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey 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++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapbyteLen 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++ + mapbyteLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intMapbyteLen := int(mapbyteLen) + if intMapbyteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postbytesIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = make([]byte, mapbyteLen) + copy(mapvalue, dAtA[iNdEx:postbytesIndex]) + iNdEx = postbytesIndex + } else { + iNdEx = entryPreIndex + 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) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.Messages[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MacaroonToken", 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.MacaroonToken = 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_MsgExecuteTxResponse protoreflect.MessageDescriptor + fd_MsgExecuteTxResponse_success protoreflect.FieldDescriptor + fd_MsgExecuteTxResponse_tx_hash protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgExecuteTxResponse = File_did_v1_tx_proto.Messages().ByName("MsgExecuteTxResponse") + fd_MsgExecuteTxResponse_success = md_MsgExecuteTxResponse.Fields().ByName("success") + fd_MsgExecuteTxResponse_tx_hash = md_MsgExecuteTxResponse.Fields().ByName("tx_hash") +} + +var _ protoreflect.Message = (*fastReflection_MsgExecuteTxResponse)(nil) + +type fastReflection_MsgExecuteTxResponse MsgExecuteTxResponse + +func (x *MsgExecuteTxResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecuteTxResponse)(x) +} + +func (x *MsgExecuteTxResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_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_MsgExecuteTxResponse_messageType fastReflection_MsgExecuteTxResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecuteTxResponse_messageType{} + +type fastReflection_MsgExecuteTxResponse_messageType struct{} + +func (x fastReflection_MsgExecuteTxResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecuteTxResponse)(nil) +} +func (x fastReflection_MsgExecuteTxResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecuteTxResponse) +} +func (x fastReflection_MsgExecuteTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteTxResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgExecuteTxResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteTxResponse +} + +// 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_MsgExecuteTxResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgExecuteTxResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgExecuteTxResponse) New() protoreflect.Message { + return new(fastReflection_MsgExecuteTxResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgExecuteTxResponse) Interface() protoreflect.ProtoMessage { + return (*MsgExecuteTxResponse)(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_MsgExecuteTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_MsgExecuteTxResponse_success, value) { + return + } + } + if x.TxHash != "" { + value := protoreflect.ValueOfString(x.TxHash) + if !f(fd_MsgExecuteTxResponse_tx_hash, 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_MsgExecuteTxResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgExecuteTxResponse.success": + return x.Success != false + case "did.v1.MsgExecuteTxResponse.tx_hash": + return x.TxHash != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTxResponse")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTxResponse 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_MsgExecuteTxResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgExecuteTxResponse.success": + x.Success = false + case "did.v1.MsgExecuteTxResponse.tx_hash": + x.TxHash = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTxResponse")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTxResponse 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_MsgExecuteTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgExecuteTxResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + case "did.v1.MsgExecuteTxResponse.tx_hash": + value := x.TxHash + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTxResponse")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTxResponse 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_MsgExecuteTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgExecuteTxResponse.success": + x.Success = value.Bool() + case "did.v1.MsgExecuteTxResponse.tx_hash": + x.TxHash = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTxResponse")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTxResponse 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_MsgExecuteTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgExecuteTxResponse.success": + panic(fmt.Errorf("field success of message did.v1.MsgExecuteTxResponse is not mutable")) + case "did.v1.MsgExecuteTxResponse.tx_hash": + panic(fmt.Errorf("field tx_hash of message did.v1.MsgExecuteTxResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTxResponse")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTxResponse 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_MsgExecuteTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgExecuteTxResponse.success": + return protoreflect.ValueOfBool(false) + case "did.v1.MsgExecuteTxResponse.tx_hash": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgExecuteTxResponse")) + } + panic(fmt.Errorf("message did.v1.MsgExecuteTxResponse 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_MsgExecuteTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgExecuteTxResponse", 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_MsgExecuteTxResponse) 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_MsgExecuteTxResponse) 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_MsgExecuteTxResponse) 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_MsgExecuteTxResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgExecuteTxResponse) + 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.TxHash) + 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().(*MsgExecuteTxResponse) + 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.TxHash) > 0 { + i -= len(x.TxHash) + copy(dAtA[i:], x.TxHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TxHash))) + 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().(*MsgExecuteTxResponse) + 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: MsgExecuteTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteTxResponse: 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 TxHash", 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.TxHash = 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 _ protoreflect.Map = (*_MsgAuthorizeService_3_map)(nil) type _MsgAuthorizeService_3_map struct { @@ -3747,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 { @@ -4513,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 { @@ -4987,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 { @@ -5486,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 { @@ -5938,6 +5149,925 @@ func (x *fastReflection_MsgRegisterServiceResponse) ProtoMethods() *protoiface.M } } +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor + fd_MsgUpdateParams_token protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgUpdateParams = File_did_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") + fd_MsgUpdateParams_token = md_MsgUpdateParams.Fields().ByName("token") +} + +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_did_v1_tx_proto_msgTypes[8] + 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 + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgUpdateParams_token, 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 "did.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "did.v1.MsgUpdateParams.params": + return x.Params != nil + case "did.v1.MsgUpdateParams.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.authority": + x.Authority = "" + case "did.v1.MsgUpdateParams.params": + x.Params = nil + case "did.v1.MsgUpdateParams.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "did.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.MsgUpdateParams.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "did.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + case "did.v1.MsgUpdateParams.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "did.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message did.v1.MsgUpdateParams is not mutable")) + case "did.v1.MsgUpdateParams.token": + panic(fmt.Errorf("field token of message did.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message did.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 "did.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "did.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.MsgUpdateParams.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message did.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 did.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)) + } + l = len(x.Token) + 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().(*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 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.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 + 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 + 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_did_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_did_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_did_v1_tx_proto_msgTypes[9] + 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: did.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message did.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: did.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message did.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 did.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, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -5951,8 +6081,431 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// MsgAllocateVault is the message type for the AllocateVault RPC. -type MsgAllocateVault struct { +// MsgRegisterController is the message type for the InitializeController RPC. +type MsgRegisterController 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"` + // Assertions is the list of assertions to initialize the controller with. + 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 [][]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[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRegisterController) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRegisterController) ProtoMessage() {} + +// Deprecated: Use MsgRegisterController.ProtoReflect.Descriptor instead. +func (*MsgRegisterController) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgRegisterController) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgRegisterController) GetAssertions() [][]byte { + if x != nil { + return x.Assertions + } + return nil +} + +func (x *MsgRegisterController) GetKeyshares() [][]byte { + if x != nil { + return x.Keyshares + } + return nil +} + +func (x *MsgRegisterController) GetVerifications() [][]byte { + if x != nil { + return x.Verifications + } + return nil +} + +// 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 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"` + // Accounts are a Address Map and Supported coin Denoms for the controller + Accounts map[string]string `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *MsgRegisterControllerResponse) Reset() { + *x = MsgRegisterControllerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRegisterControllerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRegisterControllerResponse) ProtoMessage() {} + +// Deprecated: Use MsgRegisterControllerResponse.ProtoReflect.Descriptor instead. +func (*MsgRegisterControllerResponse) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgRegisterControllerResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *MsgRegisterControllerResponse) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *MsgRegisterControllerResponse) GetAccounts() map[string]string { + if x != nil { + return x.Accounts + } + return nil +} + +// MsgExecuteTx is the message type for the ExecuteTx RPC. +type MsgExecuteTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Controller is the address of the controller to authenticate. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // Messages is the list of messages to execute. + Messages map[string][]byte `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // MacaroonToken is the macaroon token to authenticate the operation. + MacaroonToken string `protobuf:"bytes,3,opt,name=macaroon_token,json=macaroonToken,proto3" json:"macaroon_token,omitempty"` +} + +func (x *MsgExecuteTx) Reset() { + *x = MsgExecuteTx{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecuteTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecuteTx) ProtoMessage() {} + +// Deprecated: Use MsgExecuteTx.ProtoReflect.Descriptor instead. +func (*MsgExecuteTx) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgExecuteTx) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *MsgExecuteTx) GetMessages() map[string][]byte { + if x != nil { + return x.Messages + } + return nil +} + +func (x *MsgExecuteTx) GetMacaroonToken() string { + if x != nil { + return x.MacaroonToken + } + return "" +} + +// MsgExecuteTxResponse is the response type for the ExecuteTx RPC. +type MsgExecuteTxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` +} + +func (x *MsgExecuteTxResponse) Reset() { + *x = MsgExecuteTxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecuteTxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecuteTxResponse) ProtoMessage() {} + +// Deprecated: Use MsgExecuteTxResponse.ProtoReflect.Descriptor instead. +func (*MsgExecuteTxResponse) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *MsgExecuteTxResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *MsgExecuteTxResponse) GetTxHash() string { + if x != nil { + return x.TxHash + } + return "" +} + +// MsgAuthorizeService is the message type for the AuthorizeService RPC. +type MsgAuthorizeService struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Controller is the address of the controller to authenticate. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // Origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + // Permissions is the scope of the service. + Permissions map[string]string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *MsgAuthorizeService) Reset() { + *x = MsgAuthorizeService{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAuthorizeService) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAuthorizeService) ProtoMessage() {} + +// Deprecated: Use MsgAuthorizeService.ProtoReflect.Descriptor instead. +func (*MsgAuthorizeService) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgAuthorizeService) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *MsgAuthorizeService) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *MsgAuthorizeService) GetPermissions() map[string]string { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *MsgAuthorizeService) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// MsgAuthorizeServiceResponse is the response type for the AuthorizeService +// RPC. +type MsgAuthorizeServiceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *MsgAuthorizeServiceResponse) Reset() { + *x = MsgAuthorizeServiceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAuthorizeServiceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAuthorizeServiceResponse) ProtoMessage() {} + +// Deprecated: Use MsgAuthorizeServiceResponse.ProtoReflect.Descriptor instead. +func (*MsgAuthorizeServiceResponse) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{5} +} + +func (x *MsgAuthorizeServiceResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *MsgAuthorizeServiceResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// MsgRegisterService is the message type for the RegisterService RPC. +type MsgRegisterService struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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. + 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[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRegisterService) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRegisterService) ProtoMessage() {} + +// Deprecated: Use MsgRegisterService.ProtoReflect.Descriptor instead. +func (*MsgRegisterService) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgRegisterService) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *MsgRegisterService) GetService() *Service { + if x != nil { + return x.Service + } + return nil +} + +// MsgRegisterServiceResponse is the response type for the RegisterService RPC. +type MsgRegisterServiceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` +} + +func (x *MsgRegisterServiceResponse) Reset() { + *x = MsgRegisterServiceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRegisterServiceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRegisterServiceResponse) ProtoMessage() {} + +// Deprecated: Use MsgRegisterServiceResponse.ProtoReflect.Descriptor instead. +func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{7} +} + +func (x *MsgRegisterServiceResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *MsgRegisterServiceResponse) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -5968,7 +6521,7 @@ type MsgAllocateVault struct { func (x *MsgAllocateVault) Reset() { *x = MsgAllocateVault{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[0] + mi := &file_did_v1_tx_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5980,9 +6533,9 @@ func (x *MsgAllocateVault) String() string { func (*MsgAllocateVault) ProtoMessage() {} -// Deprecated: Use MsgAllocateVault.ProtoReflect.Descriptor instead. -func (*MsgAllocateVault) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{0} +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{8} } func (x *MsgAllocateVault) GetAuthority() string { @@ -6027,428 +6580,6 @@ type MsgUpdateParamsResponse struct { 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} -} - -// 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[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_did_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_did_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_did_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 -} - -// MsgRegisterController is the message type for the InitializeController RPC. -type MsgRegisterController 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"` - // Assertions is the list of assertions to initialize the controller with. - 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 [][]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[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRegisterController) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRegisterController) ProtoMessage() {} - -// Deprecated: Use MsgRegisterController.ProtoReflect.Descriptor instead. -func (*MsgRegisterController) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{4} -} - -func (x *MsgRegisterController) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *MsgRegisterController) GetAssertions() [][]byte { - if x != nil { - return x.Assertions - } - return nil -} - -func (x *MsgRegisterController) GetKeyshares() [][]byte { - if x != nil { - return x.Keyshares - } - return nil -} - -func (x *MsgRegisterController) GetVerifications() [][]byte { - if x != nil { - return x.Verifications - } - return nil -} - -// 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 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"` - // Accounts are a Address Map and Supported coin Denoms for the controller - Accounts map[string]string `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *MsgRegisterControllerResponse) Reset() { - *x = MsgRegisterControllerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRegisterControllerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRegisterControllerResponse) ProtoMessage() {} - -// Deprecated: Use MsgRegisterControllerResponse.ProtoReflect.Descriptor instead. -func (*MsgRegisterControllerResponse) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{5} -} - -func (x *MsgRegisterControllerResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *MsgRegisterControllerResponse) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *MsgRegisterControllerResponse) GetAccounts() map[string]string { - if x != nil { - return x.Accounts - } - return nil -} - -// MsgAuthorizeService is the message type for the AuthorizeService RPC. -type MsgAuthorizeService struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Controller is the address of the controller to authenticate. - Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` - // Origin is the origin of the request in wildcard form. - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - // Permissions is the scope of the service. - Permissions map[string]string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // token is the macron token to authenticate the operation. - Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` -} - -func (x *MsgAuthorizeService) Reset() { - *x = MsgAuthorizeService{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgAuthorizeService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgAuthorizeService) ProtoMessage() {} - -// Deprecated: Use MsgAuthorizeService.ProtoReflect.Descriptor instead. -func (*MsgAuthorizeService) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{6} -} - -func (x *MsgAuthorizeService) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *MsgAuthorizeService) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *MsgAuthorizeService) GetPermissions() map[string]string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *MsgAuthorizeService) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -// MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. -type MsgAuthorizeServiceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` -} - -func (x *MsgAuthorizeServiceResponse) Reset() { - *x = MsgAuthorizeServiceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_tx_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgAuthorizeServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgAuthorizeServiceResponse) ProtoMessage() {} - -// Deprecated: Use MsgAuthorizeServiceResponse.ProtoReflect.Descriptor instead. -func (*MsgAuthorizeServiceResponse) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{7} -} - -func (x *MsgAuthorizeServiceResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *MsgAuthorizeServiceResponse) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -// MsgRegisterService is the message type for the RegisterService RPC. -type MsgRegisterService struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 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. - 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] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRegisterService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRegisterService) ProtoMessage() {} - -// Deprecated: Use MsgRegisterService.ProtoReflect.Descriptor instead. -func (*MsgRegisterService) Descriptor() ([]byte, []int) { - return file_did_v1_tx_proto_rawDescGZIP(), []int{8} -} - -func (x *MsgRegisterService) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *MsgRegisterService) GetService() *Service { - if x != nil { - return x.Service - } - return nil -} - -// MsgRegisterServiceResponse is the response type for the RegisterService RPC. -type MsgRegisterServiceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` -} - -func (x *MsgRegisterServiceResponse) Reset() { - *x = MsgRegisterServiceResponse{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_tx_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6456,31 +6587,17 @@ func (x *MsgRegisterServiceResponse) Reset() { } } -func (x *MsgRegisterServiceResponse) String() string { +func (x *MsgAllocateVaultResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgRegisterServiceResponse) ProtoMessage() {} +func (*MsgAllocateVaultResponse) ProtoMessage() {} -// Deprecated: Use MsgRegisterServiceResponse.ProtoReflect.Descriptor instead. -func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_did_v1_tx_proto_rawDescGZIP(), []int{9} } -func (x *MsgRegisterServiceResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *MsgRegisterServiceResponse) GetDid() string { - if x != nil { - return x.Did - } - return "" -} - var File_did_v1_tx_proto protoreflect.FileDescriptor var file_did_v1_tx_proto_rawDesc = []byte{ @@ -6491,36 +6608,7 @@ 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, 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, 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, + 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, @@ -6549,58 +6637,85 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 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, 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, 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, 0x32, 0xa8, 0x03, 0x0a, 0x03, 0x4d, - 0x73, 0x67, 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, 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, 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, + 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, @@ -6611,16 +6726,20 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 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, 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, + 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 ( @@ -6635,43 +6754,45 @@ 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, 12) +var file_did_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_did_v1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: did.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: did.v1.MsgUpdateParamsResponse - (*MsgAllocateVault)(nil), // 2: did.v1.MsgAllocateVault - (*MsgAllocateVaultResponse)(nil), // 3: did.v1.MsgAllocateVaultResponse - (*MsgRegisterController)(nil), // 4: did.v1.MsgRegisterController - (*MsgRegisterControllerResponse)(nil), // 5: did.v1.MsgRegisterControllerResponse - (*MsgAuthorizeService)(nil), // 6: did.v1.MsgAuthorizeService - (*MsgAuthorizeServiceResponse)(nil), // 7: did.v1.MsgAuthorizeServiceResponse - (*MsgRegisterService)(nil), // 8: did.v1.MsgRegisterService - (*MsgRegisterServiceResponse)(nil), // 9: did.v1.MsgRegisterServiceResponse + (*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.MsgAuthorizeService.PermissionsEntry - (*Params)(nil), // 12: did.v1.Params + 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.MsgUpdateParams.params:type_name -> did.v1.Params - 10, // 1: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry - 11, // 2: did.v1.MsgAuthorizeService.permissions:type_name -> did.v1.MsgAuthorizeService.PermissionsEntry + 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 - 0, // 4: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams - 6, // 5: did.v1.Msg.AuthorizeService:input_type -> did.v1.MsgAuthorizeService - 2, // 6: did.v1.Msg.AllocateVault:input_type -> did.v1.MsgAllocateVault - 4, // 7: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController - 8, // 8: did.v1.Msg.RegisterService:input_type -> did.v1.MsgRegisterService - 1, // 9: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse - 7, // 10: did.v1.Msg.AuthorizeService:output_type -> did.v1.MsgAuthorizeServiceResponse - 3, // 11: did.v1.Msg.AllocateVault:output_type -> did.v1.MsgAllocateVaultResponse - 5, // 12: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse - 9, // 13: did.v1.Msg.RegisterService:output_type -> did.v1.MsgRegisterServiceResponse - 9, // [9:14] is the sub-list for method output_type - 4, // [4:9] 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 + 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 } func init() { file_did_v1_tx_proto_init() } @@ -6682,54 +6803,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.(*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[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 - } - } - file_did_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterController); i { case 0: return &v.state @@ -6741,7 +6814,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[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterControllerResponse); i { case 0: return &v.state @@ -6753,7 +6826,31 @@ 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[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgExecuteTx); 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[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgExecuteTxResponse); 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[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgAuthorizeService); i { case 0: return &v.state @@ -6765,7 +6862,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 @@ -6777,7 +6874,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 @@ -6789,7 +6886,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 @@ -6832,7 +6929,7 @@ func file_did_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + 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 8ce8e0729..1bb32f68a 100644 --- a/api/did/v1/tx_grpc.pb.go +++ b/api/did/v1/tx_grpc.pb.go @@ -19,30 +19,31 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams" Msg_AuthorizeService_FullMethodName = "/did.v1.Msg/AuthorizeService" - Msg_AllocateVault_FullMethodName = "/did.v1.Msg/AllocateVault" + Msg_ExecuteTx_FullMethodName = "/did.v1.Msg/ExecuteTx" Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController" Msg_RegisterService_FullMethodName = "/did.v1.Msg/RegisterService" + Msg_UpdateParams_FullMethodName = "/did.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 { - // 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) - // 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) - // 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) - // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. + // 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(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) } type msgClient struct { @@ -53,15 +54,6 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { return &msgClient{cc} } -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 -} - 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...) @@ -71,9 +63,9 @@ func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgAuthorizeServic return out, nil } -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...) +func (c *msgClient) ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, error) { + out := new(MsgExecuteTxResponse) + err := c.cc.Invoke(ctx, Msg_ExecuteTx_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -98,23 +90,33 @@ func (c *msgClient) RegisterService(ctx context.Context, in *MsgRegisterService, 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 { - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, 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) - // 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) - // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. + // 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(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) mustEmbedUnimplementedMsgServer() } @@ -122,14 +124,11 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} func (UnimplementedMsgServer) AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") } -func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented") +func (UnimplementedMsgServer) ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteTx not implemented") } func (UnimplementedMsgServer) RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterController not implemented") @@ -137,6 +136,9 @@ func (UnimplementedMsgServer) RegisterController(context.Context, *MsgRegisterCo func (UnimplementedMsgServer) RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterService 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. @@ -150,24 +152,6 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { s.RegisterService(&Msg_ServiceDesc, srv) } -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) -} - 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 { @@ -186,20 +170,20 @@ func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAllocateVault) +func _Msg_ExecuteTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecuteTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AllocateVault(ctx, in) + return srv.(MsgServer).ExecuteTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_AllocateVault_FullMethodName, + FullMethod: Msg_ExecuteTx_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault)) + return srv.(MsgServer).ExecuteTx(ctx, req.(*MsgExecuteTx)) } return interceptor(ctx, in, info, handler) } @@ -240,6 +224,24 @@ func _Msg_RegisterService_Handler(srv interface{}, ctx context.Context, dec func 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) @@ -247,17 +249,13 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ ServiceName: "did.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, { MethodName: "AuthorizeService", Handler: _Msg_AuthorizeService_Handler, }, { - MethodName: "AllocateVault", - Handler: _Msg_AllocateVault_Handler, + MethodName: "ExecuteTx", + Handler: _Msg_ExecuteTx_Handler, }, { MethodName: "RegisterController", @@ -267,6 +265,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "RegisterService", Handler: _Msg_RegisterService_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "did/v1/tx.proto", 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/ante.go b/app/ante.go index b79eaa7fe..6638869f6 100644 --- a/app/ante.go +++ b/app/ante.go @@ -57,7 +57,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), ante.NewValidateMemoDecorator(options.AccountKeeper), - ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), + // ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), globalfeeante.NewFeeDecorator(options.BypassMinFeeMsgTypes, options.GlobalFeeKeeper, options.StakingKeeper, 2_000_000), // ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators diff --git a/app/app.go b/app/app.go index 45893a3e4..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,6 +1144,8 @@ func GetDefaultBypassFeeMessages() []string { sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenTry{}), sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenConfirm{}), sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenAck{}), + sdk.MsgTypeURL(&vaulttypes.MsgAllocateVault{}), + sdk.MsgTypeURL(&didtypes.MsgRegisterController{}), } } @@ -1426,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/dwn/main.go b/cmd/dwn/main.go deleted file mode 100644 index 51a42fc4c..000000000 --- a/cmd/dwn/main.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package main - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/vfs/wasm" - - "github.com/onsonr/sonr/internal/db" -) - -var dwn *DWN - -type DWN struct { - *echo.Echo - DB *db.DB -} - -func main() { - dwn = initRails() - wasm.Serve(dwn.Echo) -} - -// initRails initializes the Rails application -func initRails() *DWN { - // Open the database - e := echo.New() - db, err := db.New() - if err != nil { - panic(err.Error()) - } - db.ServeEcho(e.Group("/dwn")) - - // Initialize the htmx handler - return &DWN{ - Echo: e, - DB: db, - } -} diff --git a/cmd/motr/main.go b/cmd/motr/main.go deleted file mode 100644 index 8fdf0d6ba..000000000 --- a/cmd/motr/main.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build wasm - -package main - -import ( - "github.com/labstack/echo/v4" - "github.com/syumai/workers" - - "github.com/onsonr/sonr/internal/db" - - "github.com/onsonr/sonr/internal/gui/views" - "github.com/onsonr/sonr/internal/mdw" - "github.com/onsonr/sonr/internal/svc" -) - -func main() { - // Configure the server - e := echo.New() - - // Use Middlewares - e.Use(mdw.UseSession) - - // Setup routes - registerFrontend(e) - registerOpenID(e.Group("/authorize")) - registerVault(e.Group("/vault")) - - // Serve Worker - workers.Serve(e) -} - -func registerFrontend(e *echo.Echo) { - // Add Public Pages - e.GET("/", views.HomeView) - e.GET("/login", views.LoginView) - e.POST("/login/:identifier", svc.HandleCredentialAssertion) - e.GET("/register", views.RegisterView) - e.POST("/register/:subject", svc.HandleCredentialCreation) - e.POST("/register/:subject/check", svc.CheckSubjectIsValid) - e.GET("/profile", views.ProfileView) -} - -func registerOpenID(g *echo.Group) { - // Add Authenticated Pages - g.Use(mdw.MacaroonMiddleware("test", "test")) - g.GET("/", views.AuthorizeView) - g.GET("/discovery", svc.GetDiscovery) - g.GET("/jwks", svc.GetJWKS) - g.GET("/token", svc.GetToken) - g.POST("/:origin/grant/:subject", svc.GrantAuthorization) -} - -func registerVault(g *echo.Group) { - // Add Authenticated Pages - g.Use(mdw.MacaroonMiddleware("test", "test")) - vault, err := db.New(db.WitDir("vault")) - if err != nil { - // panic(err) - } - vault.ServeEcho(g) -} diff --git a/cmd/motr/wrangler.toml b/cmd/motr/wrangler.toml deleted file mode 100644 index 10bce7926..000000000 --- a/cmd/motr/wrangler.toml +++ /dev/null @@ -1,10 +0,0 @@ -name = "sonr-id" -main = "./build/worker.mjs" -compatibility_date = "2024-07-26" - -[dev] -ip = "localhost" -port = 4202 - -[build] -command = "devbox run build:motr" 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/cmd/sonrd/motr.go b/cmd/sonrd/motr.go new file mode 100644 index 000000000..06ab7d0f9 --- /dev/null +++ b/cmd/sonrd/motr.go @@ -0,0 +1 @@ +package main 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/air.toml b/deploy/air.toml deleted file mode 100644 index 1fc4c2ec2..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 ./web/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/deploy/process-compose.dev.yaml b/deploy/process-compose.dev.yaml deleted file mode 100644 index 8338ec468..000000000 --- a/deploy/process-compose.dev.yaml +++ /dev/null @@ -1,25 +0,0 @@ -version: "0.6" - -processes: - sonr: - namespace: testnet - command: "devbox run serve:sonr" - restart: on_failure - max_restarts: 3 - depends: - - caddy: - namespace: testnet - command: "devbox run serve:xcaddy" - restart: on_failure - max_restarts: 3 - depends: - - sonr - - air: - namespace: testnet - command: "devbox run serve:air" - restart: on_failure - max_restarts: 3 - depends: - - sonr diff --git a/deploy/process-compose.yaml b/deploy/process-compose.yaml deleted file mode 100644 index 6fc59f530..000000000 --- a/deploy/process-compose.yaml +++ /dev/null @@ -1,17 +0,0 @@ -version: "0.6" - -processes: - sonr: - namespace: testnet - command: "devbox run serve:sonr" - restart: on_failure - max_restarts: 3 - depends: - - caddy: - namespace: testnet - command: "devbox run serve:xcaddy" - restart: on_failure - max_restarts: 3 - depends: - - sonr diff --git a/devbox.json b/devbox.json index 914f40e5b..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" ], @@ -45,17 +40,17 @@ "serve:air": [ "make air" ], + "serve:ipfs": [ + "make ipfs" + ], "serve:xcaddy": [ "make xcaddy" ], "serve:sonr": [ "make sh-testnet" ], - "local": [ - "process-compose -f ./deploy/process-compose.dev.yaml" - ], - "testnet": [ - "process-compose -f ./deploy/process-compose.yaml" + "serve:proxy": [ + "make sh-testnet" ] } } diff --git a/go.mod b/go.mod index 65608f681..e3ca3408a 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 @@ -66,11 +65,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 @@ -82,7 +83,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 @@ -110,6 +110,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 @@ -181,7 +182,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 @@ -235,7 +235,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 b44bf1f17..4f8aa581b 100644 --- a/go.sum +++ b/go.sum @@ -2071,8 +2071,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/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g= diff --git a/internal/db/actions.go b/internal/db/actions.go deleted file mode 100644 index cf0354acf..000000000 --- a/internal/db/actions.go +++ /dev/null @@ -1,330 +0,0 @@ -package db - -import ( - "fmt" - - "github.com/onsonr/sonr/internal/db/orm" - "gorm.io/gorm" -) - -// createInitialTables creates the initial tables in the database. -func createInitialTables(db *gorm.DB) (*DB, error) { - err := db.AutoMigrate( - &orm.Account{}, - &orm.Asset{}, - &orm.Credential{}, - &orm.Keyshare{}, - &orm.Permission{}, - &orm.Profile{}, - &orm.Property{}, - ) - if err != nil { - return nil, fmt.Errorf("failed to create table: %w", err) - } - - return &DB{db}, nil -} - -// AddAccount adds a new account to the database -func (db *DB) AddAccount(account *orm.Account) error { - tx := db.Create(account) - if tx.Error != nil { - return fmt.Errorf("failed to add account: %w", tx.Error) - } - - return nil -} - -// GetAccount gets an account from the database -func (db *DB) GetAccount(account *orm.Account) error { - tx := db.First(account) - if tx.Error != nil { - return fmt.Errorf("failed to get account: %w", tx.Error) - } - - return nil -} - -// UpdateAccount updates an existing account in the database -func (db *DB) UpdateAccount(account *orm.Account) error { - tx := db.Save(account) - if tx.Error != nil { - return fmt.Errorf("failed to update account: %w", tx.Error) - } - - return nil -} - -// DeleteAccount deletes an existing account from the database -func (db *DB) DeleteAccount(account *orm.Account) error { - tx := db.Delete(account) - if tx.Error != nil { - return fmt.Errorf("failed to delete account: %w", tx.Error) - } - - return nil -} - -// AddAsset adds a new asset to the database -func (db *DB) AddAsset(asset *orm.Asset) error { - tx := db.Create(asset) - - if tx.Error != nil { - return fmt.Errorf("failed to add asset: %w", tx.Error) - } - - return nil -} - -// GetAsset gets an asset from the database -func (db *DB) GetAsset(asset *orm.Asset) error { - tx := db.First(asset) - - if tx.Error != nil { - return fmt.Errorf("failed to get asset: %w", tx.Error) - } - - return nil -} - -// UpdateAsset updates an existing asset in the database -func (db *DB) UpdateAsset(asset *orm.Asset) error { - tx := db.Save(asset) - - if tx.Error != nil { - return fmt.Errorf("failed to update asset: %w", tx.Error) - } - - return nil -} - -// DeleteAsset deletes an existing asset from the database -func (db *DB) DeleteAsset(asset *orm.Asset) error { - tx := db.Delete(asset) - - if tx.Error != nil { - return fmt.Errorf("failed to delete asset: %w", tx.Error) - } - - return nil -} - -// AddCredential adds a new credential to the database -func (db *DB) AddCredential(credential *orm.Credential) error { - tx := db.Create(credential) - - if tx.Error != nil { - return fmt.Errorf("failed to add credential: %w", tx.Error) - } - - return nil -} - -// GetCredential gets an credential from the database -func (db *DB) GetCredential(credential *orm.Credential) error { - tx := db.First(credential) - - if tx.Error != nil { - return fmt.Errorf("failed to get credential: %w", tx.Error) - } - - return nil -} - -// UpdateCredential updates an existing credential in the database -func (db *DB) UpdateCredential(credential *orm.Credential) error { - tx := db.Save(credential) - - if tx.Error != nil { - return fmt.Errorf("failed to update credential: %w", tx.Error) - } - - return nil -} - -// DeleteCredential deletes an existing credential from the database -func (db *DB) DeleteCredential(credential *orm.Credential) error { - tx := db.Delete(credential) - - if tx.Error != nil { - return fmt.Errorf("failed to delete credential: %w", tx.Error) - } - - return nil -} - -// AddKeyshare adds a new keyshare to the database -func (db *DB) AddKeyshare(keyshare *orm.Keyshare) error { - tx := db.Create(keyshare) - - if tx.Error != nil { - return fmt.Errorf("failed to add keyshare: %w", tx.Error) - } - - return nil -} - -// GetKeyshare gets an keyshare from the database -func (db *DB) GetKeyshare(keyshare *orm.Keyshare) error { - tx := db.First(keyshare) - - if tx.Error != nil { - return fmt.Errorf("failed to get keyshare: %w", tx.Error) - } - - return nil -} - -// UpdateKeyshare updates an existing keyshare in the database -func (db *DB) UpdateKeyshare(keyshare *orm.Keyshare) error { - tx := db.Save(keyshare) - - if tx.Error != nil { - return fmt.Errorf("failed to update keyshare: %w", tx.Error) - } - - return nil -} - -// DeleteKeyshare deletes an existing keyshare from the database -func (db *DB) DeleteKeyshare(keyshare *orm.Keyshare) error { - tx := db.Delete(keyshare) - - if tx.Error != nil { - return fmt.Errorf("failed to delete keyshare: %w", tx.Error) - } - - return nil -} - -// AddPermission adds a new permission to the database -func (db *DB) AddPermission(permission *orm.Permission) error { - tx := db.Create(permission) - - if tx.Error != nil { - return fmt.Errorf("failed to add permission: %w", tx.Error) - } - - return nil -} - -// GetPermission gets an permission from the database -func (db *DB) GetPermission(permission *orm.Permission) error { - tx := db.First(permission) - - if tx.Error != nil { - return fmt.Errorf("failed to get permission: %w", tx.Error) - } - - return nil -} - -// UpdatePermission updates an existing permission in the database -func (db *DB) UpdatePermission(permission *orm.Permission) error { - tx := db.Save(permission) - - if tx.Error != nil { - return fmt.Errorf("failed to update permission: %w", tx.Error) - } - - return nil -} - -// DeletePermission deletes an existing permission from the database -func (db *DB) DeletePermission(permission *orm.Permission) error { - tx := db.Delete(permission) - - if tx.Error != nil { - return fmt.Errorf("failed to delete permission: %w", tx.Error) - } - - return nil -} - -// AddProfile adds a new profile to the database -func (db *DB) AddProfile(profile *orm.Profile) error { - tx := db.Create(profile) - - if tx.Error != nil { - return fmt.Errorf("failed to add profile: %w", tx.Error) - } - - return nil -} - -// GetProfile gets an profile from the database -func (db *DB) GetProfile(profile *orm.Profile) error { - tx := db.First(profile) - - if tx.Error != nil { - return fmt.Errorf("failed to get profile: %w", tx.Error) - } - - return nil -} - -// UpdateProfile updates an existing profile in the database -func (db *DB) UpdateProfile(profile *orm.Profile) error { - tx := db.Save(profile) - - if tx.Error != nil { - return fmt.Errorf("failed to update profile: %w", tx.Error) - } - - return nil -} - -// DeleteProfile deletes an existing profile from the database -func (db *DB) DeleteProfile(profile *orm.Profile) error { - tx := db.Delete(profile) - - if tx.Error != nil { - return fmt.Errorf("failed to delete profile: %w", tx.Error) - } - - return nil -} - -// AddProperty adds a new property to the database -func (db *DB) AddProperty(property *orm.Property) error { - tx := db.Create(property) - - if tx.Error != nil { - return fmt.Errorf("failed to add property: %w", tx.Error) - } - - return nil -} - -// GetProperty gets an property from the database -func (db *DB) GetProperty(property *orm.Property) error { - tx := db.First(property) - - if tx.Error != nil { - return fmt.Errorf("failed to get property: %w", tx.Error) - } - - return nil -} - -// UpdateProperty updates an existing property in the database -func (db *DB) UpdateProperty(property *orm.Property) error { - tx := db.Save(property) - - if tx.Error != nil { - return fmt.Errorf("failed to update property: %w", tx.Error) - } - - return nil -} - -// DeleteProperty deletes an existing property from the database -func (db *DB) DeleteProperty(property *orm.Property) error { - tx := db.Delete(property) - - if tx.Error != nil { - return fmt.Errorf("failed to delete property: %w", tx.Error) - } - - return nil -} diff --git a/internal/db/database.go b/internal/db/database.go deleted file mode 100644 index 12bb158ed..000000000 --- a/internal/db/database.go +++ /dev/null @@ -1,54 +0,0 @@ -package db - -import ( - "crypto/rand" - - "github.com/ncruces/go-sqlite3/gormlite" - "golang.org/x/crypto/argon2" - "gorm.io/gorm" - "lukechampine.com/adiantum/hbsh" - "lukechampine.com/adiantum/hpolyc" -) - -type DB struct { - *gorm.DB -} - -func New(opts ...DBOption) (*DB, error) { - config := &DBConfig{ - fileName: "vault.db", - } - for _, opt := range opts { - opt(config) - } - gormdb, err := gorm.Open(gormlite.Open(config.ConnectionString())) - if err != nil { - return nil, err - } - db, err := createInitialTables(gormdb) - if err != nil { - return nil, err - } - return db, nil -} - -// HBSH creates an HBSH cipher given a key. -func (c *DB) HBSH(key []byte) *hbsh.HBSH { - if len(key) != 32 { - // Key is not appropriate, return nil. - return nil - } - return hpolyc.New(key) -} - -// KDF gets a key from a secret. -func (c *DB) KDF(secret string) []byte { - if secret == "" { - // No secret is given, generate a random key. - key := make([]byte, 32) - n, _ := rand.Read(key) - return key[:n] - } - // Hash the secret with a KDF. - return argon2.IDKey([]byte(secret), []byte("hpolyc"), 3, 64*1024, 4, 32) -} diff --git a/internal/db/handlers.go b/internal/db/handlers.go deleted file mode 100644 index e4f739c77..000000000 --- a/internal/db/handlers.go +++ /dev/null @@ -1,195 +0,0 @@ -package db - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/db/orm" -) - -func (db *DB) ServeEcho(e *echo.Group) { - e.GET("/accounts", db.HandleAccount) - e.GET("/assets", db.HandleAsset) - e.GET("/credentials", db.HandleCredential) - e.GET("/keyshares", db.HandleKeyshare) - e.GET("/permissions", db.HandlePermission) - e.GET("/profiles", db.HandleProfile) - e.GET("/properties", db.HandleProperty) -} - -func (db *DB) HandleAccount(c echo.Context) error { - data := new(orm.Account) - if err := c.Bind(data); err != nil { - return err - } - // Check the method for GET, POST, PUT, DELETE - switch c.Request().Method { - case echo.POST: - - if err := db.AddAccount(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.PUT: - - if err := db.UpdateAccount(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.DELETE: - if err := db.DeleteAccount(data); err != nil { - return err - } - return c.JSON(200, nil) - } - return c.JSON(200, data) -} - -func (db *DB) HandleAsset(c echo.Context) error { - data := new(orm.Asset) - if err := c.Bind(data); err != nil { - return err - } - - switch c.Request().Method { - case echo.POST: - if err := db.AddAsset(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.PUT: - if err := db.UpdateAsset(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.DELETE: - if err := db.DeleteAsset(data); err != nil { - return err - } - return c.JSON(200, "OK") - } - return c.JSON(200, data) -} - -func (db *DB) HandleCredential(c echo.Context) error { - data := new(orm.Credential) - if err := c.Bind(data); err != nil { - return err - } - - switch c.Request().Method { - case echo.POST: - if err := db.AddCredential(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.PUT: - if err := db.UpdateCredential(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.DELETE: - if err := db.DeleteCredential(data); err != nil { - return err - } - } - return c.JSON(200, data) -} - -func (db *DB) HandleKeyshare(c echo.Context) error { - data := new(orm.Keyshare) - if err := c.Bind(data); err != nil { - return err - } - - switch c.Request().Method { - case echo.POST: - if err := db.AddKeyshare(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.PUT: - if err := db.UpdateKeyshare(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.DELETE: - if err := db.DeleteKeyshare(data); err != nil { - return err - } - } - return c.JSON(200, data) -} - -func (db *DB) HandlePermission(c echo.Context) error { - data := new(orm.Permission) - if err := c.Bind(data); err != nil { - return err - } - - switch c.Request().Method { - case echo.POST: - if err := db.AddPermission(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.PUT: - if err := db.UpdatePermission(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.DELETE: - if err := db.DeletePermission(data); err != nil { - return err - } - } - return c.JSON(200, data) -} - -func (db *DB) HandleProfile(c echo.Context) error { - data := new(orm.Profile) - if err := c.Bind(data); err != nil { - return err - } - - switch c.Request().Method { - case echo.POST: - if err := db.AddProfile(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.PUT: - if err := db.UpdateProfile(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.DELETE: - if err := db.DeleteProfile(data); err != nil { - return err - } - } - return c.JSON(200, data) -} - -func (db *DB) HandleProperty(c echo.Context) error { - data := new(orm.Property) - if err := c.Bind(data); err != nil { - return err - } - - switch c.Request().Method { - case echo.POST: - if err := db.AddProperty(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.PUT: - if err := db.UpdateProperty(data); err != nil { - return err - } - return c.JSON(200, "OK") - case echo.DELETE: - if err := db.DeleteProperty(data); err != nil { - return err - } - } - return c.JSON(200, data) -} diff --git a/internal/db/idb/idb.go b/internal/db/idb/idb.go deleted file mode 100644 index 5dab6c074..000000000 --- a/internal/db/idb/idb.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package idb - -import ( - "context" - "encoding/json" - "errors" - "syscall/js" - - "github.com/hack-pad/go-indexeddb/idb" -) - -// Model is an interface that must be implemented by types used with Table -type Model interface { - Table() string -} - -// Table is a generic wrapper around IDB for easier database operations on a specific table -type Table[T Model] struct { - db *idb.Database - dbName string - keyPath string -} - -// NewTable creates a new Table instance -func NewTable[T Model](dbName string, version uint, keyPath string) (*Table[T], error) { - ctx := context.Background() - factory := idb.Global() - - var model T - tableName := model.Table() - - openRequest, err := factory.Open(ctx, dbName, version, func(db *idb.Database, oldVersion, newVersion uint) error { - _, err := db.CreateObjectStore(tableName, idb.ObjectStoreOptions{ - KeyPath: js.ValueOf(keyPath), - }) - return err - }) - if err != nil { - return nil, err - } - db, err := openRequest.Await(ctx) - if err != nil { - return nil, err - } - return &Table[T]{ - db: db, - dbName: dbName, - keyPath: keyPath, - }, nil -} - -// Insert adds a new record to the table -func (t *Table[T]) Insert(data T) error { - tx, err := t.db.Transaction(idb.TransactionReadWrite, data.Table()) - if err != nil { - return err - } - defer tx.Commit() - - objectStore, err := tx.ObjectStore(data.Table()) - if err != nil { - return err - } - - jsonData, err := json.Marshal(data) - if err != nil { - return err - } - - _, err = objectStore.Add(js.ValueOf(string(jsonData))) - return err -} - -// Query retrieves a record from the table based on a key -func (t *Table[T]) Query(key interface{}) (T, error) { - var result T - - tx, err := t.db.Transaction(idb.TransactionReadOnly, result.Table()) - if err != nil { - return result, err - } - defer tx.Commit() - - objectStore, err := tx.ObjectStore(result.Table()) - if err != nil { - return result, err - } - - request, err := objectStore.Get(js.ValueOf(key)) - if err != nil { - return result, err - } - - value, err := request.Await(context.Background()) - if err != nil { - return result, err - } - - if value.IsUndefined() || value.IsNull() { - return result, errors.New("record not found") - } - - err = json.Unmarshal([]byte(value.String()), &result) - return result, err -} - -// Delete removes a record from the table based on a key -func (t *Table[T]) Delete(key interface{}) error { - var model T - tx, err := t.db.Transaction(idb.TransactionReadWrite, model.Table()) - if err != nil { - return err - } - defer tx.Commit() - - objectStore, err := tx.ObjectStore(model.Table()) - if err != nil { - return err - } - - _, err = objectStore.Delete(js.ValueOf(key)) - return err -} - -// Close closes the database connection -func (t *Table[T]) Close() error { - return t.db.Close() -} diff --git a/internal/db/options.go b/internal/db/options.go deleted file mode 100644 index 47f2e1f31..000000000 --- a/internal/db/options.go +++ /dev/null @@ -1,40 +0,0 @@ -package db - -import ( - _ "github.com/ncruces/go-sqlite3/embed" - "github.com/onsonr/sonr/internal/db/orm" -) - -type DBOption func(config *DBConfig) - -func WitDir(dir string) DBOption { - return func(config *DBConfig) { - config.Dir = dir - } -} - -func WithSecretKey(secretKey string) DBOption { - return func(config *DBConfig) { - config.SecretKey = secretKey - } -} - -type DBConfig struct { - Dir string - SecretKey string - - fileName string - initialAccounts []*orm.Account - initialAssets []*orm.Asset - initialCredentials []*orm.Credential - initialKeyshares []*orm.Keyshare - initialPermissions []*orm.Permission - initialProfiles []*orm.Profile - initialProperties []*orm.Property -} - -func (config *DBConfig) ConnectionString() string { - connStr := "file:" - connStr += config.fileName - return connStr -} diff --git a/internal/db/orm/Account.pkl.go b/internal/db/orm/Account.pkl.go deleted file mode 100644 index 09a4e0b1a..000000000 --- a/internal/db/orm/Account.pkl.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type Account struct { - Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - Name string `pkl:"name" json:"name,omitempty" param:"name"` - - Address string `pkl:"address" json:"address,omitempty" param:"address"` - - PublicKey string `pkl:"publicKey" json:"publicKey,omitempty" param:"publicKey"` - - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` -} diff --git a/internal/db/orm/Asset.pkl.go b/internal/db/orm/Asset.pkl.go deleted file mode 100644 index fd28cc9f7..000000000 --- a/internal/db/orm/Asset.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type Asset struct { - Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - Name string `pkl:"name" json:"name,omitempty" param:"name"` - - Symbol string `pkl:"symbol" json:"symbol,omitempty" param:"symbol"` - - Decimals int `pkl:"decimals" json:"decimals,omitempty" param:"decimals"` - - ChainId *int `pkl:"chainId" json:"chainId,omitempty" param:"chainId"` - - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` -} diff --git a/internal/db/orm/Chain.pkl.go b/internal/db/orm/Chain.pkl.go deleted file mode 100644 index 6b3544d18..000000000 --- a/internal/db/orm/Chain.pkl.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type Chain struct { - Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - Name string `pkl:"name" json:"name,omitempty" param:"name"` - - NetworkId string `pkl:"networkId" json:"networkId,omitempty" param:"networkId"` - - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` -} diff --git a/internal/db/orm/Credential.pkl.go b/internal/db/orm/Credential.pkl.go deleted file mode 100644 index b05f04c9b..000000000 --- a/internal/db/orm/Credential.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type Credential struct { - Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - Subject string `pkl:"subject" json:"subject,omitempty" param:"subject"` - - Controller string `pkl:"controller" json:"controller,omitempty" param:"controller"` - - AttestationType string `pkl:"attestationType" json:"attestationType,omitempty" param:"attestationType"` - - Origin string `pkl:"origin" json:"origin,omitempty" param:"origin"` - - CredentialId string `pkl:"credentialId" json:"credentialId,omitempty" param:"credentialId"` - - PublicKey string `pkl:"publicKey" json:"publicKey,omitempty" param:"publicKey"` - - Transport string `pkl:"transport" json:"transport,omitempty" param:"transport"` - - SignCount uint `pkl:"signCount" json:"signCount,omitempty" param:"signCount"` - - UserPresent bool `pkl:"userPresent" json:"userPresent,omitempty" param:"userPresent"` - - UserVerified bool `pkl:"userVerified" json:"userVerified,omitempty" param:"userVerified"` - - BackupEligible bool `pkl:"backupEligible" json:"backupEligible,omitempty" param:"backupEligible"` - - BackupState bool `pkl:"backupState" json:"backupState,omitempty" param:"backupState"` - - CloneWarning bool `pkl:"cloneWarning" json:"cloneWarning,omitempty" param:"cloneWarning"` - - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` - - UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty" param:"updatedAt"` -} diff --git a/internal/db/orm/Keyshare.pkl.go b/internal/db/orm/Keyshare.pkl.go deleted file mode 100644 index ed51e7a94..000000000 --- a/internal/db/orm/Keyshare.pkl.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type Keyshare struct { - Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - Data string `pkl:"data" json:"data,omitempty" param:"data"` - - Role int `pkl:"role" json:"role,omitempty" param:"role"` - - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` -} diff --git a/internal/db/orm/Orm.pkl.go b/internal/db/orm/Orm.pkl.go deleted file mode 100644 index 8c2222fb0..000000000 --- a/internal/db/orm/Orm.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Orm struct { -} - -// 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) { - 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 Orm -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Orm, error) { - var ret Orm - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/internal/db/orm/Permission.pkl.go b/internal/db/orm/Permission.pkl.go deleted file mode 100644 index 0e93df3c3..000000000 --- a/internal/db/orm/Permission.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type Permission struct { - Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - ServiceId string `pkl:"serviceId" json:"serviceId,omitempty" param:"serviceId"` - - Grants string `pkl:"grants" json:"grants,omitempty" param:"grants"` - - Scopes string `pkl:"scopes" json:"scopes,omitempty" param:"scopes"` - - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` - - UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty" param:"updatedAt"` -} diff --git a/internal/db/orm/Profile.pkl.go b/internal/db/orm/Profile.pkl.go deleted file mode 100644 index c0153cc3c..000000000 --- a/internal/db/orm/Profile.pkl.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type Profile struct { - Id string `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - Subject string `pkl:"subject" json:"subject,omitempty" param:"subject"` - - Controller string `pkl:"controller" json:"controller,omitempty" param:"controller"` - - OriginUri *string `pkl:"originUri" json:"originUri,omitempty" param:"originUri"` - - PublicMetadata *string `pkl:"publicMetadata" json:"publicMetadata,omitempty" param:"publicMetadata"` - - PrivateMetadata *string `pkl:"privateMetadata" json:"privateMetadata,omitempty" param:"privateMetadata"` - - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` - - UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty" param:"updatedAt"` -} diff --git a/internal/db/orm/Property.pkl.go b/internal/db/orm/Property.pkl.go deleted file mode 100644 index 937b6209a..000000000 --- a/internal/db/orm/Property.pkl.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type Property struct { - Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - ProfileId string `pkl:"profileId" json:"profileId,omitempty" param:"profileId"` - - Key string `pkl:"key" json:"key,omitempty" param:"key"` - - Accumulator string `pkl:"accumulator" json:"accumulator,omitempty" param:"accumulator"` - - PropertyKey string `pkl:"propertyKey" json:"propertyKey,omitempty" param:"propertyKey"` -} diff --git a/internal/db/orm/init.pkl.go b/internal/db/orm/init.pkl.go deleted file mode 100644 index 817be2b7c..000000000 --- a/internal/db/orm/init.pkl.go +++ /dev/null @@ -1,16 +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#Profile", Profile{}) - pkl.RegisterMapping("orm#Property", Property{}) - pkl.RegisterMapping("orm#Keyshare", Keyshare{}) - pkl.RegisterMapping("orm#Permission", Permission{}) -} diff --git a/internal/db/orm/orm.go b/internal/db/orm/orm.go deleted file mode 100644 index 1b1266bf1..000000000 --- a/internal/db/orm/orm.go +++ /dev/null @@ -1,29 +0,0 @@ -package orm - -func (a *Account) Table() string { - return "accounts" -} - -func (a *Asset) Table() string { - return "assets" -} - -func (a *Credential) Table() string { - return "credentials" -} - -func (a *Keyshare) Table() string { - return "keyshares" -} - -func (a *Permission) Table() string { - return "permissions" -} - -func (a *Profile) Table() string { - return "profiles" -} - -func (a *Property) Table() string { - return "properties" -} diff --git a/internal/dwn/handlers/manifest.go b/internal/dwn/handlers/manifest.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/internal/dwn/handlers/manifest.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/internal/dwn/handlers/views.go b/internal/dwn/handlers/views.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/internal/dwn/handlers/views.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/internal/dwn/handlers/wellknown.go b/internal/dwn/handlers/wellknown.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/internal/dwn/handlers/wellknown.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/internal/gui/elements/alert.templ b/internal/gui/elements/alert.templ deleted file mode 100644 index 89f977aea..000000000 --- a/internal/gui/elements/alert.templ +++ /dev/null @@ -1,67 +0,0 @@ -package elements - -func Alert(variant Variant, icon Icon, title, message string) templ.Component { - return alertElement(variant.Attributes(), title, message, icon.Render()) -} - -templ alertElement(attrs templ.Attributes, title, message string, icon templ.Component) { -
- @icon -
{ title }
-
{ message }
-
-} - -type AlertVariant int - -const ( - AlertVariant_Default AlertVariant = iota - AlertVariant_Info - AlertVariant_Error - AlertVariant_Success - AlertVariant_Warning - AlertVariant_Subtle_Info - AlertVariant_Subtle_Error - AlertVariant_Subtle_Success - AlertVariant_Subtle_Warning -) - -func (v AlertVariant) Attributes() templ.Attributes { - switch v { - case AlertVariant_Info: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-blue-600 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", - } - case AlertVariant_Error: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-red-600 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", - } - case AlertVariant_Success: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-green-500 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", - } - case AlertVariant_Warning: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-yellow-500 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", - } - case AlertVariant_Subtle_Info: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-blue-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-blue-600", - } - case AlertVariant_Subtle_Error: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-red-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-red-600", - } - case AlertVariant_Subtle_Success: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-green-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-green-600", - } - case AlertVariant_Subtle_Warning: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-yellow-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-yellow-600", - } - } - return templ.Attributes{ - "class": "relative w-full rounded-lg border bg-white p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-neutral-900", - } -} diff --git a/internal/gui/elements/alert_templ.go b/internal/gui/elements/alert_templ.go deleted file mode 100644 index 0a95440bb..000000000 --- a/internal/gui/elements/alert_templ.go +++ /dev/null @@ -1,140 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func Alert(variant Variant, icon Icon, title, message string) templ.Component { - return alertElement(variant.Attributes(), title, message, icon.Render()) -} - -func alertElement(attrs templ.Attributes, title, message string, icon templ.Component) 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_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = icon.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 - } - 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: `internal/gui/elements/alert.templ`, Line: 10, Col: 66} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - 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 - } - 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: `internal/gui/elements/alert.templ`, Line: 11, Col: 43} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - 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 - } - return templ_7745c5c3_Err - }) -} - -type AlertVariant int - -const ( - AlertVariant_Default AlertVariant = iota - AlertVariant_Info - AlertVariant_Error - AlertVariant_Success - AlertVariant_Warning - AlertVariant_Subtle_Info - AlertVariant_Subtle_Error - AlertVariant_Subtle_Success - AlertVariant_Subtle_Warning -) - -func (v AlertVariant) Attributes() templ.Attributes { - switch v { - case AlertVariant_Info: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-blue-600 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", - } - case AlertVariant_Error: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-red-600 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", - } - case AlertVariant_Success: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-green-500 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", - } - case AlertVariant_Warning: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-yellow-500 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", - } - case AlertVariant_Subtle_Info: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-blue-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-blue-600", - } - case AlertVariant_Subtle_Error: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-red-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-red-600", - } - case AlertVariant_Subtle_Success: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-green-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-green-600", - } - case AlertVariant_Subtle_Warning: - return templ.Attributes{ - "class": "relative w-full rounded-lg border border-transparent bg-yellow-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-yellow-600", - } - } - return templ.Attributes{ - "class": "relative w-full rounded-lg border bg-white p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-neutral-900", - } -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/animation.templ b/internal/gui/elements/animation.templ deleted file mode 100644 index 9d7f988ff..000000000 --- a/internal/gui/elements/animation.templ +++ /dev/null @@ -1,5 +0,0 @@ -package elements - -templ Animation() { - -} diff --git a/internal/gui/elements/animation_templ.go b/internal/gui/elements/animation_templ.go deleted file mode 100644 index 523e659da..000000000 --- a/internal/gui/elements/animation_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func Animation() 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_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/badge.templ b/internal/gui/elements/badge.templ deleted file mode 100644 index af512f4ac..000000000 --- a/internal/gui/elements/badge.templ +++ /dev/null @@ -1,59 +0,0 @@ -package elements - -templ PoweredBySonr() { -
-
-
- - Powered by - - - - - - -
-
- sonr image -
-

The creative platform for developers. Community, tools, products, and more

-

- - - - Joined June 2020 -

-
-
-
-
-
-
-} diff --git a/internal/gui/elements/badge_templ.go b/internal/gui/elements/badge_templ.go deleted file mode 100644 index c7dd81760..000000000 --- a/internal/gui/elements/badge_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func PoweredBySonr() 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_Err = templ_7745c5c3_Buffer.WriteString("
Powered by
\"sonr

The creative platform for developers. Community, tools, products, and more

Joined June 2020

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/breadcrumbs.templ b/internal/gui/elements/breadcrumbs.templ deleted file mode 100644 index 45eed0d78..000000000 --- a/internal/gui/elements/breadcrumbs.templ +++ /dev/null @@ -1,35 +0,0 @@ -package elements - -templ Breadcrumbs() { - -} - -templ breadcrumbItem(title string, active bool) { - if (active) { -
  • { title }
  • - } else { -
  • { title }
  • - } -} - -templ breadcrumbIcon() { - - - - - -} diff --git a/internal/gui/elements/breadcrumbs_templ.go b/internal/gui/elements/breadcrumbs_templ.go deleted file mode 100644 index 219bb897f..000000000 --- a/internal/gui/elements/breadcrumbs_templ.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func Breadcrumbs() 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_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func breadcrumbItem(title string, active bool) 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - if active { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/breadcrumbs.templ`, Line: 23, Col: 126} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - 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 - } - } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/breadcrumbs.templ`, Line: 25, Col: 118} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - 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 - } - } - return templ_7745c5c3_Err - }) -} - -func breadcrumbIcon() 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_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/button.templ b/internal/gui/elements/button.templ deleted file mode 100644 index 12b58480b..000000000 --- a/internal/gui/elements/button.templ +++ /dev/null @@ -1,218 +0,0 @@ -package elements - -type button struct { - variant Variant - hxGet string - hxPost string - hxTarget string - hxTrigger string - hxSwap string -} - -type ButtonOpt func(button *button) - -func PrimaryButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantPrimary - } -} - -func InfoButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantInfo - } -} - -func ErrorButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantError - } -} - -func SuccessButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantSuccess - } -} - -func WarningButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantWarning - } -} - -func GET(action string, target string) ButtonOpt { - return func(button *button) { - button.hxGet = action - button.hxTarget = target - button.hxTrigger = "click" - button.hxSwap = "outerHTML" - } -} - -func POST(action string, target string) ButtonOpt { - return func(button *button) { - button.hxPost = action - button.hxTarget = target - button.hxTrigger = "click" - button.hxSwap = "outerHTML" - } -} - -func Button(opts ...ButtonOpt) templ.Component { - button := button{ - variant: ButtonVariantDefault, - } - for _, opt := range opts { - opt(&button) - } - if button.hxGet != "" { - return renderHxGetButton(&button, button.variant.Attributes()) - } - - if button.hxPost != "" { - return renderHxPostButton(&button, button.variant.Attributes()) - } - return renderButton(button.variant.Attributes()) -} - -templ renderButton(attrs templ.Attributes) { - -} - -templ renderHxGetButton(c *button, attrs templ.Attributes) { - -} - -templ renderHxPostButton(c *button, attrs templ.Attributes) { - -} - -type ButtonVariant int - -const ( - ButtonVariantDefault ButtonVariant = iota - ButtonVariantPrimary - ButtonVariantInfo - ButtonVariantError - ButtonVariantSuccess - ButtonVariantWarning -) - -func (v ButtonVariant) Attributes() templ.Attributes { - switch v { - case ButtonVariantPrimary: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-neutral-950 hover:bg-neutral-900 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-900 focus:shadow-outline focus:outline-none", - "type": "button", - } - case ButtonVariantInfo: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 bg-blue-600 rounded-md hover:bg-blue-700 focus:ring-2 focus:ring-offset-2 focus:ring-blue-700 focus:shadow-outline focus:outline-none", - "type": "button", - } - case ButtonVariantError: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-red-600 hover:bg-red-700 focus:ring-2 focus:ring-offset-2 focus:ring-red-700 focus:shadow-outline focus:outline-none", - "type": "button", - } - case ButtonVariantSuccess: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-green-600 hover:bg-green-700 focus:ring-2 focus:ring-offset-2 focus:ring-green-700 focus:shadow-outline focus:outline-none", - "type": "button", - } - case ButtonVariantWarning: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-yellow-600 hover:bg-yellow-700 focus:ring-2 focus:ring-offset-2 focus:ring-yellow-700 focus:shadow-outline focus:outline-none", - "type": "button", - } - } - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-200 bg-white border rounded-md text-neutral-500 hover:text-neutral-700 border-neutral-200/70 hover:bg-neutral-100 active:bg-white focus:bg-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-200/60 focus:shadow-outline", - "type": "button", - } -} - -type SubtleButtonVariant int - -const ( - SubtleButtonVariantDefault SubtleButtonVariant = iota - SubtleButtonVariantInfo - SubtleButtonVariantError - SubtleButtonVariantSuccess - SubtleButtonVariantWarning -) - -func (v SubtleButtonVariant) Attributes() templ.Attributes { - switch v { - case SubtleButtonVariantInfo: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-blue-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-blue-100 bg-blue-50 hover:text-blue-600 hover:bg-blue-100", - "type": "button", - } - case SubtleButtonVariantError: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-red-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-red-100 bg-red-50 hover:text-red-600 hover:bg-red-100", - "type": "button", - } - case SubtleButtonVariantSuccess: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-green-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-green-100 bg-green-50 hover:text-green-600 hover:bg-green-100", - "type": "button", - } - case SubtleButtonVariantWarning: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-yellow-600 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-yellow-100 bg-yellow-50 hover:text-yellow-700 hover:bg-yellow-100", - "type": "button", - } - } - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-100 rounded-md text-neutral-500 bg-neutral-50 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-100 hover:text-neutral-600 hover:bg-neutral-100", - "type": "button", - } -} - -type OutlineButtonVariant int - -const ( - OutlineButtonVariantDefault OutlineButtonVariant = iota - OutlineButtonVariantInfo - OutlineButtonVariantError - OutlineButtonVariantSuccess - OutlineButtonVariantWarning -) - -func (v OutlineButtonVariant) Attributes() templ.Attributes { - switch v { - case OutlineButtonVariantInfo: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-blue-600 transition-colors duration-100 bg-white border-2 border-blue-600 rounded-md hover:text-white hover:bg-blue-600", - "type": "button", - } - case OutlineButtonVariantError: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-red-600 transition-colors duration-100 bg-white border-2 border-red-600 rounded-md hover:text-white hover:bg-red-600", - "type": "button", - } - case OutlineButtonVariantSuccess: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-green-600 transition-colors duration-100 bg-white border-2 border-green-600 rounded-md hover:text-white hover:bg-green-600", - "type": "button", - } - case OutlineButtonVariantWarning: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-yellow-600 transition-colors duration-100 bg-white border-2 border-yellow-500 rounded-md hover:text-white hover:bg-yellow-500", - "type": "button", - } - } - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-100 bg-white border-2 rounded-md text-neutral-900 hover:text-white border-neutral-900 hover:bg-neutral-900", - "type": "button", - } -} diff --git a/internal/gui/elements/button_templ.go b/internal/gui/elements/button_templ.go deleted file mode 100644 index ad66da28e..000000000 --- a/internal/gui/elements/button_templ.go +++ /dev/null @@ -1,449 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -type button struct { - variant Variant - hxGet string - hxPost string - hxTarget string - hxTrigger string - hxSwap string -} - -type ButtonOpt func(button *button) - -func PrimaryButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantPrimary - } -} - -func InfoButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantInfo - } -} - -func ErrorButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantError - } -} - -func SuccessButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantSuccess - } -} - -func WarningButtonStyle() ButtonOpt { - return func(button *button) { - button.variant = ButtonVariantWarning - } -} - -func GET(action string, target string) ButtonOpt { - return func(button *button) { - button.hxGet = action - button.hxTarget = target - button.hxTrigger = "click" - button.hxSwap = "outerHTML" - } -} - -func POST(action string, target string) ButtonOpt { - return func(button *button) { - button.hxPost = action - button.hxTarget = target - button.hxTrigger = "click" - button.hxSwap = "outerHTML" - } -} - -func Button(opts ...ButtonOpt) templ.Component { - button := button{ - variant: ButtonVariantDefault, - } - for _, opt := range opts { - opt(&button) - } - if button.hxGet != "" { - return renderHxGetButton(&button, button.variant.Attributes()) - } - - if button.hxPost != "" { - return renderHxPostButton(&button, button.variant.Attributes()) - } - return renderButton(button.variant.Attributes()) -} - -func renderButton(attrs templ.Attributes) 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_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.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 - } - return templ_7745c5c3_Err - }) -} - -func renderHxGetButton(c *button, attrs templ.Attributes) 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func renderHxPostButton(c *button, attrs templ.Attributes) 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_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -type ButtonVariant int - -const ( - ButtonVariantDefault ButtonVariant = iota - ButtonVariantPrimary - ButtonVariantInfo - ButtonVariantError - ButtonVariantSuccess - ButtonVariantWarning -) - -func (v ButtonVariant) Attributes() templ.Attributes { - switch v { - case ButtonVariantPrimary: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-neutral-950 hover:bg-neutral-900 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-900 focus:shadow-outline focus:outline-none", - "type": "button", - } - case ButtonVariantInfo: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 bg-blue-600 rounded-md hover:bg-blue-700 focus:ring-2 focus:ring-offset-2 focus:ring-blue-700 focus:shadow-outline focus:outline-none", - "type": "button", - } - case ButtonVariantError: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-red-600 hover:bg-red-700 focus:ring-2 focus:ring-offset-2 focus:ring-red-700 focus:shadow-outline focus:outline-none", - "type": "button", - } - case ButtonVariantSuccess: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-green-600 hover:bg-green-700 focus:ring-2 focus:ring-offset-2 focus:ring-green-700 focus:shadow-outline focus:outline-none", - "type": "button", - } - case ButtonVariantWarning: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-yellow-600 hover:bg-yellow-700 focus:ring-2 focus:ring-offset-2 focus:ring-yellow-700 focus:shadow-outline focus:outline-none", - "type": "button", - } - } - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-200 bg-white border rounded-md text-neutral-500 hover:text-neutral-700 border-neutral-200/70 hover:bg-neutral-100 active:bg-white focus:bg-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-200/60 focus:shadow-outline", - "type": "button", - } -} - -type SubtleButtonVariant int - -const ( - SubtleButtonVariantDefault SubtleButtonVariant = iota - SubtleButtonVariantInfo - SubtleButtonVariantError - SubtleButtonVariantSuccess - SubtleButtonVariantWarning -) - -func (v SubtleButtonVariant) Attributes() templ.Attributes { - switch v { - case SubtleButtonVariantInfo: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-blue-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-blue-100 bg-blue-50 hover:text-blue-600 hover:bg-blue-100", - "type": "button", - } - case SubtleButtonVariantError: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-red-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-red-100 bg-red-50 hover:text-red-600 hover:bg-red-100", - "type": "button", - } - case SubtleButtonVariantSuccess: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-green-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-green-100 bg-green-50 hover:text-green-600 hover:bg-green-100", - "type": "button", - } - case SubtleButtonVariantWarning: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-yellow-600 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-yellow-100 bg-yellow-50 hover:text-yellow-700 hover:bg-yellow-100", - "type": "button", - } - } - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-100 rounded-md text-neutral-500 bg-neutral-50 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-100 hover:text-neutral-600 hover:bg-neutral-100", - "type": "button", - } -} - -type OutlineButtonVariant int - -const ( - OutlineButtonVariantDefault OutlineButtonVariant = iota - OutlineButtonVariantInfo - OutlineButtonVariantError - OutlineButtonVariantSuccess - OutlineButtonVariantWarning -) - -func (v OutlineButtonVariant) Attributes() templ.Attributes { - switch v { - case OutlineButtonVariantInfo: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-blue-600 transition-colors duration-100 bg-white border-2 border-blue-600 rounded-md hover:text-white hover:bg-blue-600", - "type": "button", - } - case OutlineButtonVariantError: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-red-600 transition-colors duration-100 bg-white border-2 border-red-600 rounded-md hover:text-white hover:bg-red-600", - "type": "button", - } - case OutlineButtonVariantSuccess: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-green-600 transition-colors duration-100 bg-white border-2 border-green-600 rounded-md hover:text-white hover:bg-green-600", - "type": "button", - } - case OutlineButtonVariantWarning: - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-yellow-600 transition-colors duration-100 bg-white border-2 border-yellow-500 rounded-md hover:text-white hover:bg-yellow-500", - "type": "button", - } - } - return templ.Attributes{ - "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-100 bg-white border-2 rounded-md text-neutral-900 hover:text-white border-neutral-900 hover:bg-neutral-900", - "type": "button", - } -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/card.templ b/internal/gui/elements/card.templ deleted file mode 100644 index 59113a1a9..000000000 --- a/internal/gui/elements/card.templ +++ /dev/null @@ -1,47 +0,0 @@ -package elements - -func Card(id string, size Size) templ.Component { - return renderCard(id, size.CardAttributes()) -} - -templ renderCard(id string, attrs templ.Attributes) { -
    -
    -
    -
    - { children... } -
    -
    -
    -
    -} - -templ ProfileCard() { -
    - -
    -
    - -
    - -
    Adam Wathan
    - adamwathan -
    - -
    -
    -

    Creator of @tailwindcss. Listener of Slayer. Austin 3:16. BTW, Pines UI is super cool!

    - -
    -
    -} diff --git a/internal/gui/elements/card_templ.go b/internal/gui/elements/card_templ.go deleted file mode 100644 index 6e086c670..000000000 --- a/internal/gui/elements/card_templ.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func Card(id string, size Size) templ.Component { - return renderCard(id, size.CardAttributes()) -} - -func renderCard(id string, attrs templ.Attributes) 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_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.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 - } - return templ_7745c5c3_Err - }) -} - -func ProfileCard() 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_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    Creator of @tailwindcss. Listener of Slayer. Austin 3:16. BTW, Pines UI is super cool!

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/elements.go b/internal/gui/elements/elements.go deleted file mode 100644 index a923c57c7..000000000 --- a/internal/gui/elements/elements.go +++ /dev/null @@ -1,47 +0,0 @@ -package elements - -import ( - "strings" - - "github.com/a-h/templ" -) - -type Icon interface { - Render() templ.Component -} - -type Variant interface { - Attributes() templ.Attributes -} - -func clsxMerge(variants ...Variant) templ.Attributes { - combinedAttrs := templ.Attributes{} - var classElements []string - - for _, variant := range variants { - attrs := variant.Attributes() - if class, ok := attrs["class"].(string); ok { - classElements = append(classElements, strings.Fields(class)...) - } - for key, value := range attrs { - if key != "class" { - combinedAttrs[key] = value - } - } - } - - if len(classElements) > 0 { - combinedAttrs["class"] = strings.Join(classElements, " ") - } - return combinedAttrs -} - -func clsxBuilder(classes ...string) templ.Attributes { - if len(classes) == 0 { - return templ.Attributes{} - } - class := strings.Join(classes, " ") - return templ.Attributes{ - "class": class, - } -} diff --git a/internal/gui/elements/fonts.templ b/internal/gui/elements/fonts.templ deleted file mode 100644 index f05d49f83..000000000 --- a/internal/gui/elements/fonts.templ +++ /dev/null @@ -1,62 +0,0 @@ -package elements - -func H1(content string) templ.Component { - return renderText(1, content) -} - -func H2(content string) templ.Component { - return renderText(2, content) -} - -func H3(content string) templ.Component { - return renderText(3, content) -} - -func Text(content string) templ.Component { - return renderText(0, content) -} - -templ renderText(level int, text string) { - switch level { - case 1: -

    - { text } -

    - case 2: -

    - { text } -

    - case 3: -

    - { text } -

    - default: -

    - { text } -

    - } -} - -templ renderLink(attrs templ.Attributes, text string) { - - { text } - -} - -templ renderStrong(attrs templ.Attributes, text string) { - - { text } - -} - -templ renderEmphasis(attrs templ.Attributes, text string) { - - { text } - -} - -templ renderCode(attrs templ.Attributes, text string) { - - { text } - -} diff --git a/internal/gui/elements/fonts_templ.go b/internal/gui/elements/fonts_templ.go deleted file mode 100644 index 4022c9887..000000000 --- a/internal/gui/elements/fonts_templ.go +++ /dev/null @@ -1,326 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func H1(content string) templ.Component { - return renderText(1, content) -} - -func H2(content string) templ.Component { - return renderText(2, content) -} - -func H3(content string) templ.Component { - return renderText(3, content) -} - -func Text(content string) templ.Component { - return renderText(0, content) -} - -func renderText(level int, text string) 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) - switch level { - case 1: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/fonts.templ`, Line: 23, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - 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 - } - case 2: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/fonts.templ`, Line: 27, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - 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 - } - case 3: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/fonts.templ`, Line: 31, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - 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 - } - default: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/fonts.templ`, Line: 35, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - 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 - } - } - return templ_7745c5c3_Err - }) -} - -func renderLink(attrs templ.Attributes, text string) 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_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/fonts.templ`, Line: 42, Col: 8} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) - 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 - } - return templ_7745c5c3_Err - }) -} - -func renderStrong(attrs templ.Attributes, text string) 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_Var8 := templ.GetChildren(ctx) - if templ_7745c5c3_Var8 == nil { - templ_7745c5c3_Var8 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/fonts.templ`, Line: 48, Col: 8} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) - 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 - } - return templ_7745c5c3_Err - }) -} - -func renderEmphasis(attrs templ.Attributes, text string) 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_Var10 := templ.GetChildren(ctx) - if templ_7745c5c3_Var10 == nil { - templ_7745c5c3_Var10 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/fonts.templ`, Line: 54, Col: 8} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) - 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 - } - return templ_7745c5c3_Err - }) -} - -func renderCode(attrs templ.Attributes, text string) 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_Var12 := templ.GetChildren(ctx) - if templ_7745c5c3_Var12 == nil { - templ_7745c5c3_Var12 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `internal/gui/elements/fonts.templ`, Line: 60, Col: 8} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) - 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 - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/global.templ b/internal/gui/elements/global.templ deleted file mode 100644 index 3ae2a3c3a..000000000 --- a/internal/gui/elements/global.templ +++ /dev/null @@ -1,54 +0,0 @@ -package elements - -templ Layout(title string) { - - - - @defaultStyles() - { title } - - -
    - { children... } -
    - - -} - -templ Spacer() { -
    -} - -templ ServiceWorker(path string) { - -} - -templ defaultStyles() { - - - - - - - - - -} - -templ Rows() { -
    - { children... } -
    -} - -templ Columns() { -
    - { children... } -
    -} - -css main() { - font-family: R-Flex, system-ui, Avenir, Helvetica, Arial, sans-serif; -} diff --git a/internal/gui/elements/global_templ.go b/internal/gui/elements/global_templ.go deleted file mode 100644 index d9a36c6e7..000000000 --- a/internal/gui/elements/global_templ.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func Layout(title string) 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_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = defaultStyles().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 - } - 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: `internal/gui/elements/global.templ`, Line: 8, Col: 17} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - 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 = templ_7745c5c3_Var1.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 - } - return templ_7745c5c3_Err - }) -} - -func Spacer() 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_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func ServiceWorker(path string) 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_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func defaultStyles() 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_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func Rows() 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_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var6.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 - } - return templ_7745c5c3_Err - }) -} - -func Columns() 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_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var7.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 - } - return templ_7745c5c3_Err - }) -} - -func main() templ.CSSClass { - templ_7745c5c3_CSSBuilder := templruntime.GetBuilder() - templ_7745c5c3_CSSBuilder.WriteString(`font-family:R-Flex, system-ui, Avenir, Helvetica, Arial, sans-serif;`) - templ_7745c5c3_CSSID := templ.CSSID(`main`, templ_7745c5c3_CSSBuilder.String()) - return templ.ComponentCSSClass{ - ID: templ_7745c5c3_CSSID, - Class: templ.SafeCSS(`.` + templ_7745c5c3_CSSID + `{` + templ_7745c5c3_CSSBuilder.String() + `}`), - } -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/icons.templ b/internal/gui/elements/icons.templ deleted file mode 100644 index b13e3fd4a..000000000 --- a/internal/gui/elements/icons.templ +++ /dev/null @@ -1,31 +0,0 @@ -package elements - -type Icons int - -const ( - Icons_Info Icons = iota - Icons_Error - Icons_Success - Icons_Warning -) - -func (v Icons) Render() templ.Component { - return renderIconVariant(v) -} - -templ renderIconVariant(v Icons) { - switch v { - case Icons_Info: - - case Icons_Error: - - case Icons_Success: - - case Icons_Warning: - - } - -} - -templ SonrIcon() { -} diff --git a/internal/gui/elements/icons_templ.go b/internal/gui/elements/icons_templ.go deleted file mode 100644 index 1b45bb48f..000000000 --- a/internal/gui/elements/icons_templ.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -type Icons int - -const ( - Icons_Info Icons = iota - Icons_Error - Icons_Success - Icons_Warning -) - -func (v Icons) Render() templ.Component { - return renderIconVariant(v) -} - -func renderIconVariant(v Icons) 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) - switch v { - case Icons_Info: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case Icons_Error: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case Icons_Success: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case Icons_Warning: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - 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 - } - return templ_7745c5c3_Err - }) -} - -func SonrIcon() 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/inputs.templ b/internal/gui/elements/inputs.templ deleted file mode 100644 index 73227660a..000000000 --- a/internal/gui/elements/inputs.templ +++ /dev/null @@ -1,29 +0,0 @@ -package elements - -type InputState int - -const ( - InputStateDefault InputState = iota - InputStateError - InputStateSuccess -) - -templ TextInput(state InputState, label string, placeholder string) { - switch (state) { - case InputStateDefault: -
    - - -
    - case InputStateError: -
    - - -
    - case InputStateSuccess: -
    - - -
    - } -} diff --git a/internal/gui/elements/inputs_templ.go b/internal/gui/elements/inputs_templ.go deleted file mode 100644 index 545265f72..000000000 --- a/internal/gui/elements/inputs_templ.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -type InputState int - -const ( - InputStateDefault InputState = iota - InputStateError - InputStateSuccess -) - -func TextInput(state InputState, label string, placeholder string) 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) - switch state { - case InputStateDefault: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case InputStateError: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case InputStateSuccess: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/radios.templ b/internal/gui/elements/radios.templ deleted file mode 100644 index 0200e04cd..000000000 --- a/internal/gui/elements/radios.templ +++ /dev/null @@ -1,37 +0,0 @@ -package elements - -templ RadioGroup() { -
    - -
    -} diff --git a/internal/gui/elements/radios_templ.go b/internal/gui/elements/radios_templ.go deleted file mode 100644 index 0f69a82fa..000000000 --- a/internal/gui/elements/radios_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func RadioGroup() 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_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/sizes.templ b/internal/gui/elements/sizes.templ deleted file mode 100644 index 40e70998d..000000000 --- a/internal/gui/elements/sizes.templ +++ /dev/null @@ -1,61 +0,0 @@ -package elements - -type Size int - -const ( - SizeDefault Size = iota - SizeSmall - SizeMedium - SizeLarge -) - -func (s Size) CardAttributes() templ.Attributes { - switch s { - case SizeSmall: - return templ.Attributes{ - "class": "max-w-lg bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", - } - case SizeLarge: - return templ.Attributes{ - "class": "max-w-2xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", - } - } - return templ.Attributes{ - "class": "max-w-xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", - } -} - -func (s Size) SvgAttributes() templ.Attributes { - switch s { - case SizeSmall: - return templ.Attributes{ - "height": "16", - "width": "16", - } - case SizeLarge: - return templ.Attributes{ - "height": "32", - "width": "32", - } - } - return templ.Attributes{ - "height": "24", - "width": "24", - } -} - -func (s Size) TextAttributes() templ.Attributes { - switch s { - case SizeSmall: - return templ.Attributes{ - "class": "text-sm", - } - case SizeLarge: - return templ.Attributes{ - "class": "text-lg", - } - } - return templ.Attributes{ - "class": "text-md", - } -} diff --git a/internal/gui/elements/sizes_templ.go b/internal/gui/elements/sizes_templ.go deleted file mode 100644 index 5a60b8fef..000000000 --- a/internal/gui/elements/sizes_templ.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -type Size int - -const ( - SizeDefault Size = iota - SizeSmall - SizeMedium - SizeLarge -) - -func (s Size) CardAttributes() templ.Attributes { - switch s { - case SizeSmall: - return templ.Attributes{ - "class": "max-w-lg bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", - } - case SizeLarge: - return templ.Attributes{ - "class": "max-w-2xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", - } - } - return templ.Attributes{ - "class": "max-w-xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", - } -} - -func (s Size) SvgAttributes() templ.Attributes { - switch s { - case SizeSmall: - return templ.Attributes{ - "height": "16", - "width": "16", - } - case SizeLarge: - return templ.Attributes{ - "height": "32", - "width": "32", - } - } - return templ.Attributes{ - "height": "24", - "width": "24", - } -} - -func (s Size) TextAttributes() templ.Attributes { - switch s { - case SizeSmall: - return templ.Attributes{ - "class": "text-sm", - } - case SizeLarge: - return templ.Attributes{ - "class": "text-lg", - } - } - return templ.Attributes{ - "class": "text-md", - } -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/tabs.templ b/internal/gui/elements/tabs.templ deleted file mode 100644 index 8b478f482..000000000 --- a/internal/gui/elements/tabs.templ +++ /dev/null @@ -1,109 +0,0 @@ -package elements - -templ Tabs() { -
    -
    - - - -
    -
    -
    -
    - @Table() -
    -
    - And, this is the content for Tab2 -
    -
    - Finally, this is the content for Tab3 -
    -
    -
    -} - -templ Table() { -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameAgeAddressAction
    Richard Hendricks30Pied Piper HQ, Palo Alto - Edit -
    Erlich Bachman405230 Penfield Ave, Woodland Hills - Edit -
    Monica Hall352030 Stewart Drive, Sunnyvale - Edit -
    Dinesh Chugtai28Pied Piper HQ, Palo Alto - Edit -
    Gilfoyle32Pied Piper HQ, Palo Alto - Edit -
    -
    -
    -
    -
    -} diff --git a/internal/gui/elements/tabs_templ.go b/internal/gui/elements/tabs_templ.go deleted file mode 100644 index 9b974744e..000000000 --- a/internal/gui/elements/tabs_templ.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package elements - -//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" - -func Tabs() 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_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Table().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    And, this is the content for Tab2
    Finally, this is the content for Tab3
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func Table() 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    NameAgeAddressAction
    Richard Hendricks30Pied Piper HQ, Palo AltoEdit
    Erlich Bachman405230 Penfield Ave, Woodland HillsEdit
    Monica Hall352030 Stewart Drive, SunnyvaleEdit
    Dinesh Chugtai28Pied Piper HQ, Palo AltoEdit
    Gilfoyle32Pied Piper HQ, Palo AltoEdit
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/forms/forms.go b/internal/gui/forms/forms.go deleted file mode 100644 index 0b7e1ad5f..000000000 --- a/internal/gui/forms/forms.go +++ /dev/null @@ -1,41 +0,0 @@ -package forms - -import ( - "bytes" - - "github.com/a-h/templ" - "github.com/labstack/echo/v4" -) - -func echoFormResponse(c echo.Context, cmp templ.Component, state FormState) 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) - c.Response().Header().Set("X-Status", string(state)) - - // Write the buffered content to the response - _, err = c.Response().Write(buf.Bytes()) - return err -} - -type FormState string - -const ( - InitialForm FormState = "initial" - ErrorForm FormState = "error" - SuccessForm FormState = "success" - WarningForm FormState = "warning" -) - -type Form struct { - State FormState - Title string - Description string -} diff --git a/internal/gui/forms/register_templ.go b/internal/gui/forms/register_templ.go deleted file mode 100644 index a9309199a..000000000 --- a/internal/gui/forms/register_templ.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package forms - -//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" - -func BasicInfo(c echo.Context, state FormState) 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) - switch state { - default: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    Account

    Make changes to your account here. Click save when you're done.

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return templ_7745c5c3_Err - }) -} - -func CreateCredentials(state FormState) 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - return templ_7745c5c3_Err - }) -} - -func PrivacyTerms(state FormState) 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_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/views/home.templ b/internal/gui/views/home.templ deleted file mode 100644 index 34b505522..000000000 --- a/internal/gui/views/home.templ +++ /dev/null @@ -1,29 +0,0 @@ -package views - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/gui/elements" -) - -func HomeView(c echo.Context) error { - return echoComponentResponse(c, renderHomeView()) -} - -templ renderHomeView() { - @elements.Layout("Sonr.ID") { - @elements.Card("home-view", elements.SizeLarge) { - @elements.H1("Sonr.ID") - @elements.Text("A Decentralized Web Node Client for the Sonr Network.") - @elements.Spacer() -
    - @elements.Button(elements.GET("/register", "#home-view"), elements.PrimaryButtonStyle()) { - @elements.Text("Get Started") - } - @elements.Button(elements.GET("/login", "#home-view")) { - @elements.Text("Login") - } -
    - @elements.PoweredBySonr() - } - } -} diff --git a/internal/gui/views/home_templ.go b/internal/gui/views/home_templ.go deleted file mode 100644 index 1254e7d14..000000000 --- a/internal/gui/views/home_templ.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package views - -//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/internal/gui/elements" -) - -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_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 = elements.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 = elements.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 = elements.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_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 = elements.Text("Get Started").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Button(elements.GET("/register", "#home-view"), elements.PrimaryButtonStyle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var5 := 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 = elements.Text("Login").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Button(elements.GET("/login", "#home-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), 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 = elements.PoweredBySonr().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Card("home-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Layout("Sonr.ID").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/internal/gui/views/login.templ b/internal/gui/views/login.templ deleted file mode 100644 index 601dc0aae..000000000 --- a/internal/gui/views/login.templ +++ /dev/null @@ -1,25 +0,0 @@ -package views - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/gui/elements" -) - -func LoginView(c echo.Context) error { - return echoComponentResponse(c, renderLoginView()) -} - -templ renderLoginView() { - @elements.Layout("Login | Sonr.ID") { - @elements.Card("login-view", elements.SizeLarge) { - @elements.H1("Sonr.ID") - @elements.Text("Neo-tree is a file manager for NeoFS.") - @elements.Spacer() - @elements.RadioGroup() - @elements.Spacer() - @elements.Button(elements.GET("/", "#login-view")) { - @elements.Text("Cancel") - } - } - } -} diff --git a/internal/gui/views/login_templ.go b/internal/gui/views/login_templ.go deleted file mode 100644 index 87d103eb0..000000000 --- a/internal/gui/views/login_templ.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package views - -//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/internal/gui/elements" -) - -func LoginView(c echo.Context) error { - return echoComponentResponse(c, renderLoginView()) -} - -func renderLoginView() 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_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 = elements.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 = elements.Text("Neo-tree is a file manager for NeoFS.").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 = elements.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_Err = elements.RadioGroup().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 = elements.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_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 = elements.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Button(elements.GET("/", "#login-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Card("login-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Layout("Login | Sonr.ID").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/internal/gui/views/openid.templ b/internal/gui/views/openid.templ deleted file mode 100644 index f09cdc270..000000000 --- a/internal/gui/views/openid.templ +++ /dev/null @@ -1,19 +0,0 @@ -package views - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/gui/elements" -) - -func AuthorizeView(c echo.Context) error { - return echoComponentResponse(c, renderAuthorizeView()) -} - -templ renderAuthorizeView() { - @elements.Layout("Login | Sonr.ID") { - @elements.Card("authorize-view", elements.SizeMedium) { - @elements.H1("Sonr.ID") - @elements.Text("Neo-tree is a file manager for NeoFS.") - } - } -} diff --git a/internal/gui/views/openid_templ.go b/internal/gui/views/openid_templ.go deleted file mode 100644 index d0c6a899a..000000000 --- a/internal/gui/views/openid_templ.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package views - -//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/internal/gui/elements" -) - -func AuthorizeView(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_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 = elements.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 = elements.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 = elements.Card("authorize-view", elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Layout("Login | Sonr.ID").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/internal/gui/views/profile.templ b/internal/gui/views/profile.templ deleted file mode 100644 index 25c272e99..000000000 --- a/internal/gui/views/profile.templ +++ /dev/null @@ -1,19 +0,0 @@ -package views - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/gui/elements" -) - -func ProfileView(c echo.Context) error { - return echoComponentResponse(c, renderProfileView()) -} - -templ renderProfileView() { - @elements.Layout("Profile | Sonr.ID") { - @elements.Card("profile-view", elements.SizeLarge) { - @elements.ProfileCard() - @elements.Tabs() - } - } -} diff --git a/internal/gui/views/profile_templ.go b/internal/gui/views/profile_templ.go deleted file mode 100644 index 08af9920c..000000000 --- a/internal/gui/views/profile_templ.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package views - -//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/internal/gui/elements" -) - -func ProfileView(c echo.Context) error { - return echoComponentResponse(c, renderProfileView()) -} - -func renderProfileView() 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_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 = elements.ProfileCard().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 = elements.Tabs().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Card("profile-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Layout("Profile | Sonr.ID").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/internal/gui/views/register.templ b/internal/gui/views/register.templ deleted file mode 100644 index 076d4d992..000000000 --- a/internal/gui/views/register.templ +++ /dev/null @@ -1,26 +0,0 @@ -package views - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/gui/elements" - "github.com/onsonr/sonr/internal/gui/forms" -) - -func RegisterView(c echo.Context) error { - return echoComponentResponse(c, renderRegisterView(c)) -} - -templ renderRegisterView(c echo.Context) { - @elements.Layout("Register | Sonr.ID") { - @elements.Card("register-view", elements.SizeMedium) { - @elements.H2("Account Registration") - @elements.Spacer() - @elements.Breadcrumbs() - @forms.BasicInfo(c, forms.InitialForm) - @elements.Spacer() - @elements.Button(elements.GET("/", "#register-view")) { - @elements.Text("Cancel") - } - } - } -} diff --git a/internal/gui/views/register_templ.go b/internal/gui/views/register_templ.go deleted file mode 100644 index d54ee67bd..000000000 --- a/internal/gui/views/register_templ.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package views - -//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/internal/gui/elements" - "github.com/onsonr/sonr/internal/gui/forms" -) - -func RegisterView(c echo.Context) error { - return echoComponentResponse(c, renderRegisterView(c)) -} - -func renderRegisterView(c echo.Context) 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_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 = elements.H2("Account Registration").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 = elements.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_Err = elements.Breadcrumbs().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 = forms.BasicInfo(c, forms.InitialForm).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 = elements.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_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 = elements.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Button(elements.GET("/", "#register-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Card("register-view", elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Layout("Register | Sonr.ID").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/internal/gui/views/views.go b/internal/gui/views/views.go deleted file mode 100644 index cc62f7aed..000000000 --- a/internal/gui/views/views.go +++ /dev/null @@ -1,27 +0,0 @@ -package views - -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/internal/mdw/authz.go b/internal/mdw/authz.go deleted file mode 100644 index c9fcc5153..000000000 --- a/internal/mdw/authz.go +++ /dev/null @@ -1,95 +0,0 @@ -package mdw - -import ( - "fmt" - "net/http" - "time" - - "github.com/labstack/echo/v4" - "gopkg.in/macaroon.v2" -) - -const ( - OriginMacroonCaveat MacroonCaveat = "origin" - ScopesMacroonCaveat MacroonCaveat = "scopes" - SubjectMacroonCaveat MacroonCaveat = "subject" - ExpMacroonCaveat MacroonCaveat = "exp" - TokenMacroonCaveat MacroonCaveat = "token" -) - -type MacroonCaveat string - -func (c MacroonCaveat) Equal(other string) bool { - return string(c) == other -} - -func (c MacroonCaveat) String() string { - return string(c) -} - -func (c MacroonCaveat) Verify(value string) error { - switch c { - case OriginMacroonCaveat: - return nil - case ScopesMacroonCaveat: - return nil - case SubjectMacroonCaveat: - return nil - case ExpMacroonCaveat: - // Check if the expiration time is still valid - exp, err := time.Parse(time.RFC3339, value) - if err != nil { - return err - } - if time.Now().After(exp) { - return fmt.Errorf("expired") - } - return nil - case TokenMacroonCaveat: - return nil - default: - return fmt.Errorf("unknown caveat: %s", c) - } -} - -var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat} - -func MacaroonMiddleware(secretKeyStr string, location string) echo.MiddlewareFunc { - secretKey := []byte(secretKeyStr) - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - // Extract the macaroon from the Authorization header - auth := c.Request().Header.Get("Authorization") - if auth == "" { - return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Missing Authorization header"}) - } - - // Decode the macaroon - mac, err := macaroon.Base64Decode([]byte(auth)) - if err != nil { - return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon encoding"}) - } - - token, err := macaroon.New(secretKey, mac, location, macaroon.LatestVersion) - if err != nil { - return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon"}) - } - - // Verify the macaroon - err = token.Verify(secretKey, func(caveat string) error { - for _, c := range MacroonCaveats { - if c.String() == caveat { - return nil - } - } - return nil // Return nil if the caveat is valid - }, nil) - if err != nil { - return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Invalid macaroon"}) - } - - // Macaroon is valid, proceed to the next handler - return next(c) - } - } -} diff --git a/internal/mdw/client.go b/internal/mdw/client.go deleted file mode 100644 index c7be79ac1..000000000 --- a/internal/mdw/client.go +++ /dev/null @@ -1,3 +0,0 @@ -package mdw - -type AuthClient struct{} diff --git a/internal/mdw/headers.go b/internal/mdw/headers.go deleted file mode 100644 index 68fa253ed..000000000 --- a/internal/mdw/headers.go +++ /dev/null @@ -1,55 +0,0 @@ -package mdw - -type RequestHeaders struct { - Authorization *string `header:"Authorization"` - CacheControl *string `header:"Cache-Control"` - DeviceMemory *string `header:"Device-Memory"` - Forwarded *string `header:"Forwarded"` - From *string `header:"From"` - Host *string `header:"Host"` - Link *string `header:"Link"` - PermissionsPolicy *string `header:"Permissions-Policy"` - ProxyAuthorization *string `header:"Proxy-Authorization"` - Referer *string `header:"Referer"` - UserAgent *string `header:"User-Agent"` - ViewportWidth *string `header:"Viewport-Width"` - Width *string `header:"Width"` - WWWAuthenticate *string `header:"WWW-Authenticate"` - - // HTMX Specific - HXBoosted *string `header:"HX-Boosted"` - HXCurrentURL *string `header:"HX-Current-URL"` - HXHistoryRestoreRequest *string `header:"HX-History-Restore-Request"` - HXPrompt *string `header:"HX-Prompt"` - HXRequest *string `header:"HX-Request"` - HXTarget *string `header:"HX-Target"` - HXTriggerName *string `header:"HX-Trigger-Name"` - HXTrigger *string `header:"HX-Trigger"` -} - -type ResponseHeaders struct { - AcceptCH *string `header:"Accept-CH"` - AccessControlAllowCredentials *string `header:"Access-Control-Allow-Credentials"` - AccessControlAllowHeaders *string `header:"Access-Control-Allow-Headers"` - AccessControlAllowMethods *string `header:"Access-Control-Allow-Methods"` - AccessControlExposeHeaders *string `header:"Access-Control-Expose-Headers"` - AccessControlRequestHeaders *string `header:"Access-Control-Request-Headers"` - ContentSecurityPolicy *string `header:"Content-Security-Policy"` - CrossOriginEmbedderPolicy *string `header:"Cross-Origin-Embedder-Policy"` - PermissionsPolicy *string `header:"Permissions-Policy"` - ProxyAuthorization *string `header:"Proxy-Authorization"` - WWWAuthenticate *string `header:"WWW-Authenticate"` - - // HTMX Specific - HXLocation *string `header:"HX-Location"` - HXPushURL *string `header:"HX-Push-Url"` - HXRedirect *string `header:"HX-Redirect"` - HXRefresh *string `header:"HX-Refresh"` - HXReplaceURL *string `header:"HX-Replace-Url"` - HXReswap *string `header:"HX-Reswap"` - HXRetarget *string `header:"HX-Retarget"` - HXReselect *string `header:"HX-Reselect"` - HXTrigger *string `header:"HX-Trigger"` - HXTriggerAfterSettle *string `header:"HX-Trigger-After-Settle"` - HXTriggerAfterSwap *string `header:"HX-Trigger-After-Swap"` -} diff --git a/internal/mdw/session.go b/internal/mdw/session.go deleted file mode 100644 index 8907bc1e2..000000000 --- a/internal/mdw/session.go +++ /dev/null @@ -1,72 +0,0 @@ -package mdw - -import ( - "net/http" - "time" - - "github.com/donseba/go-htmx" - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/db" - "github.com/segmentio/ksuid" -) - -type Session struct { - echo.Context - htmx *htmx.HTMX - dB *db.DB -} - -// GetSession returns the current Session -func GetSession(c echo.Context) *Session { - return c.(*Session) -} - -// UseSession establishes a Session Cookie. -func UseSession(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - sc := initSession(c) - headers := new(RequestHeaders) - sc.Bind(headers) - return next(sc) - } -} - -func (c *Session) DB() *db.DB { - return c.dB -} - -func (c *Session) Htmx() *htmx.HTMX { - return c.htmx -} - -func (c *Session) ID() string { - return readCookie(c, "session") -} - -func initSession(c echo.Context) *Session { - s := &Session{Context: c} - if val := readCookie(c, "session"); val == "" { - id := ksuid.New().String() - writeCookie(c, "session", id) - } - return s -} - -func readCookie(c echo.Context, key string) string { - cookie, err := c.Cookie(key) - if err != nil { - return "" - } - if cookie == nil { - return "" - } - return cookie.Value -} - -func writeCookie(c echo.Context, key string, value string) { - cookie := new(http.Cookie) - cookie.Name = key - cookie.Value = value - cookie.Expires = time.Now().Add(24 * time.Hour) - c.SetCookie(cookie) -} 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/internal/svc/openid.go b/internal/svc/openid.go deleted file mode 100644 index 78b97119f..000000000 --- a/internal/svc/openid.go +++ /dev/null @@ -1,46 +0,0 @@ -package svc - -import ( - "fmt" - - "github.com/labstack/echo/v4" - oidc "github.com/onsonr/sonr/x/did/types/oidc" -) - -func GrantAuthorization(e echo.Context) error { - // Implement authorization endpoint using passkey authentication - // Store session data in cache - return nil -} - -func GetJWKS(e echo.Context) error { - // Implement token endpoint - // Use cached session data for validation - return nil -} - -func GetToken(e echo.Context) error { - // Implement token endpoint - // Use cached session data for validation - return nil -} - -func GetDiscovery(e echo.Context) error { - baseURL := "https://" + e.Request().Host // Ensure this is the correct base URL for your service - discoveryDoc := &oidc.DiscoveryDocument{ - Issuer: baseURL, - AuthorizationEndpoint: fmt.Sprintf("%s/auth", baseURL), - TokenEndpoint: fmt.Sprintf("%s/token", baseURL), - UserinfoEndpoint: fmt.Sprintf("%s/userinfo", baseURL), - JwksUri: fmt.Sprintf("%s/jwks", baseURL), - RegistrationEndpoint: fmt.Sprintf("%s/register", baseURL), - ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"}, - ResponseTypesSupported: []string{"code"}, - ResponseModesSupported: []string{"query", "form_post"}, - GrantTypesSupported: []string{"authorization_code", "refresh_token"}, - AcrValuesSupported: []string{"passkey"}, - SubjectTypesSupported: []string{"public"}, - ClaimsSupported: []string{"sub", "iss", "name", "email"}, - } - return e.JSON(200, discoveryDoc) -} diff --git a/internal/svc/webauth.go b/internal/svc/webauth.go deleted file mode 100644 index ac08255c7..000000000 --- a/internal/svc/webauth.go +++ /dev/null @@ -1,43 +0,0 @@ -package svc - -import ( - "encoding/json" - "fmt" - - "github.com/go-webauthn/webauthn/protocol" - "github.com/labstack/echo/v4" -) - -func CheckSubjectIsValid(e echo.Context) error { - credentialID := e.FormValue("credentialID") - return e.JSON(200, credentialID) -} - -func HandleCredentialAssertion(e echo.Context) error { - return e.JSON(200, "HandleCredentialAssertion") -} - -func HandleCredentialCreation(e echo.Context) error { - // Get the serialized credential data from the form - credentialDataJSON := e.FormValue("credentialData") - - // Deserialize the JSON into a temporary struct - var ccr protocol.CredentialCreationResponse - err := json.Unmarshal([]byte(credentialDataJSON), &ccr) - if err != nil { - return e.JSON(500, err.Error()) - } - // - // // Parse the CredentialCreationResponse - // parsedData, err := ccr.Parse() - // if err != nil { - // return e.JSON(500, err.Error()) - // } - // - // // Create the Credential - // // credential := orm.NewCredential(parsedData, e.Request().Host, "") - // - // // Set additional fields - // credential.Controller = "" // Set this to the appropriate controller value - return e.JSON(200, fmt.Sprintf("REGISTER: %s", string(ccr.ID))) -} diff --git a/internal/tui/authmodel/authmodel.go b/internal/tui/authmodel/authmodel.go deleted file mode 100644 index 2f83c115f..000000000 --- a/internal/tui/authmodel/authmodel.go +++ /dev/null @@ -1,322 +0,0 @@ -package txmodel - -import ( - "fmt" - "strings" - - tea "github.com/charmbracelet/bubbletea" - "github.com/charmbracelet/huh" - "github.com/charmbracelet/lipgloss" - "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/tx" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -const maxWidth = 100 - -var ( - red = lipgloss.AdaptiveColor{Light: "#FE5F86", Dark: "#FE5F86"} - indigo = lipgloss.AdaptiveColor{Light: "#5A56E0", Dark: "#7571F9"} - green = lipgloss.AdaptiveColor{Light: "#02BA84", Dark: "#02BF87"} -) - -type Styles struct { - Base, - HeaderText, - Status, - StatusHeader, - Highlight, - ErrorHeaderText, - Help lipgloss.Style -} - -func NewStyles(lg *lipgloss.Renderer) *Styles { - s := Styles{} - s.Base = lg.NewStyle(). - Padding(1, 2, 0, 1) - s.HeaderText = lg.NewStyle(). - Foreground(indigo). - Bold(true). - Padding(0, 1, 0, 1) - s.Status = lg.NewStyle(). - Border(lipgloss.RoundedBorder()). - BorderForeground(indigo). - PaddingLeft(1). - MarginTop(1) - s.StatusHeader = lg.NewStyle(). - Foreground(green). - Bold(true) - s.Highlight = lg.NewStyle(). - Foreground(lipgloss.Color("212")) - s.ErrorHeaderText = s.HeaderText. - Foreground(red) - s.Help = lg.NewStyle(). - Foreground(lipgloss.Color("240")) - return &s -} - -type state int - -const ( - statusNormal state = iota - stateDone -) - -type Model struct { - state state - lg *lipgloss.Renderer - styles *Styles - form *huh.Form - width int - message *tx.TxBody -} - -func NewModel() Model { - m := Model{width: maxWidth} - m.lg = lipgloss.DefaultRenderer() - m.styles = NewStyles(m.lg) - - m.form = huh.NewForm( - huh.NewGroup( - huh.NewInput(). - Key("from"). - Title("From Address"). - Placeholder("cosmos1..."). - Validate(func(s string) error { - if !strings.HasPrefix(s, "cosmos1") { - return fmt.Errorf("invalid address format") - } - return nil - }), - - huh.NewInput(). - Key("to"). - Title("To Address"). - Placeholder("cosmos1..."). - Validate(func(s string) error { - if !strings.HasPrefix(s, "cosmos1") { - return fmt.Errorf("invalid address format") - } - return nil - }), - - huh.NewInput(). - Key("amount"). - Title("Amount"). - Placeholder("100"). - Validate(func(s string) error { - if _, err := sdk.ParseCoinNormalized(s + "atom"); err != nil { - return fmt.Errorf("invalid coin amount") - } - return nil - }), - - huh.NewSelect[string](). - Key("denom"). - Title("Denom"). - Options(huh.NewOptions("atom", "osmo", "usnr", "snr")...), - - huh.NewInput(). - Key("memo"). - Title("Memo"). - Placeholder("Optional"), - - huh.NewConfirm(). - Key("done"). - Title("Ready to convert?"). - Validate(func(v bool) error { - if !v { - return fmt.Errorf("Please confirm when you're ready to convert") - } - return nil - }). - Affirmative("Yes, convert!"). - Negative("Not yet"), - ), - ). - WithWidth(60). - WithShowHelp(false). - WithShowErrors(false) - - return m -} - -func (m Model) Init() tea.Cmd { - return m.form.Init() -} - -func min(x, y int) int { - if x > y { - return y - } - return x -} - -func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { - switch msg := msg.(type) { - case tea.WindowSizeMsg: - m.width = min(msg.Width, maxWidth) - m.styles.Base.GetHorizontalFrameSize() - case tea.KeyMsg: - switch msg.String() { - case "esc", "ctrl+c", "q": - return m, tea.Quit - } - } - - var cmds []tea.Cmd - - form, cmd := m.form.Update(msg) - if f, ok := form.(*huh.Form); ok { - m.form = f - cmds = append(cmds, cmd) - } - - if m.form.State == huh.StateCompleted { - m.buildMessage() - cmds = append(cmds, tea.Quit) - } - - return m, tea.Batch(cmds...) -} - -func (m Model) View() string { - s := m.styles - - switch m.form.State { - case huh.StateCompleted: - pklCode := m.generatePkl() - messageView := m.getMessageView() - var b strings.Builder - fmt.Fprintf(&b, "Final Tx:\n\n%s\n\n%s", pklCode, messageView) - return s.Status.Margin(0, 1).Padding(1, 2).Width(80).Render(b.String()) + "\n\n" - default: - var schemaType string - if m.form.GetString("schemaType") != "" { - schemaType = "Schema Type: " + m.form.GetString("schemaType") - } - - v := strings.TrimSuffix(m.form.View(), "\n\n") - form := m.lg.NewStyle().Margin(1, 0).Render(v) - - var status string - { - preview := "(Preview will appear here)" - if m.form.GetString("schema") != "" { - preview = m.generatePkl() - } - - const statusWidth = 40 - statusMarginLeft := m.width - statusWidth - lipgloss.Width(form) - s.Status.GetMarginRight() - status = s.Status. - Height(lipgloss.Height(form)). - Width(statusWidth). - MarginLeft(statusMarginLeft). - Render(s.StatusHeader.Render("Pkl Preview") + "\n" + - schemaType + "\n\n" + - preview) - } - - errors := m.form.Errors() - header := m.appBoundaryView("Sonr TX Builder") - if len(errors) > 0 { - header = m.appErrorBoundaryView(m.errorView()) - } - body := lipgloss.JoinHorizontal(lipgloss.Top, form, status) - - footer := m.appBoundaryView(m.form.Help().ShortHelpView(m.form.KeyBinds())) - if len(errors) > 0 { - footer = m.appErrorBoundaryView("") - } - - return s.Base.Render(header + "\n" + body + "\n\n" + footer) - } -} - -func (m Model) errorView() string { - var s string - for _, err := range m.form.Errors() { - s += err.Error() - } - return s -} - -func (m Model) appBoundaryView(text string) string { - return lipgloss.PlaceHorizontal( - m.width, - lipgloss.Left, - m.styles.HeaderText.Render(text), - lipgloss.WithWhitespaceChars("="), - lipgloss.WithWhitespaceForeground(indigo), - ) -} - -func (m Model) appErrorBoundaryView(text string) string { - return lipgloss.PlaceHorizontal( - m.width, - lipgloss.Left, - m.styles.ErrorHeaderText.Render(text), - lipgloss.WithWhitespaceChars("="), - lipgloss.WithWhitespaceForeground(red), - ) -} - -func (m Model) generatePkl() string { - schemaType := m.form.GetString("schemaType") - schema := m.form.GetString("schema") - - // This is a placeholder for the actual conversion logic - // In a real implementation, you would parse the schema and generate Pkl code - return fmt.Sprintf("// Converted from %s\n\nclass ConvertedSchema {\n // TODO: Implement conversion from %s\n // Original schema:\n /*\n%s\n */\n}", schemaType, schemaType, schema) -} - -func (m *Model) buildMessage() { - from := m.form.GetString("from") - to := m.form.GetString("to") - amount := m.form.GetString("amount") - denom := m.form.GetString("denom") - memo := m.form.GetString("memo") - - coin, _ := sdk.ParseCoinNormalized(fmt.Sprintf("%s%s", amount, denom)) - sendMsg := &banktypes.MsgSend{ - FromAddress: from, - ToAddress: to, - Amount: sdk.NewCoins(coin), - } - - anyMsg, _ := codectypes.NewAnyWithValue(sendMsg) - m.message = &tx.TxBody{ - Messages: []*codectypes.Any{anyMsg}, - Memo: memo, - } -} - -func (m Model) getMessageView() string { - if m.message == nil { - return "Current Message: None" - } - - interfaceRegistry := codectypes.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) - jsonBytes, _ := marshaler.MarshalJSON(m.message) - - return fmt.Sprintf("Current Message:\n%s", string(jsonBytes)) -} - -func RunTUIForm() (*tx.TxBody, error) { - m := NewModel() - p := tea.NewProgram(m) - - finalModel, err := p.Run() - if err != nil { - return nil, fmt.Errorf("failed to run program: %w", err) - } - - finalM, ok := finalModel.(Model) - if !ok || finalM.message == nil { - return nil, fmt.Errorf("form not completed") - } - - return finalM.message, nil -} diff --git a/internal/tui/dexmodel/dexmodel.go b/internal/tui/dexmodel/dexmodel.go deleted file mode 100644 index c6a77a8d8..000000000 --- a/internal/tui/dexmodel/dexmodel.go +++ /dev/null @@ -1,165 +0,0 @@ -package dexmodel - -import ( - "fmt" - "time" - - "github.com/charmbracelet/bubbles/table" - tea "github.com/charmbracelet/bubbletea" - "github.com/charmbracelet/lipgloss" - "github.com/spf13/cobra" -) - -var ( - subtle = lipgloss.AdaptiveColor{Light: "#D9DCCF", Dark: "#383838"} - highlight = lipgloss.AdaptiveColor{Light: "#874BFD", Dark: "#7D56F4"} - special = lipgloss.AdaptiveColor{Light: "#43BF6D", Dark: "#73F59F"} - - titleStyle = lipgloss.NewStyle(). - MarginLeft(1). - MarginRight(5). - Padding(0, 1). - Italic(true). - Foreground(lipgloss.Color("#FFF7DB")). - SetString("Cosmos Block Explorer") - - infoStyle = lipgloss.NewStyle(). - BorderStyle(lipgloss.NormalBorder()). - BorderTop(true). - BorderForeground(subtle) -) - -type model struct { - blocks []string - transactionTable table.Model - stats map[string]string - width int - height int -} - -func initialModel() model { - columns := []table.Column{ - {Title: "Hash", Width: 10}, - {Title: "Type", Width: 15}, - {Title: "Height", Width: 10}, - {Title: "Time", Width: 20}, - } - - rows := []table.Row{ - {"abc123", "Transfer", "1000", time.Now().Format(time.RFC3339)}, - {"def456", "Delegate", "999", time.Now().Add(-1 * time.Minute).Format(time.RFC3339)}, - {"ghi789", "Vote", "998", time.Now().Add(-2 * time.Minute).Format(time.RFC3339)}, - } - - t := table.New( - table.WithColumns(columns), - table.WithRows(rows), - table.WithFocused(true), - table.WithHeight(7), - ) - - s := table.DefaultStyles() - s.Header = s.Header. - BorderStyle(lipgloss.NormalBorder()). - BorderForeground(lipgloss.Color("240")). - BorderBottom(true). - Bold(false) - s.Selected = s.Selected. - Foreground(lipgloss.Color("229")). - Background(lipgloss.Color("57")). - Bold(false) - t.SetStyles(s) - - return model{ - blocks: []string{"Block 1", "Block 2", "Block 3"}, - transactionTable: t, - stats: map[string]string{ - "Latest Block": "1000", - "Validators": "100", - "Bonded Tokens": "1,000,000", - }, - } -} - -func (m model) Init() tea.Cmd { - return tick -} - -func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { - var cmd tea.Cmd - switch msg := msg.(type) { - case tea.KeyMsg: - switch msg.String() { - case "q", "ctrl+c": - return m, tea.Quit - case "enter": - return m, tea.Batch( - tea.Printf("Selected transaction: %s", m.transactionTable.SelectedRow()[0]), - ) - } - case tea.WindowSizeMsg: - m.height = msg.Height - m.width = msg.Width - case tickMsg: - // Update data here - m.blocks = append([]string{"New Block"}, m.blocks...) - if len(m.blocks) > 5 { - m.blocks = m.blocks[:5] - } - - // Add a new transaction to the table - newRow := table.Row{ - fmt.Sprintf("tx%d", time.Now().Unix()), - "NewTxType", - fmt.Sprintf("%d", 1000+len(m.transactionTable.Rows())), - time.Now().Format(time.RFC3339), - } - m.transactionTable.SetRows(append([]table.Row{newRow}, m.transactionTable.Rows()...)) - if len(m.transactionTable.Rows()) > 10 { - m.transactionTable.SetRows(m.transactionTable.Rows()[:10]) - } - - return m, tick - } - m.transactionTable, cmd = m.transactionTable.Update(msg) - return m, cmd -} - -func (m model) View() string { - s := titleStyle.Render("Cosmos Block Explorer") - s += "\n\n" - - // Blocks - s += lipgloss.NewStyle().Bold(true).Render("Recent Blocks") + "\n" - for _, block := range m.blocks { - s += "• " + block + "\n" - } - s += "\n" - - // Transactions - s += lipgloss.NewStyle().Bold(true).Render("Recent Transactions") + "\n" - s += m.transactionTable.View() + "\n\n" - - // Stats - s += lipgloss.NewStyle().Bold(true).Render("Network Statistics") + "\n" - for key, value := range m.stats { - s += fmt.Sprintf("%s: %s\n", key, value) - } - - return s -} - -type tickMsg time.Time - -func tick() tea.Msg { - time.Sleep(time.Second) - return tickMsg{} -} - -func RunExplorerTUI(cmd *cobra.Command, args []string) error { - p := tea.NewProgram(initialModel(), tea.WithAltScreen()) - if _, err := p.Run(); err != nil { - return fmt.Errorf("error running explorer: %v", err) - } - return nil -} diff --git a/internal/tui/tui.go b/internal/tui/tui.go deleted file mode 100644 index 0ac4d76c0..000000000 --- a/internal/tui/tui.go +++ /dev/null @@ -1,49 +0,0 @@ -package tui - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/onsonr/sonr/internal/tui/dexmodel" - "github.com/onsonr/sonr/internal/tui/txmodel" - "github.com/spf13/cobra" -) - -func AddTUICmds(rootCmd *cobra.Command) { - rootCmd.AddCommand(newBuildTxnTUICmd()) - rootCmd.AddCommand(newExplorerTUICmd()) -} - -func newBuildTxnTUICmd() *cobra.Command { - return &cobra.Command{ - Use: "dash", - Short: "TUI for managing the local Sonr validator node", - RunE: func(cmd *cobra.Command, args []string) error { - txBody, err := txmodel.RunBuildTxnTUI() - if err != nil { - return err - } - - interfaceRegistry := codectypes.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) - jsonBytes, err := marshaler.MarshalJSON(txBody) - if err != nil { - return fmt.Errorf("failed to marshal tx body: %w", err) - } - - fmt.Println("Generated Protobuf Message (JSON format):") - fmt.Println(string(jsonBytes)) - - return nil - }, - } -} - -func newExplorerTUICmd() *cobra.Command { - return &cobra.Command{ - Use: "cosmos-explorer", - Short: "A terminal-based Cosmos blockchain explorer", - RunE: dexmodel.RunExplorerTUI, - } -} diff --git a/internal/tui/txmodel/txmodel.go b/internal/tui/txmodel/txmodel.go deleted file mode 100644 index 4c493ad24..000000000 --- a/internal/tui/txmodel/txmodel.go +++ /dev/null @@ -1,322 +0,0 @@ -package txmodel - -import ( - "fmt" - "strings" - - tea "github.com/charmbracelet/bubbletea" - "github.com/charmbracelet/huh" - "github.com/charmbracelet/lipgloss" - "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/tx" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -const maxWidth = 100 - -var ( - red = lipgloss.AdaptiveColor{Light: "#FE5F86", Dark: "#FE5F86"} - indigo = lipgloss.AdaptiveColor{Light: "#5A56E0", Dark: "#7571F9"} - green = lipgloss.AdaptiveColor{Light: "#02BA84", Dark: "#02BF87"} -) - -type Styles struct { - Base, - HeaderText, - Status, - StatusHeader, - Highlight, - ErrorHeaderText, - Help lipgloss.Style -} - -func NewStyles(lg *lipgloss.Renderer) *Styles { - s := Styles{} - s.Base = lg.NewStyle(). - Padding(1, 2, 0, 1) - s.HeaderText = lg.NewStyle(). - Foreground(indigo). - Bold(true). - Padding(0, 1, 0, 1) - s.Status = lg.NewStyle(). - Border(lipgloss.RoundedBorder()). - BorderForeground(indigo). - PaddingLeft(1). - MarginTop(1) - s.StatusHeader = lg.NewStyle(). - Foreground(green). - Bold(true) - s.Highlight = lg.NewStyle(). - Foreground(lipgloss.Color("212")) - s.ErrorHeaderText = s.HeaderText. - Foreground(red) - s.Help = lg.NewStyle(). - Foreground(lipgloss.Color("240")) - return &s -} - -type state int - -const ( - statusNormal state = iota - stateDone -) - -type Model struct { - state state - lg *lipgloss.Renderer - styles *Styles - form *huh.Form - width int - message *tx.TxBody -} - -func NewModel() Model { - m := Model{width: maxWidth} - m.lg = lipgloss.DefaultRenderer() - m.styles = NewStyles(m.lg) - - m.form = huh.NewForm( - huh.NewGroup( - huh.NewInput(). - Key("from"). - Title("From Address"). - Placeholder("cosmos1..."). - Validate(func(s string) error { - if !strings.HasPrefix(s, "cosmos1") { - return fmt.Errorf("invalid address format") - } - return nil - }), - - huh.NewInput(). - Key("to"). - Title("To Address"). - Placeholder("cosmos1..."). - Validate(func(s string) error { - if !strings.HasPrefix(s, "cosmos1") { - return fmt.Errorf("invalid address format") - } - return nil - }), - - huh.NewInput(). - Key("amount"). - Title("Amount"). - Placeholder("100"). - Validate(func(s string) error { - if _, err := sdk.ParseCoinNormalized(s + "atom"); err != nil { - return fmt.Errorf("invalid coin amount") - } - return nil - }), - - huh.NewSelect[string](). - Key("denom"). - Title("Denom"). - Options(huh.NewOptions("atom", "osmo", "usnr", "snr")...), - - huh.NewInput(). - Key("memo"). - Title("Memo"). - Placeholder("Optional"), - - huh.NewConfirm(). - Key("done"). - Title("Ready to convert?"). - Validate(func(v bool) error { - if !v { - return fmt.Errorf("Please confirm when you're ready to convert") - } - return nil - }). - Affirmative("Yes, convert!"). - Negative("Not yet"), - ), - ). - WithWidth(60). - WithShowHelp(false). - WithShowErrors(false) - - return m -} - -func (m Model) Init() tea.Cmd { - return m.form.Init() -} - -func min(x, y int) int { - if x > y { - return y - } - return x -} - -func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { - switch msg := msg.(type) { - case tea.WindowSizeMsg: - m.width = min(msg.Width, maxWidth) - m.styles.Base.GetHorizontalFrameSize() - case tea.KeyMsg: - switch msg.String() { - case "esc", "ctrl+c", "q": - return m, tea.Quit - } - } - - var cmds []tea.Cmd - - form, cmd := m.form.Update(msg) - if f, ok := form.(*huh.Form); ok { - m.form = f - cmds = append(cmds, cmd) - } - - if m.form.State == huh.StateCompleted { - m.buildMessage() - cmds = append(cmds, tea.Quit) - } - - return m, tea.Batch(cmds...) -} - -func (m Model) View() string { - s := m.styles - - switch m.form.State { - case huh.StateCompleted: - pklCode := m.generatePkl() - messageView := m.getMessageView() - var b strings.Builder - fmt.Fprintf(&b, "Final Tx:\n\n%s\n\n%s", pklCode, messageView) - return s.Status.Margin(0, 1).Padding(1, 2).Width(80).Render(b.String()) + "\n\n" - default: - var schemaType string - if m.form.GetString("schemaType") != "" { - schemaType = "Schema Type: " + m.form.GetString("schemaType") - } - - v := strings.TrimSuffix(m.form.View(), "\n\n") - form := m.lg.NewStyle().Margin(1, 0).Render(v) - - var status string - { - preview := "(Preview will appear here)" - if m.form.GetString("schema") != "" { - preview = m.generatePkl() - } - - const statusWidth = 40 - statusMarginLeft := m.width - statusWidth - lipgloss.Width(form) - s.Status.GetMarginRight() - status = s.Status. - Height(lipgloss.Height(form)). - Width(statusWidth). - MarginLeft(statusMarginLeft). - Render(s.StatusHeader.Render("Pkl Preview") + "\n" + - schemaType + "\n\n" + - preview) - } - - errors := m.form.Errors() - header := m.appBoundaryView("Sonr TX Builder") - if len(errors) > 0 { - header = m.appErrorBoundaryView(m.errorView()) - } - body := lipgloss.JoinHorizontal(lipgloss.Top, form, status) - - footer := m.appBoundaryView(m.form.Help().ShortHelpView(m.form.KeyBinds())) - if len(errors) > 0 { - footer = m.appErrorBoundaryView("") - } - - return s.Base.Render(header + "\n" + body + "\n\n" + footer) - } -} - -func (m Model) errorView() string { - var s string - for _, err := range m.form.Errors() { - s += err.Error() - } - return s -} - -func (m Model) appBoundaryView(text string) string { - return lipgloss.PlaceHorizontal( - m.width, - lipgloss.Left, - m.styles.HeaderText.Render(text), - lipgloss.WithWhitespaceChars("="), - lipgloss.WithWhitespaceForeground(indigo), - ) -} - -func (m Model) appErrorBoundaryView(text string) string { - return lipgloss.PlaceHorizontal( - m.width, - lipgloss.Left, - m.styles.ErrorHeaderText.Render(text), - lipgloss.WithWhitespaceChars("="), - lipgloss.WithWhitespaceForeground(red), - ) -} - -func (m Model) generatePkl() string { - schemaType := m.form.GetString("schemaType") - schema := m.form.GetString("schema") - - // This is a placeholder for the actual conversion logic - // In a real implementation, you would parse the schema and generate Pkl code - return fmt.Sprintf("// Converted from %s\n\nclass ConvertedSchema {\n // TODO: Implement conversion from %s\n // Original schema:\n /*\n%s\n */\n}", schemaType, schemaType, schema) -} - -func (m *Model) buildMessage() { - from := m.form.GetString("from") - to := m.form.GetString("to") - amount := m.form.GetString("amount") - denom := m.form.GetString("denom") - memo := m.form.GetString("memo") - - coin, _ := sdk.ParseCoinNormalized(fmt.Sprintf("%s%s", amount, denom)) - sendMsg := &banktypes.MsgSend{ - FromAddress: from, - ToAddress: to, - Amount: sdk.NewCoins(coin), - } - - anyMsg, _ := codectypes.NewAnyWithValue(sendMsg) - m.message = &tx.TxBody{ - Messages: []*codectypes.Any{anyMsg}, - Memo: memo, - } -} - -func (m Model) getMessageView() string { - if m.message == nil { - return "Current Message: None" - } - - interfaceRegistry := codectypes.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) - jsonBytes, _ := marshaler.MarshalJSON(m.message) - - return fmt.Sprintf("Current Message:\n%s", string(jsonBytes)) -} - -func RunBuildTxnTUI() (*tx.TxBody, error) { - m := NewModel() - p := tea.NewProgram(m) - - finalModel, err := p.Run() - if err != nil { - return nil, fmt.Errorf("failed to run program: %w", err) - } - - finalM, ok := finalModel.(Model) - if !ok || finalM.message == nil { - return nil, fmt.Errorf("form not completed") - } - - return finalM.message, nil -} diff --git a/internal/vfs/assemble.go b/internal/vfs/assemble.go deleted file mode 100644 index 07545ebc7..000000000 --- a/internal/vfs/assemble.go +++ /dev/null @@ -1,20 +0,0 @@ -package vfs - -import ( - "github.com/ipfs/boxo/files" -) - -var ( - kServiceWorkerFileName = "server/sw.js" - kVaultFileName = "server/vault.wasm" - kIndexFileName = "index.html" -) - -func AssembleDirectory() files.Directory { - fileMap := map[string]files.Node{ - kVaultFileName: DWNWasmFile(), - kServiceWorkerFileName: SWJSFile(), - } - - return files.NewMapDirectory(fileMap) -} diff --git a/internal/vfs/dwn.wasm b/internal/vfs/dwn.wasm deleted file mode 100755 index 272ccbefa..000000000 Binary files a/internal/vfs/dwn.wasm and /dev/null differ diff --git a/internal/vfs/embed.go b/internal/vfs/embed.go deleted file mode 100644 index d7dcc4db6..000000000 --- a/internal/vfs/embed.go +++ /dev/null @@ -1,22 +0,0 @@ -package vfs - -import ( - _ "embed" - - "github.com/ipfs/boxo/files" -) - -//go:embed dwn.wasm -var dwnWasmData []byte - -//go:embed sw.js -var swJSData []byte - -func DWNWasmFile() files.Node { - return files.NewBytesFile(dwnWasmData) -} - -// Use ServiceWorkerJS template to generate the service worker file -func SWJSFile() files.Node { - return files.NewBytesFile(swJSData) -} diff --git a/internal/vfs/sw.js b/internal/vfs/sw.js deleted file mode 100644 index a5654ed5d..000000000 --- a/internal/vfs/sw.js +++ /dev/null @@ -1,8 +0,0 @@ -importScripts( - "https://cdn.jsdelivr.net/gh/golang/go@go1.18.4/misc/wasm/wasm_exec.js", - "https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js", - "https://cdn.jsdelivr.net/npm/htmx.org@1.9.12/dist/htmx.min.js", - "https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js", -); - -registerWasmHTTPListener("dwn.wasm"); diff --git a/internal/vfs/wasm/request.go b/internal/vfs/wasm/request.go deleted file mode 100644 index c7aeb7d5a..000000000 --- a/internal/vfs/wasm/request.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build js && wasm - -package wasm - -import ( - "bytes" - "net/http" - "net/http/httptest" - "syscall/js" - - promise "github.com/nlepage/go-js-promise" -) - -// Request builds and returns the equivalent http.Request -func Request(r js.Value) *http.Request { - jsBody := js.Global().Get("Uint8Array").New(promise.Await(r.Call("arrayBuffer"))) - body := make([]byte, jsBody.Get("length").Int()) - js.CopyBytesToGo(body, jsBody) - - req := httptest.NewRequest( - r.Get("method").String(), - r.Get("url").String(), - bytes.NewBuffer(body), - ) - - headersIt := r.Get("headers").Call("entries") - for { - e := headersIt.Call("next") - if e.Get("done").Bool() { - break - } - v := e.Get("value") - req.Header.Set(v.Index(0).String(), v.Index(1).String()) - } - - return req -} diff --git a/internal/vfs/wasm/response.go b/internal/vfs/wasm/response.go deleted file mode 100644 index 632538b87..000000000 --- a/internal/vfs/wasm/response.go +++ /dev/null @@ -1,50 +0,0 @@ -//go:build js && wasm - -package wasm - -import ( - "io" - "net/http/httptest" - "syscall/js" -) - -// ResponseRecorder uses httptest.ResponseRecorder to build a JS Response -type ResponseRecorder struct { - *httptest.ResponseRecorder -} - -// NewResponseRecorder returns a new ResponseRecorder -func NewResponseRecorder() ResponseRecorder { - return ResponseRecorder{httptest.NewRecorder()} -} - -// JSResponse builds and returns the equivalent JS Response -func (rr ResponseRecorder) JSResponse() js.Value { - res := rr.Result() - - body := js.Undefined() - if res.ContentLength != 0 { - b, err := io.ReadAll(res.Body) - if err != nil { - panic(err) - } - body = js.Global().Get("Uint8Array").New(len(b)) - js.CopyBytesToJS(body, b) - } - - init := make(map[string]interface{}, 2) - - if res.StatusCode != 0 { - init["status"] = res.StatusCode - } - - if len(res.Header) != 0 { - headers := make(map[string]interface{}, len(res.Header)) - for k := range res.Header { - headers[k] = res.Header.Get(k) - } - init["headers"] = headers - } - - return js.Global().Get("Response").New(body, init) -} diff --git a/internal/vfs/wasm/serve.go b/internal/vfs/wasm/serve.go deleted file mode 100644 index 846280928..000000000 --- a/internal/vfs/wasm/serve.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build js && wasm - -package wasm - -import ( - "fmt" - "net/http" - "strings" - "syscall/js" - - promise "github.com/nlepage/go-js-promise" -) - -// Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil. -func Serve(handler http.Handler) func() { - h := handler - if h == nil { - h = http.DefaultServeMux - } - - prefix := js.Global().Get("wasmhttp").Get("path").String() - for strings.HasSuffix(prefix, "/") { - prefix = strings.TrimSuffix(prefix, "/") - } - - if prefix != "" { - mux := http.NewServeMux() - mux.Handle(prefix+"/", http.StripPrefix(prefix, h)) - h = mux - } - - cb := js.FuncOf(func(_ js.Value, args []js.Value) interface{} { - resPromise, resolve, reject := promise.New() - - go func() { - defer func() { - if r := recover(); r != nil { - if err, ok := r.(error); ok { - reject(fmt.Sprintf("wasmhttp: panic: %+v\n", err)) - } else { - reject(fmt.Sprintf("wasmhttp: panic: %v\n", r)) - } - } - }() - - res := NewResponseRecorder() - - h.ServeHTTP(res, Request(args[0])) - - resolve(res.JSResponse()) - }() - - return resPromise - }) - - js.Global().Get("wasmhttp").Call("setHandler", cb) - - return cb.Release -} 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 79% rename from pkg/nebula/pages/home.templ rename to nebula/pages/home.templ index f21586f07..f9c31302a 100644 --- a/pkg/nebula/pages/home.templ +++ b/nebula/pages/home.templ @@ -2,10 +2,14 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) -templ Home(c echo.Context) { +func Home(c echo.Context) error { + return echoResponse(c, homeView()) +} + +templ homeView() { @blocks.Card("home-view", blocks.SizeLarge) { @blocks.H1("Sonr.ID") @blocks.Text("A Decentralized Web Node Client for the Sonr Network.") diff --git a/pkg/nebula/pages/home_templ.go b/nebula/pages/home_templ.go similarity index 97% rename from pkg/nebula/pages/home_templ.go rename to nebula/pages/home_templ.go index 75e611f56..f00d95bb0 100644 --- a/pkg/nebula/pages/home_templ.go +++ b/nebula/pages/home_templ.go @@ -10,10 +10,14 @@ 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) templ.Component { +func Home(c echo.Context) error { + return echoResponse(c, homeView()) +} + +func homeView() 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 { diff --git a/pkg/nebula/pages/login.templ b/nebula/pages/login.templ similarity index 68% rename from pkg/nebula/pages/login.templ rename to nebula/pages/login.templ index 3db82aed7..68f8b2e18 100644 --- a/pkg/nebula/pages/login.templ +++ b/nebula/pages/login.templ @@ -2,10 +2,14 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) -templ Login(c echo.Context) { +func Login(c echo.Context) error { + return echoResponse(c, loginView(c)) +} + +templ loginView(c echo.Context) { @blocks.Card("login-view", blocks.SizeLarge) { @blocks.H1("Sonr.ID") @blocks.Text("Neo-tree is a file manager for NeoFS.") diff --git a/pkg/nebula/pages/login_templ.go b/nebula/pages/login_templ.go similarity index 96% rename from pkg/nebula/pages/login_templ.go rename to nebula/pages/login_templ.go index 0c7bb0ce8..696b731c2 100644 --- a/pkg/nebula/pages/login_templ.go +++ b/nebula/pages/login_templ.go @@ -10,10 +10,14 @@ 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) templ.Component { +func Login(c echo.Context) error { + return echoResponse(c, loginView(c)) +} + +func loginView(c echo.Context) 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 { diff --git a/pkg/nebula/pages/openid.templ b/nebula/pages/openid.templ similarity index 54% rename from pkg/nebula/pages/openid.templ rename to nebula/pages/openid.templ index c0482ec52..2d1a677c4 100644 --- a/pkg/nebula/pages/openid.templ +++ b/nebula/pages/openid.templ @@ -2,10 +2,14 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" + "github.com/onsonr/sonr/nebula/blocks" ) -templ Authorize(c echo.Context) { +func Authorize(c echo.Context) error { + return echoResponse(c, authorizeView(c)) +} + +templ authorizeView(c echo.Context) { @blocks.Card("authorize-view", blocks.SizeMedium) { @blocks.H1("Sonr.ID") @blocks.Text("Neo-tree is a file manager for NeoFS.") diff --git a/pkg/nebula/pages/openid_templ.go b/nebula/pages/openid_templ.go similarity index 93% rename from pkg/nebula/pages/openid_templ.go rename to nebula/pages/openid_templ.go index c87093a10..c1df7f246 100644 --- a/pkg/nebula/pages/openid_templ.go +++ b/nebula/pages/openid_templ.go @@ -10,10 +10,14 @@ 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) templ.Component { +func Authorize(c echo.Context) error { + return echoResponse(c, authorizeView(c)) +} + +func authorizeView(c echo.Context) 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 { diff --git a/pkg/proxy/routes/pages.go b/nebula/pages/pages.go similarity index 79% rename from pkg/proxy/routes/pages.go rename to nebula/pages/pages.go index 49aeacfce..de34ff40c 100644 --- a/pkg/proxy/routes/pages.go +++ b/nebula/pages/pages.go @@ -1,4 +1,4 @@ -package routes +package pages import ( "bytes" @@ -7,11 +7,9 @@ import ( "github.com/labstack/echo/v4" ) -// render renders a templ.Component -func echoComponentResponse(c echo.Context, cmp templ.Component) error { +func echoResponse(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 { diff --git a/nebula/pages/profile.templ b/nebula/pages/profile.templ new file mode 100644 index 000000000..97af91f61 --- /dev/null +++ b/nebula/pages/profile.templ @@ -0,0 +1,17 @@ +package pages + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/nebula/blocks" +) + +func Profile(c echo.Context) error { + return echoResponse(c, profileView(c)) +} + +templ profileView(c echo.Context) { + @blocks.Card("profile-view", blocks.SizeLarge) { + @blocks.ProfileCard() + @blocks.Tabs() + } +} diff --git a/pkg/nebula/pages/profile_templ.go b/nebula/pages/profile_templ.go similarity index 93% rename from pkg/nebula/pages/profile_templ.go rename to nebula/pages/profile_templ.go index dc588d663..7d5f4aead 100644 --- a/pkg/nebula/pages/profile_templ.go +++ b/nebula/pages/profile_templ.go @@ -10,10 +10,14 @@ 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) templ.Component { +func Profile(c echo.Context) error { + return echoResponse(c, profileView(c)) +} + +func profileView(c echo.Context) 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 { diff --git a/internal/gui/forms/register.templ b/nebula/pages/register.templ similarity index 67% rename from internal/gui/forms/register.templ rename to nebula/pages/register.templ index 76b0c1d99..6ecbad47b 100644 --- a/internal/gui/forms/register.templ +++ b/nebula/pages/register.templ @@ -1,8 +1,37 @@ -package forms +package pages -import "github.com/labstack/echo/v4" +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/nebula/blocks" +) -templ BasicInfo(c echo.Context, state FormState) { +type FormState string + +const ( + InitialForm FormState = "initial" + ErrorForm FormState = "error" + SuccessForm FormState = "success" + WarningForm FormState = "warning" +) + +func Register(c echo.Context) error { + return echoResponse(c, registerView(c)) +} + +templ registerView(c echo.Context) { + @blocks.Card("register-view", blocks.SizeMedium) { + @blocks.H2("Account Registration") + @blocks.Spacer() + @blocks.Breadcrumbs() + @basicInfoForm(InitialForm) + @blocks.Spacer() + @blocks.Button(blocks.GET("/", "#register-view")) { + @blocks.Text("Cancel") + } + } +} + +templ basicInfoForm(state FormState) { switch (state) { default:
    @@ -17,9 +46,3 @@ templ BasicInfo(c echo.Context, state FormState) {
    } } - -templ CreateCredentials(state FormState) { -} - -templ PrivacyTerms(state FormState) { -} diff --git a/pkg/nebula/pages/register_templ.go b/nebula/pages/register_templ.go similarity index 60% rename from pkg/nebula/pages/register_templ.go rename to nebula/pages/register_templ.go index ad23e673b..568a22d0c 100644 --- a/pkg/nebula/pages/register_templ.go +++ b/nebula/pages/register_templ.go @@ -10,11 +10,23 @@ 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/pkg/nebula/islands" + "github.com/onsonr/sonr/nebula/blocks" ) -func Register(c echo.Context) templ.Component { +type FormState string + +const ( + InitialForm FormState = "initial" + ErrorForm FormState = "error" + SuccessForm FormState = "success" + WarningForm FormState = "warning" +) + +func Register(c echo.Context) error { + return echoResponse(c, registerView(c)) +} + +func registerView(c echo.Context) 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 { @@ -71,7 +83,7 @@ func Register(c echo.Context) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = islands.BasicInfo(c, islands.InitialForm).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = basicInfoForm(InitialForm).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -119,4 +131,36 @@ func Register(c echo.Context) templ.Component { }) } +func basicInfoForm(state FormState) 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_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + switch state { + default: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    Account

    Make changes to your account here. Click save when you're done.

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return templ_7745c5c3_Err + }) +} + var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/islands/forms.go b/pkg/nebula/islands/forms.go deleted file mode 100644 index 5c75ae942..000000000 --- a/pkg/nebula/islands/forms.go +++ /dev/null @@ -1,41 +0,0 @@ -package islands - -import ( - "bytes" - - "github.com/a-h/templ" - "github.com/labstack/echo/v4" -) - -func echoFormResponse(c echo.Context, cmp templ.Component, state FormState) 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) - c.Response().Header().Set("X-Status", string(state)) - - // Write the buffered content to the response - _, err = c.Response().Write(buf.Bytes()) - return err -} - -type FormState string - -const ( - InitialForm FormState = "initial" - ErrorForm FormState = "error" - SuccessForm FormState = "success" - WarningForm FormState = "warning" -) - -type Form struct { - State FormState - Title string - Description string -} diff --git a/pkg/nebula/islands/register.templ b/pkg/nebula/islands/register.templ deleted file mode 100644 index 953ea0dc3..000000000 --- a/pkg/nebula/islands/register.templ +++ /dev/null @@ -1,25 +0,0 @@ -package islands - -import "github.com/labstack/echo/v4" - -templ BasicInfo(c echo.Context, state FormState) { - switch (state) { - default: -
    -
    -

    Account

    -

    Make changes to your account here. Click save when you're done.

    -
    -
    -
    -
    -
    -
    - } -} - -templ CreateCredentials(c echo.Context, state FormState) { -} - -templ PrivacyTerms(c echo.Context, state FormState) { -} diff --git a/pkg/nebula/islands/register_templ.go b/pkg/nebula/islands/register_templ.go deleted file mode 100644 index 2f56be082..000000000 --- a/pkg/nebula/islands/register_templ.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package islands - -//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" - -func BasicInfo(c echo.Context, state FormState) 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) - switch state { - default: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    Account

    Make changes to your account here. Click save when you're done.

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return templ_7745c5c3_Err - }) -} - -func CreateCredentials(c echo.Context, state FormState) 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - return templ_7745c5c3_Err - }) -} - -func PrivacyTerms(c echo.Context, state FormState) 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_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/pages/profile.templ b/pkg/nebula/pages/profile.templ deleted file mode 100644 index 72fe1c6e5..000000000 --- a/pkg/nebula/pages/profile.templ +++ /dev/null @@ -1,13 +0,0 @@ -package pages - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" -) - -templ Profile(c echo.Context) { - @blocks.Card("profile-view", blocks.SizeLarge) { - @blocks.ProfileCard() - @blocks.Tabs() - } -} diff --git a/pkg/nebula/pages/register.templ b/pkg/nebula/pages/register.templ deleted file mode 100644 index 2b785a20d..000000000 --- a/pkg/nebula/pages/register.templ +++ /dev/null @@ -1,20 +0,0 @@ -package pages - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/blocks" - "github.com/onsonr/sonr/pkg/nebula/islands" -) - -templ Register(c echo.Context) { - @blocks.Card("register-view", blocks.SizeMedium) { - @blocks.H2("Account Registration") - @blocks.Spacer() - @blocks.Breadcrumbs() - @islands.BasicInfo(c, islands.InitialForm) - @blocks.Spacer() - @blocks.Button(blocks.GET("/", "#register-view")) { - @blocks.Text("Cancel") - } - } -} diff --git a/pkg/nebula/router.go b/pkg/nebula/router.go deleted file mode 100644 index 86e63dd1c..000000000 --- a/pkg/nebula/router.go +++ /dev/null @@ -1,15 +0,0 @@ -package nebula - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/routes" - "github.com/onsonr/sonr/pkg/nebula/view" -) - -func RouteViews(e *echo.Echo) { - e.GET("/home", view.Render(routes.HomeRoute)) - e.GET("/login", view.Render(routes.LoginRoute)) - e.GET("/register", view.Render(routes.RegisterRoute)) - e.GET("/profile", view.Render(routes.ProfileRoute)) - e.GET("/authorize", view.Render(routes.AuthorizeRoute)) -} diff --git a/pkg/nebula/routes/routes.go b/pkg/nebula/routes/routes.go deleted file mode 100644 index c8908c650..000000000 --- a/pkg/nebula/routes/routes.go +++ /dev/null @@ -1,37 +0,0 @@ -package routes - -import ( - "github.com/a-h/templ" - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/pages" -) - -type Route string - -const ( - HomeRoute Route = "/home" - LoginRoute Route = "/login" - RegisterRoute Route = "/register" - ProfileRoute Route = "/profile" - AuthorizeRoute Route = "/authorize" -) - -func (r Route) Route() string { - return string(r) -} - -func (r Route) Component(c echo.Context) templ.Component { - switch r { - case HomeRoute: - return pages.Home(c) - case LoginRoute: - return pages.Login(c) - case RegisterRoute: - return pages.Register(c) - case ProfileRoute: - return pages.Profile(c) - case AuthorizeRoute: - return pages.Authorize(c) - } - return nil -} diff --git a/pkg/nebula/view/view.go b/pkg/nebula/view/view.go deleted file mode 100644 index 6dfeb3122..000000000 --- a/pkg/nebula/view/view.go +++ /dev/null @@ -1,29 +0,0 @@ -package view - -import ( - "bytes" - - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/routes" -) - -// render renders a templ.Component -func Render(r routes.Route) echo.HandlerFunc { - return func(c echo.Context) error { - // Create a buffer to store the rendered HTML - buf := bytes.NewBuffer(nil) - - // Render the component to the buffer - err := r.Component(c).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/wrangler.toml b/pkg/proxy/wrangler.toml deleted file mode 100644 index 10bce7926..000000000 --- a/pkg/proxy/wrangler.toml +++ /dev/null @@ -1,10 +0,0 @@ -name = "sonr-id" -main = "./build/worker.mjs" -compatibility_date = "2024-07-26" - -[dev] -ip = "localhost" -port = 4202 - -[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/pkl/api.pkl b/pkl/api.pkl deleted file mode 100644 index f18251ac6..000000000 --- a/pkl/api.pkl +++ /dev/null @@ -1,37 +0,0 @@ -@go.Package { name = "github.com/onsonr/sonr/motr/api" } - -module api - -import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" - -class JsonField extends go.Field { - structTags { - ["json"] = "%{name},omitempty" - } -} - -abstract class Request { - route: String - method: String - headers: Map - origin: String? - userAgent: String? - body: Dynamic -} - -abstract class Response { - statusCode: Int - headers: Map - body: Dynamic -} - -class GetAccountsRequest extends Request { - route = "/accounts" - method = "GET" - headers = { - "Content-Type" = "application/json" - } - origin = null - userAgent = null - body = null -} diff --git a/pkl/bake.pkl b/pkl/bake.pkl deleted file mode 100644 index 927e5ea37..000000000 --- a/pkl/bake.pkl +++ /dev/null @@ -1,30 +0,0 @@ -@go.Package { name = "github.com/onsonr/sonr/motr/api/bake" } - -module bake - -import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" - -class JsonField extends go.Field { - structTags { - ["json"] = "%{name},omitempty" - } -} - -abstract class Macroon { - id: String - location: String -} - -abstract class FirstPartyCaveats { - scope: String - exp: Int - cnf: String - aud: String -} - -abstract class ThirdPartyCaveats { - scope: String - exp: Int - cnf: String - aud: String -} diff --git a/pkl/oidc.pkl b/pkl/oidc.pkl deleted file mode 100644 index 2437be298..000000000 --- a/pkl/oidc.pkl +++ /dev/null @@ -1,59 +0,0 @@ -@go.Package { name = "github.com/onsonr/sonr/x/did/types/oidc" } - -module oidc - -import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" - -class JsonField extends go.Field { - structTags { - ["json"] = "%{name},omitempty" - ["param"] = "%{name}" - } -} - -class DiscoveryDocument { - @JsonField - issuer: String - - @JsonField - authorization_endpoint: String - - @JsonField - token_endpoint: String - - @JsonField - userinfo_endpoint: String - - @JsonField - jwks_uri: String - - @JsonField - registration_endpoint: String - - @JsonField - scopes_supported: List - - @JsonField - response_types_supported: List - - @JsonField - response_modes_supported: List - - @JsonField - subject_types_supported: List - - @JsonField - id_token_signing_alg_values_supported: List - - @JsonField - claims_supported: List - - @JsonField - grant_types_supported: List - - @JsonField - acr_values_supported: List - - @JsonField - token_endpoint_auth_methods_supported: List -} diff --git a/pkl/orm.pkl b/pkl/orm.pkl deleted file mode 100644 index 86bc5e06f..000000000 --- a/pkl/orm.pkl +++ /dev/null @@ -1,227 +0,0 @@ -@go.Package { name = "github.com/onsonr/sonr/internal/db/orm" } - -module orm - -import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" - -class PrimaryKey extends go.Field { - structTags { - ["gorm"] = "primaryKey,autoIncrement" - ["json"] = "%{name},omitempty" - ["query"] = "%{name}" - } -} - -class Unique extends go.Field { - structTags { - ["gorm"] = "unique" - ["json"] = "%{name},omitempty" - } -} - -class Default extends go.Field { - defaultValue: String - structTags { - ["gorm"] = "default:%{defaultValue}" - ["json"] = "%{name},omitempty" - } -} - -class NotNull extends go.Field { - structTags { - ["gorm"] = "not null" - } -} - -class ForeignKey extends go.Field { - references: String - structTags { - ["gorm"] = "foreignKey:%{references}" - } -} - -class JsonField extends go.Field { - structTags { - ["json"] = "%{name},omitempty" - ["param"] = "%{name}" - } -} - -class Account { - @PrimaryKey - id: UInt - - @JsonField - name: String - - @JsonField - address: String - - @JsonField - publicKey: String - - @JsonField - createdAt: String? -} - -class Asset { - @PrimaryKey - id: UInt - - @JsonField - name: String - - @JsonField - symbol: String - - @JsonField - decimals: Int - - @JsonField - chainId: Int? - - @JsonField - createdAt: String? -} - -class Chain { - @PrimaryKey - id: UInt - - @JsonField - name: String - - @JsonField - networkId: String - - @JsonField - createdAt: String? -} - -class Credential { - @PrimaryKey - id: UInt - - @JsonField - subject: String - - @JsonField - controller: String - - @JsonField - attestationType: String - - @JsonField - origin: String - - @JsonField - credentialId: String - - @JsonField - publicKey: String - - @JsonField - transport: String - - @JsonField - signCount: UInt - - @JsonField - userPresent: Boolean - - @JsonField - userVerified: Boolean - - @JsonField - backupEligible: Boolean - - @JsonField - backupState: Boolean - - @JsonField - cloneWarning: Boolean - - @JsonField - createdAt: String? - - @JsonField - updatedAt: String? -} - -class Profile { - @PrimaryKey - id: String - - @JsonField - subject: String - - @JsonField - controller: String - - @JsonField - originUri: String? - - @JsonField - publicMetadata: String? - - @JsonField - privateMetadata: String? - - @JsonField - createdAt: String? - - @JsonField - updatedAt: String? -} - -class Property { - @PrimaryKey - id: UInt - - @JsonField - profileId: String - - @JsonField - key: String - - @JsonField - accumulator: String - - @JsonField - propertyKey: String -} - -class Keyshare { - @PrimaryKey - id: UInt - - @JsonField - data: String - - @JsonField - role: Int - - @JsonField - createdAt: String? -} - -class Permission { - @PrimaryKey - id: UInt - - @JsonField - serviceId: String - - @JsonField - grants: String - - @JsonField - scopes: String - - @JsonField - createdAt: String? - - @JsonField - updatedAt: String? -} - diff --git a/pkl/txns.pkl b/pkl/txns.pkl deleted file mode 100644 index beda46381..000000000 --- a/pkl/txns.pkl +++ /dev/null @@ -1,175 +0,0 @@ -@go.Package { name = "github.com/onsonr/sonr/x/did/types/txns" } - -module txns - -import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" - -/// Common Cosmos SDK types -typealias Coin = Dynamic -typealias AccAddress = String -typealias ValAddress = String -typealias Timestamp = String - -/// Base class for all messages -abstract class Msg { - /// The type URL for the message - typeUrl: String -} - -/// Base class for all proposals -class Proposal { - /// The title of the proposal - title: String - - /// The description of the proposal - description: String -} - - -/// Gov module messages -class MsgGovSubmitProposal extends Msg { - typeUrl = "/cosmos.gov.v1beta1.MsgSubmitProposal" - content: Proposal - initialDeposit: List - proposer: AccAddress -} - -class MsgGovVote extends Msg { - typeUrl = "/cosmos.gov.v1beta1.MsgVote" - proposalId: Int - voter: AccAddress - option: Int -} - -class MsgGovDeposit extends Msg { - typeUrl = "/cosmos.gov.v1beta1.MsgDeposit" - proposalId: Int - depositor: AccAddress - amount: List -} - -/// Group module messages - class MsgGroupCreateGroup extends Msg { - typeUrl = "/cosmos.group.v1.MsgCreateGroup" - admin: AccAddress - members: List - metadata: String - } - - class MsgGroupSubmitProposal extends Msg { - typeUrl = "/cosmos.group.v1.MsgSubmitProposal" - groupPolicyAddress: AccAddress - proposers: List - metadata: String - messages: List - exec: Int - } - - class MsgGroupVote extends Msg { - typeUrl = "/cosmos.group.v1.MsgVote" - proposalId: Int - voter: AccAddress - option: Int - metadata: String - exec: Int - } - -/// Staking module messages - class MsgStakingCreateValidator extends Msg { - typeUrl = "/cosmos.staking.v1beta1.MsgCreateValidator" - description: Dynamic - commission: Dynamic - minSelfDelegation: String - delegatorAddress: AccAddress - validatorAddress: ValAddress - pubkey: Dynamic - value: Coin - } - - class MsgStakingDelegate extends Msg { - typeUrl = "/cosmos.staking.v1beta1.MsgDelegate" - delegatorAddress: AccAddress - validatorAddress: ValAddress - amount: Coin - } - - class MsgStakingUndelegate extends Msg { - typeUrl = "/cosmos.staking.v1beta1.MsgUndelegate" - delegatorAddress: AccAddress - validatorAddress: ValAddress - amount: Coin - } - - class MsgStakingBeginRedelegate extends Msg { - typeUrl = "/cosmos.staking.v1beta1.MsgBeginRedelegate" - delegatorAddress: AccAddress - validatorSrcAddress: ValAddress - validatorDstAddress: ValAddress - amount: Coin - } - class MsgDidUpdateParams extends Msg { - typeUrl = "/sonr.did.v1.MsgUpdateParams" - authority: AccAddress - params: Dynamic - token: Dynamic - } - - class MsgDidAllocateVault extends Msg { - typeUrl = "/sonr.did.v1.MsgAllocateVault" - authority: AccAddress - subject: String - token: Dynamic - } - - class MsgDidProveWitness extends Msg { - typeUrl = "/sonr.did.v1.MsgProveWitness" - authority: AccAddress - property: String - witness: Listing - token: Dynamic - } - - class MsgDidSyncVault extends Msg { - typeUrl = "/sonr.did.v1.MsgSyncVault" - controller: AccAddress - token: Dynamic - } - -class MsgDidRegisterController extends Msg { - typeUrl = "/sonr.did.v1.MsgRegisterController" - authority: AccAddress - cid: String - origin: String - authentication: List - token: Dynamic - } - -class MsgDidAuthorize extends Msg { - typeUrl = "/sonr.did.v1.MsgAuthorize" - authority: AccAddress - controller: AccAddress - address: AccAddress - origin: String - token: Dynamic - } - -class MsgDidRegisterService extends Msg { - typeUrl = "/sonr.did.v1.MsgRegisterService" - controller: AccAddress - originUri: String - scopes: Dynamic - description: String - serviceEndpoints: Map - metadata: Dynamic - token: Dynamic - } - -/// Represents a transaction body -class TxBody { - messages: List - memo: String? - timeoutHeight: Int? - extensionOptions: List? - nonCriticalExtensionOptions: List? -} - diff --git a/process-compose.yaml b/process-compose.yaml index 62f947ffe..aa415b839 100644 --- a/process-compose.yaml +++ b/process-compose.yaml @@ -1,9 +1,9 @@ version: "0.6" processes: - ipfs: + air: namespace: testnet - command: "ipfs-cluster-service init --consensus crdt && ipfs-cluster-service daemon" + command: "devbox run serve:air" background: true availability: restart: on_failure @@ -11,8 +11,7 @@ processes: sonr: namespace: testnet - command: "make sh-testnet" + command: "devbox run serve:sonr" restart: on_failure max_restarts: 3 depends: - - ipfs 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 03e7f69be..64ba9cf19 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -35,17 +35,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 @@ -85,7 +79,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 7e620dfad..b4fdd71f2 100644 --- a/proto/did/v1/tx.proto +++ b/proto/did/v1/tx.proto @@ -12,52 +12,25 @@ option go_package = "github.com/onsonr/sonr/x/did/types"; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // 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); - // 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); + // 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); -} -// 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; + // UpdateParams defines a governance operation for updating the parameters. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgRegisterController is the message type for the InitializeController RPC. @@ -73,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. @@ -89,6 +65,26 @@ message MsgRegisterControllerResponse { map accounts = 3; } +// MsgExecuteTx is the message type for the ExecuteTx RPC. +message MsgExecuteTx { + option (cosmos.msg.v1.signer) = "controller"; + + // Controller is the address of the controller to authenticate. + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // Messages is the list of messages to execute. + map messages = 2; + + // MacaroonToken is the macaroon token to authenticate the operation. + string macaroon_token = 3; +} + +// MsgExecuteTxResponse is the response type for the ExecuteTx RPC. +message MsgExecuteTxResponse { + bool success = 1; + string tx_hash = 2; +} + // MsgAuthorizeService is the message type for the AuthorizeService RPC. message MsgAuthorizeService { option (cosmos.msg.v1.signer) = "controller"; @@ -106,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; @@ -119,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/builder/api.go b/x/did/builder/api.go deleted file mode 100644 index d042ba441..000000000 --- a/x/did/builder/api.go +++ /dev/null @@ -1,251 +0,0 @@ -package builder - -import ( - "encoding/base64" - "fmt" - - "github.com/go-webauthn/webauthn/protocol" - - "github.com/go-webauthn/webauthn/protocol/webauthncose" - didv1 "github.com/onsonr/sonr/api/did/v1" - "github.com/onsonr/sonr/x/did/types" -) - -func APIFormatDIDNamespace(namespace types.DIDNamespace) didv1.DIDNamespace { - return didv1.DIDNamespace(namespace) -} - -func APIFormatDIDNamespaces(namespaces []types.DIDNamespace) []didv1.DIDNamespace { - var s []didv1.DIDNamespace - for _, namespace := range namespaces { - s = append(s, APIFormatDIDNamespace(namespace)) - } - return s -} - -func APIFormatKeyRole(role types.KeyRole) didv1.KeyRole { - return didv1.KeyRole(role) -} - -func APIFormatKeyAlgorithm(algorithm types.KeyAlgorithm) didv1.KeyAlgorithm { - return didv1.KeyAlgorithm(algorithm) -} - -func APIFormatKeyEncoding(encoding types.KeyEncoding) didv1.KeyEncoding { - return didv1.KeyEncoding(encoding) -} - -func APIFormatKeyCurve(curve types.KeyCurve) didv1.KeyCurve { - return didv1.KeyCurve(curve) -} - -func APIFormatKeyType(keyType types.KeyType) didv1.KeyType { - return didv1.KeyType(keyType) -} - -func APIFormatPermissions(permissions *types.Permissions) *didv1.Permissions { - if permissions == nil { - return nil - } - p := didv1.Permissions{ - Grants: APIFormatDIDNamespaces(permissions.Grants), - Scopes: APIFormatPermissionScopes(permissions.Scopes), - } - return &p -} - -func APIFormatPermissionScope(scope types.PermissionScope) didv1.PermissionScope { - return didv1.PermissionScope(scope) -} - -func APIFormatPermissionScopes(scopes []types.PermissionScope) []didv1.PermissionScope { - var s []didv1.PermissionScope - for _, scope := range scopes { - s = append(s, APIFormatPermissionScope(scope)) - } - return s -} - -func APIFormatServiceRecord(service *types.Service) *didv1.ServiceRecord { - return &didv1.ServiceRecord{ - Id: service.Id, - ServiceType: service.ServiceType, - Authority: service.Authority, - Origin: service.Origin, - Description: service.Description, - ServiceEndpoints: service.ServiceEndpoints, - Permissions: APIFormatPermissions(service.Permissions), - } -} - -func APIFormatPubKeyJWK(jwk *types.PubKey_JWK) *didv1.PubKey_JWK { - return &didv1.PubKey_JWK{ - Kty: jwk.Kty, - Crv: jwk.Crv, - X: jwk.X, - Y: jwk.Y, - N: jwk.N, - E: jwk.E, - } -} - -func APIFormatPubKey(key *types.PubKey) *didv1.PubKey { - return &didv1.PubKey{ - Role: APIFormatKeyRole(key.GetRole()), - Algorithm: APIFormatKeyAlgorithm(key.GetAlgorithm()), - Encoding: APIFormatKeyEncoding(key.GetEncoding()), - Curve: APIFormatKeyCurve(key.GetCurve()), - KeyType: APIFormatKeyType(key.GetKeyType()), - Raw: key.GetRaw(), - } -} - -func FormatEC2PublicKey(key *webauthncose.EC2PublicKeyData) (*types.PubKey_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) (*types.PubKey_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) (*types.PubKey_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{}) (*types.PubKey_JWK, error) { - jwk := &types.PubKey_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) - } -} - -// 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 -} - -// GetTransports returns the protocol.AuthenticatorTransport -func ModuleTransportsToProtocol(transport []string) []protocol.AuthenticatorTransport { - tss := make([]protocol.AuthenticatorTransport, len(transport)) - for i, t := range transport { - tss[i] = protocol.AuthenticatorTransport(t) - } - return tss -} - -// ModuleFormatAPIServiceRecord formats a service record for the module -func ModuleFormatAPIServiceRecord(service *didv1.ServiceRecord) *types.Service { - return &types.Service{ - Id: service.Id, - ServiceType: service.ServiceType, - Authority: service.Authority, - Origin: service.Origin, - Description: service.Description, - ServiceEndpoints: service.ServiceEndpoints, - Permissions: ModuleFormatAPIPermissions(service.Permissions), - } -} - -func ModuleFormatAPIPermissions(permissions *didv1.Permissions) *types.Permissions { - if permissions == nil { - return nil - } - p := types.Permissions{ - Grants: ModuleFormatAPIDIDNamespaces(permissions.Grants), - Scopes: ModuleFormatAPIPermissionScopes(permissions.Scopes), - } - return &p -} - -func ModuleFormatAPIPermissionScope(scope didv1.PermissionScope) types.PermissionScope { - return types.PermissionScope(scope) -} - -func ModuleFormatAPIPermissionScopes(scopes []didv1.PermissionScope) []types.PermissionScope { - var s []types.PermissionScope - for _, scope := range scopes { - s = append(s, ModuleFormatAPIPermissionScope(scope)) - } - return s -} - -func ModuleFormatAPIDIDNamespace(namespace didv1.DIDNamespace) types.DIDNamespace { - return types.DIDNamespace(namespace) -} - -func ModuleFormatAPIDIDNamespaces(namespaces []didv1.DIDNamespace) []types.DIDNamespace { - var s []types.DIDNamespace - for _, namespace := range namespaces { - s = append(s, ModuleFormatAPIDIDNamespace(namespace)) - } - return s -} diff --git a/x/did/builder/chains.go b/x/did/builder/chains.go deleted file mode 100644 index eb3cf805a..000000000 --- a/x/did/builder/chains.go +++ /dev/null @@ -1,70 +0,0 @@ -package builder - -import ( - "crypto/hmac" - "crypto/sha512" - "encoding/binary" - "errors" - "math/big" - - "github.com/btcsuite/btcd/btcec/v2" - "github.com/onsonr/sonr/x/did/types" -) - -// ComputeAccountPublicKey computes the public key of a child key given the extended public key, chain code, and index. -func computeBip32AccountPublicKey(extPubKey PublicKey, chainCode types.ChainCode, index int) (*types.PubKey, error) { - // Check if the index is a hardened child key - if chainCode&0x80000000 != 0 && index < 0 { - return nil, errors.New("invalid index") - } - - // Serialize the public key - pubKey, err := btcec.ParsePubKey(extPubKey.GetRaw()) - 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 - childPubKey := btcec.NewPublicKey(lx, ly) - pk, err := types.NewPublicKey(childPubKey.SerializeCompressed(), types.ChainCodeKeyInfos[chainCode]) - if err != nil { - return nil, err - } - return pk, 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/x/did/builder/constants.go b/x/did/builder/constants.go deleted file mode 100644 index be06402c8..000000000 --- a/x/did/builder/constants.go +++ /dev/null @@ -1,334 +0,0 @@ -package builder - -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/x/did/builder/macroon.go b/x/did/builder/macroon.go deleted file mode 100644 index aacdbfb2a..000000000 --- a/x/did/builder/macroon.go +++ /dev/null @@ -1,48 +0,0 @@ -package builder - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "gopkg.in/macaroon.v2" - - "gopkg.in/macaroon-bakery.v2/bakery/checkers" -) - -var PermissionNamespace *checkers.Namespace - -func ValidateMacaroonMiddleware(secretKey []byte, location string) echo.MiddlewareFunc { - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - // Extract the macaroon from the Authorization header - auth := c.Request().Header.Get("Authorization") - if auth == "" { - return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Missing Authorization header"}) - } - - // Decode the macaroon - mac, err := macaroon.Base64Decode([]byte(auth)) - if err != nil { - return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon encoding"}) - } - - token, err := macaroon.New(secretKey, mac, location, macaroon.LatestVersion) - if err != nil { - return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon"}) - } - - // Verify the macaroon - err = token.Verify(secretKey, func(caveat string) error { - // Implement your caveat verification logic here - // For example, you might check if the caveat is still valid (e.g., not expired) - return nil // Return nil if the caveat is valid - }, nil) - if err != nil { - return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Invalid macaroon"}) - } - - // Macaroon is valid, proceed to the next handler - return next(c) - } - } -} diff --git a/x/did/builder/openid.go b/x/did/builder/openid.go deleted file mode 100644 index acd3ba380..000000000 --- a/x/did/builder/openid.go +++ /dev/null @@ -1,27 +0,0 @@ -package builder - -import ( - "fmt" - - "github.com/onsonr/sonr/x/did/types/oidc" -) - -func GetDiscovery(origin string) *oidc.DiscoveryDocument { - baseURL := "https://" + origin // Ensure this is the correct base URL for your service - discoveryDoc := &oidc.DiscoveryDocument{ - Issuer: baseURL, - AuthorizationEndpoint: fmt.Sprintf("%s/auth", baseURL), - TokenEndpoint: fmt.Sprintf("%s/token", baseURL), - UserinfoEndpoint: fmt.Sprintf("%s/userinfo", baseURL), - JwksUri: fmt.Sprintf("%s/jwks", baseURL), - RegistrationEndpoint: fmt.Sprintf("%s/register", baseURL), - ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"}, - ResponseTypesSupported: []string{"code"}, - ResponseModesSupported: []string{"query", "form_post"}, - GrantTypesSupported: []string{"authorization_code", "refresh_token"}, - AcrValuesSupported: []string{"passkey"}, - SubjectTypesSupported: []string{"public"}, - ClaimsSupported: []string{"sub", "iss", "name", "email"}, - } - return discoveryDoc -} diff --git a/x/did/builder/options.go b/x/did/builder/options.go deleted file mode 100644 index 828af608e..000000000 --- a/x/did/builder/options.go +++ /dev/null @@ -1,82 +0,0 @@ -package builder - -import ( - "encoding/json" - - "github.com/onsonr/sonr/x/did/types" -) - -type AuthenticatorResponse struct { - // From the spec https://www.w3.org/TR/webauthn/#dom-authenticatorresponse-clientdatajson - // This attribute contains a JSON serialization of the client data passed to the authenticator - // by the client in its call to either create() or get(). - ClientDataJSON URLEncodedBase64 `json:"clientDataJSON"` -} - -type AuthenticatorAttestationResponse struct { - // The byte slice of clientDataJSON, which becomes CollectedClientData - AuthenticatorResponse - - Transports []string `json:"transports,omitempty"` - - AuthenticatorData URLEncodedBase64 `json:"authenticatorData"` - - PublicKey URLEncodedBase64 `json:"publicKey"` - - PublicKeyAlgorithm int64 `json:"publicKeyAlgorithm"` - - // AttestationObject is the byte slice version of attestationObject. - // This attribute contains an attestation object, which is opaque to, and - // cryptographically protected against tampering by, the client. The - // attestation object contains both authenticator data and an attestation - // statement. The former contains the AAGUID, a unique credential ID, and - // the credential public key. The contents of the attestation statement are - // determined by the attestation statement format used by the authenticator. - // It also contains any additional information that the Relying Party's server - // requires to validate the attestation statement, as well as to decode and - // validate the authenticator data along with the JSON-serialized client data. - AttestationObject URLEncodedBase64 `json:"attestationObject"` -} - -type PublicKeyCredentialCreationOptions struct { - RelyingParty RelyingPartyEntity `json:"rp"` - User UserEntity `json:"user"` - Challenge URLEncodedBase64 `json:"challenge"` - Parameters []CredentialParameter `json:"pubKeyCredParams,omitempty"` - Timeout int `json:"timeout,omitempty"` - CredentialExcludeList []CredentialDescriptor `json:"excludeCredentials,omitempty"` - AuthenticatorSelection AuthenticatorSelection `json:"authenticatorSelection,omitempty"` - Hints []PublicKeyCredentialHints `json:"hints,omitempty"` - Attestation ConveyancePreference `json:"attestation,omitempty"` - AttestationFormats []AttestationFormat `json:"attestationFormats,omitempty"` - Extensions AuthenticationExtensions `json:"extensions,omitempty"` -} - -func GetPublicKeyCredentialCreationOptions(origin string, subject string, vaultCID string, params *types.Params) (*PublicKeyCredentialCreationOptions, error) { - chal, err := CreateChallenge() - if err != nil { - return nil, err - } - return &PublicKeyCredentialCreationOptions{ - RelyingParty: NewRelayingParty(origin, subject), - User: NewUserEntity(subject, subject, vaultCID), - Parameters: ExtractCredentialParameters(params), - Timeout: 20, - CredentialExcludeList: nil, - Challenge: chal, - AuthenticatorSelection: AuthenticatorSelection{}, - Hints: nil, - Attestation: ExtractConveyancePreference(params), - AttestationFormats: ExtractAttestationFormats(params), - Extensions: nil, - }, nil -} - -func UnmarshalAuthenticatorResponse(data []byte) (*AuthenticatorResponse, error) { - var ar AuthenticatorResponse - err := json.Unmarshal(data, &ar) - if err != nil { - return nil, err - } - return &ar, nil -} diff --git a/x/did/builder/pubkey.go b/x/did/builder/pubkey.go deleted file mode 100644 index 2c408b1ab..000000000 --- a/x/did/builder/pubkey.go +++ /dev/null @@ -1,81 +0,0 @@ -package builder - -import ( - "fmt" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - didv1 "github.com/onsonr/sonr/api/did/v1" - "github.com/onsonr/sonr/x/did/types" - - "github.com/go-webauthn/webauthn/protocol/webauthncose" -) - -// PublicKey is an interface for a public key -type PublicKey interface { - cryptotypes.PubKey - Clone() cryptotypes.PubKey - GetRaw() []byte - GetRole() types.KeyRole - GetAlgorithm() types.KeyAlgorithm - GetEncoding() types.KeyEncoding - GetCurve() types.KeyCurve - GetKeyType() types.KeyType -} - -// CreateAuthnVerification creates a new verification method for an authn method -func CreateAuthnVerification(namespace types.DIDNamespace, issuer string, controller string, pubkey *types.PubKey, identifier string) *types.VerificationMethod { - return &types.VerificationMethod{ - Method: namespace, - Controller: controller, - PublicKey: pubkey, - Id: identifier, - Issuer: issuer, - } -} - -// CreateWalletVerification creates a new verification method for a wallet -func CreateWalletVerification(namespace types.DIDNamespace, controller string, pubkey *types.PubKey, identifier string) *didv1.VerificationMethod { - return &didv1.VerificationMethod{ - Method: APIFormatDIDNamespace(namespace), - Controller: controller, - PublicKey: APIFormatPubKey(pubkey), - Id: identifier, - } -} - -// ExtractWebAuthnPublicKey parses the raw public key bytes and returns a JWK representation -func ExtractWebAuthnPublicKey(keyBytes []byte) (*types.PubKey_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") - } -} - -// NewInitialWalletAccounts creates a new set of verification methods for a wallet -func NewInitialWalletAccounts(controller string, pubkey *types.PubKey) ([]*didv1.VerificationMethod, error) { - var verificationMethods []*didv1.VerificationMethod - for method, chain := range types.InitialChainCodes { - nk, err := computeBip32AccountPublicKey(pubkey, chain, 0) - if err != nil { - return nil, err - } - - addr, err := chain.FormatAddress(nk) - if err != nil { - return nil, nil - } - verificationMethods = append(verificationMethods, CreateWalletVerification(method, controller, nk, method.FormatDID(addr))) - } - return verificationMethods, nil -} diff --git a/x/did/builder/scopes.go b/x/did/builder/scopes.go deleted file mode 100644 index 2635d6204..000000000 --- a/x/did/builder/scopes.go +++ /dev/null @@ -1,56 +0,0 @@ -package builder - -import ( - "github.com/onsonr/sonr/x/did/types" - "gopkg.in/macaroon-bakery.v2/bakery/checkers" -) - -var ( - GenericPermissionScopeStrings = [...]string{ - "profile.name", - "identifiers.email", - "identifiers.phone", - "transactions.read", - "transactions.write", - "wallets.read", - "wallets.create", - "wallets.subscribe", - "wallets.update", - "transactions.verify", - "transactions.broadcast", - "admin.user", - "admin.validator", - } - - StringToModulePermissionScope = map[string]types.PermissionScope{ - "PERMISSION_SCOPE_UNSPECIFIED": types.PermissionScope_PERMISSION_SCOPE_UNSPECIFIED, - "PERMISSION_SCOPE_BASIC_INFO": types.PermissionScope_PERMISSION_SCOPE_BASIC_INFO, - "PERMISSION_SCOPE_IDENTIFIERS_EMAIL": types.PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ, - "PERMISSION_SCOPE_IDENTIFIERS_PHONE": types.PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE, - "PERMISSION_SCOPE_TRANSACTIONS_READ": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ, - "PERMISSION_SCOPE_TRANSACTIONS_WRITE": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE, - "PERMISSION_SCOPE_WALLETS_READ": types.PermissionScope_PERMISSION_SCOPE_WALLETS_READ, - "PERMISSION_SCOPE_WALLETS_CREATE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE, - "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE, - "PERMISSION_SCOPE_WALLETS_UPDATE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE, - "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY, - "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST, - "PERMISSION_SCOPE_ADMIN_USER": types.PermissionScope_PERMISSION_SCOPE_ADMIN_USER, - "PERMISSION_SCOPE_ADMIN_VALIDATOR": types.PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR, - } -) - -func ResolvePermissionScope(scope string) (types.PermissionScope, bool) { - uriToPrefix := make(map[string]string) - for _, scope := range GenericPermissionScopeStrings { - uriToPrefix["https://example.com/auth/"+scope] = scope - } - PermissionNamespace := checkers.NewNamespace(uriToPrefix) - - prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope) - if !ok { - return 0, false - } - permScope, ok := StringToModulePermissionScope[prefix] - return permScope, ok -} diff --git a/x/did/builder/service.go b/x/did/builder/service.go deleted file mode 100644 index b5e33a96f..000000000 --- a/x/did/builder/service.go +++ /dev/null @@ -1,103 +0,0 @@ -package builder - -import ( - "crypto/rand" - "strings" - - "github.com/onsonr/sonr/x/did/types" -) - -// ChallengeLength - Length of bytes to generate for a challenge. -const ChallengeLength = 32 - -// CreateChallenge creates a new challenge that should be signed and returned by the authenticator. The spec recommends -// using at least 16 bytes with 100 bits of entropy. We use 32 bytes. -func CreateChallenge() (challenge URLEncodedBase64, err error) { - challenge = make([]byte, ChallengeLength) - - if _, err = rand.Read(challenge); err != nil { - return nil, err - } - - return challenge, nil -} - -type CredentialEntity struct { - // A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: - // - // When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, - // intended only for display. For example, "ACME Corporation", "Wonderful Widgets, Inc." or "ОАО Примертех". - // - // When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is - // intended only for display, i.e., aiding the user in determining the difference between user accounts with similar - // displayNames. For example, "alexm", "alex.p.mueller@example.com" or "+14255551234". - Name string `json:"name"` -} - -func NewCredentialEntity(name string) CredentialEntity { - return CredentialEntity{ - Name: name, - } -} - -type CredentialParameter struct { - Type CredentialType `json:"type"` - Algorithm types.COSEAlgorithmIdentifier `json:"alg"` -} - -func NewCredentialParameter(ki *types.KeyInfo) CredentialParameter { - return CredentialParameter{ - Type: CredentialTypePublicKeyCredential, - Algorithm: ki.Algorithm.CoseIdentifier(), - } -} - -func ExtractCredentialParameters(p *types.Params) []CredentialParameter { - var keys []*types.KeyInfo - for k, v := range p.AllowedPublicKeys { - if strings.Contains(k, "webauthn") { - keys = append(keys, v) - } - } - var cparams []CredentialParameter - for _, ki := range keys { - cparams = append(cparams, NewCredentialParameter(ki)) - } - return cparams -} - -type RelyingPartyEntity struct { - CredentialEntity - - // A unique identifier for the Relying Party entity, which sets the RP ID. - ID string `json:"id"` -} - -func NewRelayingParty(name string, origin string) RelyingPartyEntity { - return RelyingPartyEntity{ - CredentialEntity: NewCredentialEntity(origin), - ID: origin, - } -} - -type UserEntity struct { - CredentialEntity - // A human-palatable name for the user account, intended only for display. - // For example, "Alex P. Müller" or "田中 倫". The Relying Party SHOULD let - // the user choose this, and SHOULD NOT restrict the choice more than necessary. - DisplayName string `json:"displayName"` - - // ID is the user handle of the user account entity. To ensure secure operation, - // authentication and authorization decisions MUST be made on the basis of this id - // member, not the displayName nor name members. See Section 6.1 of - // [RFC8266](https://www.w3.org/TR/webauthn/#biblio-rfc8266). - ID any `json:"id"` -} - -func NewUserEntity(name string, subject string, cid string) UserEntity { - return UserEntity{ - CredentialEntity: NewCredentialEntity(name), - DisplayName: subject, - ID: cid, - } -} diff --git a/x/did/builder/signer.go b/x/did/builder/signer.go deleted file mode 100644 index b7b3fc33a..000000000 --- a/x/did/builder/signer.go +++ /dev/null @@ -1,59 +0,0 @@ -package builder - -import ( - "github.com/onsonr/crypto" - "github.com/onsonr/sonr/x/did/types" -) - -type Signer interface { - Sign(msg []byte) ([]byte, error) - Verify(msg []byte, sig []byte) error - PublicKey() []byte -} - -type signer struct { - user *types.Keyshare - val *types.Keyshare -} - -func (k signer) Sign(msg []byte) ([]byte, error) { - valSignFunc, err := crypto.GetSignFunc(k.val, msg) - if err != nil { - return nil, err - } - usrSignFunc, err := crypto.GetSignFunc(k.user, msg) - if err != nil { - return nil, err - } - sig, err := crypto.RunMPCSign(valSignFunc, usrSignFunc) - if err != nil { - return nil, err - } - return crypto.SerializeMPCSignature(sig) -} - -func (k signer) Verify(msg []byte, sig []byte) error { - sigMpc, err := crypto.DeserializeMPCSignature(sig) - if err != nil { - return err - } - pk, err := crypto.GetECDSAPublicKey(k.val) - if err != nil { - return err - } - ok := crypto.VerifyMPCSignature(sigMpc, msg, pk) - if !ok { - return types.ErrInvalidSignature - } - return nil -} - -func (k signer) PublicKey() []byte { - if k.user != nil { - return k.user.PublicKey - } - if k.val != nil { - return k.val.PublicKey - } - return nil -} diff --git a/x/did/builder/webauthn.go b/x/did/builder/webauthn.go deleted file mode 100644 index 098f91356..000000000 --- a/x/did/builder/webauthn.go +++ /dev/null @@ -1,169 +0,0 @@ -package builder - -import ( - "bytes" - "encoding/base64" - "reflect" - - "github.com/go-webauthn/webauthn/protocol" -) - -// Credential contains all needed information about a WebAuthn credential for storage. -type Credential struct { - Subject string `json:"handle"` - AttestationType string `json:"attestationType"` - Origin string `json:"origin"` - CredentialID []byte `json:"id"` - PublicKey []byte `json:"publicKey"` - Transport []string `json:"transport"` - SignCount uint32 `json:"signCount"` - UserPresent bool `json:"userPresent"` - UserVerified bool `json:"userVerified"` - BackupEligible bool `json:"backupEligible"` - BackupState bool `json:"backupState"` - CloneWarning bool `json:"cloneWarning"` -} - -// 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: c.Response.AttestationObject.AuthData.AttData.CredentialID, - PublicKey: c.Response.AttestationObject.AuthData.AttData.CredentialPublicKey, - Transport: NormalizeTransports(c.Response.Transports), - SignCount: 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(), - } -} - -// Descriptor converts a Credential into a protocol.CredentialDescriptor. -func (c *Credential) Descriptor() protocol.CredentialDescriptor { - return protocol.CredentialDescriptor{ - Type: protocol.PublicKeyCredentialType, - CredentialID: c.CredentialID, - Transport: ModuleTransportsToProtocol(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 uint32) { - if authDataCount <= a.SignCount && (authDataCount != 0 || a.SignCount != 0) { - a.CloneWarning = true - return - } - - a.SignCount = authDataCount -} - -type CredentialDescriptor struct { - // The valid credential types. - Type CredentialType `json:"type"` - - // CredentialID The ID of a credential to allow/disallow. - CredentialID URLEncodedBase64 `json:"id"` - - // The authenticator transports that can be used. - Transport []AuthenticatorTransport `json:"transports,omitempty"` - - // The AttestationType from the Credential. Used internally only. - AttestationType string `json:"-"` -} - -func NewCredentialDescriptor(credentialID string, transports []AuthenticatorTransport, attestationType string) *CredentialDescriptor { - return &CredentialDescriptor{ - CredentialID: URLEncodedBase64(credentialID), - Transport: transports, - AttestationType: attestationType, - Type: CredentialTypePublicKeyCredential, - } -} - -type AuthenticatorSelection struct { - // AuthenticatorAttachment If this member is present, eligible authenticators are filtered to only - // authenticators attached with the specified AuthenticatorAttachment enum. - AuthenticatorAttachment AuthenticatorAttachment `json:"authenticatorAttachment,omitempty"` - - // RequireResidentKey this member describes the Relying Party's requirements regarding resident - // credentials. If the parameter is set to true, the authenticator MUST create a client-side-resident - // public key credential source when creating a public key credential. - RequireResidentKey *bool `json:"requireResidentKey,omitempty"` - - // ResidentKey this member describes the Relying Party's requirements regarding resident - // credentials per Webauthn Level 2. - ResidentKey ResidentKeyRequirement `json:"residentKey,omitempty"` - - // UserVerification This member describes the Relying Party's requirements regarding user verification for - // the create() operation. Eligible authenticators are filtered to only those capable of satisfying this - // requirement. - UserVerification UserVerificationRequirement `json:"userVerification,omitempty"` -} - -type AuthenticatorData struct { - RPIDHash []byte `json:"rpid"` - Flags AuthenticatorFlags `json:"flags"` - Counter uint32 `json:"sign_count"` - AttData AttestedCredentialData `json:"att_data"` - ExtData []byte `json:"ext_data"` -} - -type AttestationObject struct { - // The authenticator data, including the newly created public key. See AuthenticatorData for more info - AuthData AuthenticatorData - - // The byteform version of the authenticator data, used in part for signature validation - RawAuthData []byte `json:"authData"` - - // The format of the Attestation data. - Format string `json:"fmt"` - - // The attestation statement data sent back if attestation is requested. - AttStatement map[string]any `json:"attStmt,omitempty"` -} - -type URLEncodedBase64 []byte - -func (e URLEncodedBase64) String() string { - return base64.RawURLEncoding.EncodeToString(e) -} - -// UnmarshalJSON base64 decodes a URL-encoded value, storing the result in the -// provided byte slice. -func (e *URLEncodedBase64) UnmarshalJSON(data []byte) error { - if bytes.Equal(data, []byte("null")) { - return nil - } - - // Trim the leading spaces. - data = bytes.Trim(data, "\"") - - // Trim the trailing equal characters. - data = bytes.TrimRight(data, "=") - - out := make([]byte, base64.RawURLEncoding.DecodedLen(len(data))) - - n, err := base64.RawURLEncoding.Decode(out, data) - if err != nil { - return err - } - - v := reflect.ValueOf(e).Elem() - v.SetBytes(out[:n]) - - return nil -} - -// MarshalJSON base64 encodes a non URL-encoded value, storing the result in the -// provided byte slice. -func (e URLEncodedBase64) MarshalJSON() ([]byte, error) { - if e == nil { - return []byte("null"), nil - } - - return []byte(`"` + base64.RawURLEncoding.EncodeToString(e) + `"`), nil -} 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 c1ff8a62a..74ba610c4 100644 --- a/x/did/keeper/genesis.go +++ b/x/did/keeper/genesis.go @@ -2,12 +2,10 @@ package keeper import ( "context" - "time" "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" ) @@ -33,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/ipfs.go b/x/did/keeper/ipfs.go deleted file mode 100644 index c02b39dea..000000000 --- a/x/did/keeper/ipfs.go +++ /dev/null @@ -1,106 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/path" - "github.com/ipfs/kubo/client/rpc" - "github.com/ipfs/kubo/core/coreiface/options" - "github.com/onsonr/sonr/internal/vfs" -) - -// assembleInitialVault assembles the initial vault -func (k Keeper) assembleInitialVault(ctx sdk.Context) (string, int64, error) { - cid, err := k.ipfsClient.Unixfs().Add(context.Background(), vfs.AssembleDirectory()) - if err != nil { - return "", 0, err - } - return cid.String(), k.GetExpirationBlockHeight(ctx, time.Second*15), nil -} - -// pinInitialVault pins the initial vault to the local IPFS node -func (k Keeper) pinInitialVault(_ 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 -} - -// GetFromIPFS gets a file from the local IPFS node -func (k Keeper) GetFromIPFS(ctx sdk.Context, cid string) (files.Directory, error) { - path, err := path.NewPath(cid) - if err != nil { - return nil, err - } - node, err := k.ipfsClient.Unixfs().Get(ctx, path) - if err != nil { - return nil, err - } - dir, ok := node.(files.Directory) - if !ok { - return nil, fmt.Errorf("retrieved node is not a directory") - } - return dir, nil -} - -// HasIPFSConnection returns true if the IPFS client is initialized -func (k *Keeper) HasIPFSConnection() bool { - if k.ipfsClient == nil { - ipfsClient, err := rpc.NewLocalApi() - if err != nil { - return false - } - k.ipfsClient = ipfsClient - } - return k.ipfsClient != nil -} - -// 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 -} - -// PinToIPFS pins a file to the local IPFS node -func (k Keeper) PinToIPFS(ctx sdk.Context, cid string, name string) error { - path, err := path.NewPath(cid) - if err != nil { - return err - } - err = k.ipfsClient.Pin().Add(ctx, path, options.Pin.Name(name)) - if err != nil { - return err - } - return 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 7abf637a2..ed453f671 100644 --- a/x/did/keeper/server.go +++ b/x/did/keeper/server.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "encoding/json" "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -22,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 @@ -75,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 { @@ -90,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, @@ -107,3 +63,9 @@ func (ms msgServer) UpdateParams( } return nil, ms.k.Params.Set(ctx, msg.Params) } + +// ExecuteTx implements types.MsgServer. +func (ms msgServer) ExecuteTx(ctx context.Context, msg *types.MsgExecuteTx) (*types.MsgExecuteTxResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + return &types.MsgExecuteTxResponse{}, nil +} diff --git a/x/did/keeper/state.go b/x/did/keeper/state.go deleted file mode 100644 index f8d8ac04b..000000000 --- a/x/did/keeper/state.go +++ /dev/null @@ -1,37 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/onsonr/sonr/x/did/builder" - "github.com/onsonr/sonr/x/did/types" -) - -// insertService inserts a service record into the database -func (k Keeper) insertService( - ctx sdk.Context, - svc *types.Service, -) (*types.MsgRegisterServiceResponse, error) { - record := builder.APIFormatServiceRecord(svc) - err := k.OrmDB.ServiceRecordTable().Insert(ctx, record) - if err != nil { - return nil, err - } - return &types.MsgRegisterServiceResponse{ - Success: true, - Did: record.Id, - }, nil -func (k Keeper) insertAliasFromDisplayName() { -} - -func (k Keeper) insertAssertionFromIdentity() { -} - -func (k Keeper) insertAuthenticationFromCredential() { -} - -func (k Keeper) insertControllerFromMotrVault() { -} - -func (k Keeper) insertDelegationFromAccount() { -} diff --git a/x/did/module.go b/x/did/module.go index 606c2b5b1..3d04d2c14 100644 --- a/x/did/module.go +++ b/x/did/module.go @@ -67,8 +67,7 @@ func (a AppModuleBasic) Name() string { func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { return cdc.MustMarshalJSON(&types.GenesisState{ - GlobalIntegrity: types.DefaultGlobalIntegrity(), - Params: types.DefaultParams(), + Params: types.DefaultParams(), }) } @@ -104,11 +103,11 @@ func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, messa if err := a.keeper.Params.Set(ctx, didGenesisState.Params); err != nil { panic(err) } - nftGenesisState := nft.DefaultGenesisState() - if err := types.DefaultNFTClasses(nftGenesisState); err != nil { - panic(err) - } - a.nftKeeper.InitGenesis(ctx, nftGenesisState) + // nftGenesisState := nft.DefaultGenesisState() + // if err := types.DefaultNFTClasses(nftGenesisState); err != nil { + // panic(err) + // } + // a.nftKeeper.InitGenesis(ctx, nftGenesisState) return nil } diff --git a/x/did/types/account.go b/x/did/types/account.go new file mode 100644 index 000000000..16be5f447 --- /dev/null +++ b/x/did/types/account.go @@ -0,0 +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 c883ac6aa..018e0f547 100644 --- a/x/did/types/codec.go +++ b/x/did/types/codec.go @@ -1,20 +1,12 @@ 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" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - "github.com/mr-tron/base58/base58" - "github.com/onsonr/crypto" // this line is used by starport scaffolding # 1 ) @@ -34,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) { @@ -48,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 34da6e029..1c14b1a39 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. @@ -41,8 +41,7 @@ const DefaultIndex uint64 = 1 func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # genesis/types/default - GlobalIntegrity: DefaultGlobalIntegrity(), - Params: DefaultParams(), + Params: DefaultParams(), } } @@ -56,23 +55,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"}, } } @@ -182,11 +171,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 f0a9d2267..3538713af 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -154,14 +154,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{} } @@ -210,20 +206,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 @@ -428,7 +410,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{} } @@ -788,69 +771,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 { @@ -888,12 +868,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 } @@ -1027,7 +1001,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 { @@ -1035,27 +1009,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 { @@ -1616,12 +1570,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)) @@ -2343,46 +2291,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) } @@ -2414,7 +2322,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/integrity.go b/x/did/types/integrity.go deleted file mode 100644 index e7eeb1eff..000000000 --- a/x/did/types/integrity.go +++ /dev/null @@ -1,27 +0,0 @@ -package types - -import "lukechampine.com/blake3" - -func (g *GlobalIntegrity) Update(address string) bool { - return true -} - -func (g *GlobalIntegrity) getProof() (*Proof, error) { - if g.Accumulator == nil { - return NewProof(g.Controller, g.proofProperty(), g.seedKdf()) - } - return &Proof{ - Issuer: g.Controller, - Property: g.proofProperty(), - Accumulator: g.Accumulator, - }, nil -} - -func (g *GlobalIntegrity) proofProperty() string { - return "did:sonr:integrity" -} - -func (g *GlobalIntegrity) seedKdf() []byte { - res := blake3.Sum256([]byte(g.Seed)) - return res[:] -} 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/x/did/types/namespace.go b/x/did/types/namespace.go deleted file mode 100644 index 1e6da75c9..000000000 --- a/x/did/types/namespace.go +++ /dev/null @@ -1,102 +0,0 @@ -package types - -import ( - "cosmossdk.io/x/nft" -) - -func (n DIDNamespace) ID() string { - switch n { - case DIDNamespace_DID_NAMESPACE_DWN: - return "did:dwn:0" - case DIDNamespace_DID_NAMESPACE_SONR: - return "did:sonr:0" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "did:btc:0" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "did:eth:0" - case DIDNamespace_DID_NAMESPACE_IBC: - return "did:ibc:0" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "did:authn:0" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "did:web:0" - case DIDNamespace_DID_NAMESPACE_IPFS: - return "did:ipfs:0" - } - return "" -} - -func (n DIDNamespace) Name() string { - switch n { - case DIDNamespace_DID_NAMESPACE_DWN: - return "DecentralizedWebNode" - case DIDNamespace_DID_NAMESPACE_SONR: - return "SonrNetwork" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "BitcoinNetwork" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "EthereumNetwork" - case DIDNamespace_DID_NAMESPACE_IBC: - return "IBCNetwork" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "WebAuthentication" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "DecentrlizedService" - case DIDNamespace_DID_NAMESPACE_IPFS: - return "IPFSStorage" - } - return "" -} - -func (n DIDNamespace) Symbol() string { - switch n { - case DIDNamespace_DID_NAMESPACE_DWN: - return "DWN" - case DIDNamespace_DID_NAMESPACE_SONR: - return "SONR" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "BTC" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "ETH" - case DIDNamespace_DID_NAMESPACE_IBC: - return "IBC" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "WEBAUTHN" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "SERVICE" - case DIDNamespace_DID_NAMESPACE_IPFS: - return "IPFS" - } - return "" -} - -func (n DIDNamespace) Description() string { - switch n { - case DIDNamespace_DID_NAMESPACE_DWN: - return "DWN Service Provider" - case DIDNamespace_DID_NAMESPACE_SONR: - return "Sonr Network Gateway" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "Bitcoin Network Gateway" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "Ethereum Network Gateway" - case DIDNamespace_DID_NAMESPACE_IBC: - return "IBC Network Gateway" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "Web Authentication Key" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "Decentrlized Service" - case DIDNamespace_DID_NAMESPACE_IPFS: - return "Data Storage on IPFS" - } - return "" -} - -func (n DIDNamespace) GetNFTClass() *nft.Class { - return &nft.Class{ - Id: n.ID(), - Name: n.Name(), - Symbol: n.Symbol(), - Description: n.Description(), - } -} diff --git a/x/did/types/oidc/DiscoveryDocument.pkl.go b/x/did/types/oidc/DiscoveryDocument.pkl.go deleted file mode 100644 index d25cce456..000000000 --- a/x/did/types/oidc/DiscoveryDocument.pkl.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated from Pkl module `oidc`. DO NOT EDIT. -package oidc - -type DiscoveryDocument struct { - Issuer string `pkl:"issuer" json:"issuer,omitempty" param:"issuer"` - - AuthorizationEndpoint string `pkl:"authorization_endpoint" json:"authorization_endpoint,omitempty" param:"authorization_endpoint"` - - TokenEndpoint string `pkl:"token_endpoint" json:"token_endpoint,omitempty" param:"token_endpoint"` - - UserinfoEndpoint string `pkl:"userinfo_endpoint" json:"userinfo_endpoint,omitempty" param:"userinfo_endpoint"` - - JwksUri string `pkl:"jwks_uri" json:"jwks_uri,omitempty" param:"jwks_uri"` - - RegistrationEndpoint string `pkl:"registration_endpoint" json:"registration_endpoint,omitempty" param:"registration_endpoint"` - - ScopesSupported []string `pkl:"scopes_supported" json:"scopes_supported,omitempty" param:"scopes_supported"` - - ResponseTypesSupported []string `pkl:"response_types_supported" json:"response_types_supported,omitempty" param:"response_types_supported"` - - ResponseModesSupported []string `pkl:"response_modes_supported" json:"response_modes_supported,omitempty" param:"response_modes_supported"` - - SubjectTypesSupported []string `pkl:"subject_types_supported" json:"subject_types_supported,omitempty" param:"subject_types_supported"` - - IdTokenSigningAlgValuesSupported []string `pkl:"id_token_signing_alg_values_supported" json:"id_token_signing_alg_values_supported,omitempty" param:"id_token_signing_alg_values_supported"` - - ClaimsSupported []string `pkl:"claims_supported" json:"claims_supported,omitempty" param:"claims_supported"` - - GrantTypesSupported []string `pkl:"grant_types_supported" json:"grant_types_supported,omitempty" param:"grant_types_supported"` - - AcrValuesSupported []string `pkl:"acr_values_supported" json:"acr_values_supported,omitempty" param:"acr_values_supported"` - - TokenEndpointAuthMethodsSupported []string `pkl:"token_endpoint_auth_methods_supported" json:"token_endpoint_auth_methods_supported,omitempty" param:"token_endpoint_auth_methods_supported"` -} diff --git a/x/did/types/oidc/Oidc.pkl.go b/x/did/types/oidc/Oidc.pkl.go deleted file mode 100644 index 3a4e4a67a..000000000 --- a/x/did/types/oidc/Oidc.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `oidc`. DO NOT EDIT. -package oidc - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Oidc struct { -} - -// LoadFromPath loads the pkl module at the given path and evaluates it into a Oidc -func LoadFromPath(ctx context.Context, path string) (ret *Oidc, 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 Oidc -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Oidc, error) { - var ret Oidc - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/x/did/types/oidc/init.pkl.go b/x/did/types/oidc/init.pkl.go deleted file mode 100644 index 0f351c673..000000000 --- a/x/did/types/oidc/init.pkl.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated from Pkl module `oidc`. DO NOT EDIT. -package oidc - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("oidc", Oidc{}) - pkl.RegisterMapping("oidc#DiscoveryDocument", DiscoveryDocument{}) -} 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/pubkey.go b/x/did/types/pubkey.go index 8d75ac1fb..ab1254f4c 100644 --- a/x/did/types/pubkey.go +++ b/x/did/types/pubkey.go @@ -1,153 +1 @@ package types - -import ( - "crypto/ecdsa" - "encoding/hex" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/mr-tron/base58/base58" - "github.com/onsonr/crypto" - "github.com/onsonr/crypto/macaroon" -) - -var WalletKeyInfo = &KeyInfo{ - Role: KeyRole_KEY_ROLE_DELEGATION, - Curve: KeyCurve_KEY_CURVE_SECP256K1, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_BIP32, -} - -var EthKeyInfo = &KeyInfo{ - Role: KeyRole_KEY_ROLE_DELEGATION, - Curve: KeyCurve_KEY_CURVE_KECCAK256, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_BIP32, -} - -var SonrKeyInfo = &KeyInfo{ - Role: KeyRole_KEY_ROLE_INVOCATION, - Curve: KeyCurve_KEY_CURVE_P256, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_MPC, -} - -var ChainCodeKeyInfos = map[ChainCode]*KeyInfo{ - ChainCodeBTC: WalletKeyInfo, - ChainCodeETH: EthKeyInfo, - ChainCodeSNR: SonrKeyInfo, - ChainCodeIBC: WalletKeyInfo, -} - -// NewEthPublicKey returns a new ethereum public key -func NewPublicKey(data []byte, keyInfo *KeyInfo) (*PubKey, error) { - encKey, err := keyInfo.Encoding.EncodeRaw(data) - if err != nil { - return nil, err - } - - return &PubKey{ - Raw: encKey, - Role: keyInfo.Role, - Encoding: keyInfo.Encoding, - Algorithm: keyInfo.Algorithm, - Curve: keyInfo.Curve, - KeyType: keyInfo.Type, - }, nil -} - -// Address returns the address of the public key -func (k *PubKey) Address() cryptotypes.Address { - return nil -} - -// Bytes returns the raw bytes of the public key -func (k *PubKey) Bytes() []byte { - bz, _ := k.GetEncoding().DecodeRaw(k.GetRaw()) - return bz -} - -// Clone returns a copy of the public key -func (k *PubKey) Clone() cryptotypes.PubKey { - return &PubKey{ - Raw: k.GetRaw(), - Role: k.GetRole(), - Encoding: k.GetEncoding(), - Algorithm: k.GetAlgorithm(), - Curve: k.GetCurve(), - KeyType: k.GetKeyType(), - } -} - -// IssueMacaroon returns a macaroon for the public key with the given id and location -func (pk *PubKey) IssueMacaroon(subject string, origin string) (*macaroon.Macaroon, error) { - return macaroon.New(pk.Bytes(), []byte(subject), origin, macaroon.LatestVersion) -} - -// ECDSA returns the ECDSA public key -func (k *PubKey) ECDSA() (*ecdsa.PublicKey, error) { - return crypto.ComputeEcdsaPublicKey(k.Bytes()) -} - -// VerifySignature verifies a signature over the given message -func (k *PubKey) VerifySignature(msg []byte, sig []byte) bool { - pk, err := crypto.ComputeEcdsaPublicKey(k.Bytes()) - sigMpc, err := crypto.DeserializeMPCSignature(sig) - if err != nil { - return false - } - return crypto.VerifyMPCSignature(sigMpc, msg, pk) -} - -// Equals returns true if two public keys are equal -func (k *PubKey) Equals(k2 cryptotypes.PubKey) bool { - if k == nil && k2 == nil { - return true - } - return false -} - -// Type returns the type of the public key -func (k *PubKey) Type() string { - return k.KeyType.String() -} - -// DecodePublicKey extracts the public key from the given data -func (k *KeyInfo) DecodePublicKey(data interface{}) ([]byte, error) { - var bz []byte - switch v := data.(type) { - case string: - bz = []byte(v) - case []byte: - bz = v - default: - return nil, ErrUnsupportedKeyEncoding - } - - if k.Encoding == KeyEncoding_KEY_ENCODING_RAW { - return bz, nil - } - if k.Encoding == KeyEncoding_KEY_ENCODING_HEX { - return hex.DecodeString(string(bz)) - } - if k.Encoding == KeyEncoding_KEY_ENCODING_MULTIBASE { - return base58.Decode(string(bz)) - } - return nil, ErrUnsupportedKeyEncoding -} - -// EncodePublicKey encodes the public key according to the KeyInfo's encoding -func (k *KeyInfo) EncodePublicKey(data []byte) (string, error) { - if k.Encoding == KeyEncoding_KEY_ENCODING_RAW { - return string(data), nil - } - if k.Encoding == KeyEncoding_KEY_ENCODING_HEX { - return hex.EncodeToString(data), nil - } - if k.Encoding == KeyEncoding_KEY_ENCODING_MULTIBASE { - return base58.Encode(data), nil - } - return "", ErrUnsupportedKeyEncoding -} 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/scopes.go b/x/did/types/scopes.go deleted file mode 100644 index c64c97922..000000000 --- a/x/did/types/scopes.go +++ /dev/null @@ -1,53 +0,0 @@ -package types - -import "gopkg.in/macaroon-bakery.v2/bakery/checkers" - -var ( - PermissionScopeStrings = [...]string{ - "profile.name", - "identifiers.email", - "identifiers.phone", - "transactions.read", - "transactions.write", - "wallets.read", - "wallets.create", - "wallets.subscribe", - "wallets.update", - "transactions.verify", - "transactions.broadcast", - "admin.user", - "admin.validator", - } - - StringToPermissionScope = map[string]PermissionScope{ - "PERMISSION_SCOPE_UNSPECIFIED": PermissionScope_PERMISSION_SCOPE_UNSPECIFIED, - "PERMISSION_SCOPE_BASIC_INFO": PermissionScope_PERMISSION_SCOPE_BASIC_INFO, - "PERMISSION_SCOPE_IDENTIFIERS_EMAIL": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ, - "PERMISSION_SCOPE_IDENTIFIERS_PHONE": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE, - "PERMISSION_SCOPE_TRANSACTIONS_READ": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ, - "PERMISSION_SCOPE_TRANSACTIONS_WRITE": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE, - "PERMISSION_SCOPE_WALLETS_READ": PermissionScope_PERMISSION_SCOPE_WALLETS_READ, - "PERMISSION_SCOPE_WALLETS_CREATE": PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE, - "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE, - "PERMISSION_SCOPE_WALLETS_UPDATE": PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE, - "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY, - "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST, - "PERMISSION_SCOPE_ADMIN_USER": PermissionScope_PERMISSION_SCOPE_ADMIN_USER, - "PERMISSION_SCOPE_ADMIN_VALIDATOR": PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR, - } -) - -func ResolvePermissionScope(scope string) (PermissionScope, bool) { - uriToPrefix := make(map[string]string) - for _, scope := range PermissionScopeStrings { - uriToPrefix["https://example.com/auth/"+scope] = scope - } - PermissionNamespace := checkers.NewNamespace(uriToPrefix) - - prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope) - if !ok { - return 0, false - } - permScope, ok := StringToPermissionScope[prefix] - return permScope, ok -} diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index a2c173085..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, 0xd5, 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, 0x58, 0x8d, 0xb9, 0xaa, 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 07dea1660..017435684 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -30,9 +30,504 @@ 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. +// MsgRegisterController is the message type for the InitializeController RPC. +type MsgRegisterController struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // Assertions is the list of assertions to initialize the controller with. + 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 [][]byte `protobuf:"bytes,4,rep,name=verifications,proto3" json:"verifications,omitempty"` +} + +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{0} +} +func (m *MsgRegisterController) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterController) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterController.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 *MsgRegisterController) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterController.Merge(m, src) +} +func (m *MsgRegisterController) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterController) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterController.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterController proto.InternalMessageInfo + +func (m *MsgRegisterController) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgRegisterController) GetAssertions() [][]byte { + if m != nil { + return m.Assertions + } + return nil +} + +func (m *MsgRegisterController) GetKeyshares() [][]byte { + if m != nil { + return m.Keyshares + } + return nil +} + +func (m *MsgRegisterController) GetVerifications() [][]byte { + if m != nil { + return m.Verifications + } + return nil +} + +// 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 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"` + // Accounts are a Address Map and Supported coin Denoms for the controller + Accounts map[string]string `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *MsgRegisterControllerResponse) Reset() { *m = MsgRegisterControllerResponse{} } +func (m *MsgRegisterControllerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterControllerResponse) ProtoMessage() {} +func (*MsgRegisterControllerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{1} +} +func (m *MsgRegisterControllerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterControllerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterControllerResponse.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 *MsgRegisterControllerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterControllerResponse.Merge(m, src) +} +func (m *MsgRegisterControllerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterControllerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterControllerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterControllerResponse proto.InternalMessageInfo + +func (m *MsgRegisterControllerResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *MsgRegisterControllerResponse) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *MsgRegisterControllerResponse) GetAccounts() map[string]string { + if m != nil { + return m.Accounts + } + return nil +} + +// MsgExecuteTx is the message type for the ExecuteTx RPC. +type MsgExecuteTx struct { + // Controller is the address of the controller to authenticate. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // Messages is the list of messages to execute. + Messages map[string][]byte `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // MacaroonToken is the macaroon token to authenticate the operation. + MacaroonToken string `protobuf:"bytes,3,opt,name=macaroon_token,json=macaroonToken,proto3" json:"macaroon_token,omitempty"` +} + +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{2} +} +func (m *MsgExecuteTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecuteTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecuteTx.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 *MsgExecuteTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecuteTx.Merge(m, src) +} +func (m *MsgExecuteTx) XXX_Size() int { + return m.Size() +} +func (m *MsgExecuteTx) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecuteTx.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecuteTx proto.InternalMessageInfo + +func (m *MsgExecuteTx) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *MsgExecuteTx) GetMessages() map[string][]byte { + if m != nil { + return m.Messages + } + return nil +} + +func (m *MsgExecuteTx) GetMacaroonToken() string { + if m != nil { + return m.MacaroonToken + } + return "" +} + +// MsgExecuteTxResponse is the response type for the ExecuteTx RPC. +type MsgExecuteTxResponse struct { + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` +} + +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{3} +} +func (m *MsgExecuteTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecuteTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecuteTxResponse.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 *MsgExecuteTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecuteTxResponse.Merge(m, src) +} +func (m *MsgExecuteTxResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExecuteTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecuteTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecuteTxResponse proto.InternalMessageInfo + +func (m *MsgExecuteTxResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *MsgExecuteTxResponse) GetTxHash() string { + if m != nil { + return m.TxHash + } + return "" +} + +// MsgAuthorizeService is the message type for the AuthorizeService RPC. +type MsgAuthorizeService struct { + // Controller is the address of the controller to authenticate. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // Origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + // Permissions is the scope of the service. + Permissions map[string]string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` +} + +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{4} +} +func (m *MsgAuthorizeService) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuthorizeService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuthorizeService.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 *MsgAuthorizeService) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuthorizeService.Merge(m, src) +} +func (m *MsgAuthorizeService) XXX_Size() int { + return m.Size() +} +func (m *MsgAuthorizeService) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuthorizeService.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuthorizeService proto.InternalMessageInfo + +func (m *MsgAuthorizeService) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *MsgAuthorizeService) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *MsgAuthorizeService) GetPermissions() map[string]string { + if m != nil { + return m.Permissions + } + return nil +} + +func (m *MsgAuthorizeService) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +// 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"` +} + +func (m *MsgAuthorizeServiceResponse) Reset() { *m = MsgAuthorizeServiceResponse{} } +func (m *MsgAuthorizeServiceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAuthorizeServiceResponse) ProtoMessage() {} +func (*MsgAuthorizeServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{5} +} +func (m *MsgAuthorizeServiceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuthorizeServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuthorizeServiceResponse.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 *MsgAuthorizeServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuthorizeServiceResponse.Merge(m, src) +} +func (m *MsgAuthorizeServiceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAuthorizeServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuthorizeServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuthorizeServiceResponse proto.InternalMessageInfo + +func (m *MsgAuthorizeServiceResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *MsgAuthorizeServiceResponse) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +// MsgRegisterService is the message type for the RegisterService RPC. +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. + Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` +} + +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{6} +} +func (m *MsgRegisterService) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterService.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 *MsgRegisterService) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterService.Merge(m, src) +} +func (m *MsgRegisterService) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterService) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterService.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterService proto.InternalMessageInfo + +func (m *MsgRegisterService) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *MsgRegisterService) GetService() *Service { + if m != nil { + return m.Service + } + return nil +} + +// MsgRegisterServiceResponse is the response type for the RegisterService RPC. +type MsgRegisterServiceResponse struct { + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` +} + +func (m *MsgRegisterServiceResponse) Reset() { *m = MsgRegisterServiceResponse{} } +func (m *MsgRegisterServiceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterServiceResponse) ProtoMessage() {} +func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{7} +} +func (m *MsgRegisterServiceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterServiceResponse.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 *MsgRegisterServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterServiceResponse.Merge(m, src) +} +func (m *MsgRegisterServiceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterServiceResponse proto.InternalMessageInfo + +func (m *MsgRegisterServiceResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *MsgRegisterServiceResponse) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + +// 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. Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` @@ -40,11 +535,11 @@ type MsgAllocateVault struct { Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,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 *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{8} } func (m *MsgAllocateVault) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -105,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{1} + return fileDescriptor_d73284df019ff211, []int{9} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,522 +629,13 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { 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_d73284df019ff211, []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_d73284df019ff211, []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 -} - -// MsgRegisterController is the message type for the InitializeController RPC. -type MsgRegisterController struct { - // authority is the address of the governance account. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // Assertions is the list of assertions to initialize the controller with. - 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 [][]byte `protobuf:"bytes,4,rep,name=verifications,proto3" json:"verifications,omitempty"` -} - -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{4} -} -func (m *MsgRegisterController) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterController) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterController.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 *MsgRegisterController) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterController.Merge(m, src) -} -func (m *MsgRegisterController) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterController) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterController.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterController proto.InternalMessageInfo - -func (m *MsgRegisterController) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgRegisterController) GetAssertions() [][]byte { - if m != nil { - return m.Assertions - } - return nil -} - -func (m *MsgRegisterController) GetKeyshares() [][]byte { - if m != nil { - return m.Keyshares - } - return nil -} - -func (m *MsgRegisterController) GetVerifications() [][]byte { - if m != nil { - return m.Verifications - } - return nil -} - -// 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 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"` - // Accounts are a Address Map and Supported coin Denoms for the controller - Accounts map[string]string `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *MsgRegisterControllerResponse) Reset() { *m = MsgRegisterControllerResponse{} } -func (m *MsgRegisterControllerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterControllerResponse) ProtoMessage() {} -func (*MsgRegisterControllerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{5} -} -func (m *MsgRegisterControllerResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterControllerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterControllerResponse.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 *MsgRegisterControllerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterControllerResponse.Merge(m, src) -} -func (m *MsgRegisterControllerResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterControllerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterControllerResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterControllerResponse proto.InternalMessageInfo - -func (m *MsgRegisterControllerResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func (m *MsgRegisterControllerResponse) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *MsgRegisterControllerResponse) GetAccounts() map[string]string { - if m != nil { - return m.Accounts - } - return nil -} - -// MsgAuthorizeService is the message type for the AuthorizeService RPC. -type MsgAuthorizeService struct { - // Controller is the address of the controller to authenticate. - Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` - // Origin is the origin of the request in wildcard form. - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - // Permissions is the scope of the service. - Permissions map[string]string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // token is the macron token to authenticate the operation. - Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` -} - -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} -} -func (m *MsgAuthorizeService) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAuthorizeService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAuthorizeService.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 *MsgAuthorizeService) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAuthorizeService.Merge(m, src) -} -func (m *MsgAuthorizeService) XXX_Size() int { - return m.Size() -} -func (m *MsgAuthorizeService) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAuthorizeService.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAuthorizeService proto.InternalMessageInfo - -func (m *MsgAuthorizeService) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *MsgAuthorizeService) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -func (m *MsgAuthorizeService) GetPermissions() map[string]string { - if m != nil { - return m.Permissions - } - return nil -} - -func (m *MsgAuthorizeService) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -// 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"` -} - -func (m *MsgAuthorizeServiceResponse) Reset() { *m = MsgAuthorizeServiceResponse{} } -func (m *MsgAuthorizeServiceResponse) String() string { return proto.CompactTextString(m) } -func (*MsgAuthorizeServiceResponse) ProtoMessage() {} -func (*MsgAuthorizeServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{7} -} -func (m *MsgAuthorizeServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAuthorizeServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAuthorizeServiceResponse.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 *MsgAuthorizeServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAuthorizeServiceResponse.Merge(m, src) -} -func (m *MsgAuthorizeServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgAuthorizeServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAuthorizeServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAuthorizeServiceResponse proto.InternalMessageInfo - -func (m *MsgAuthorizeServiceResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func (m *MsgAuthorizeServiceResponse) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -// MsgRegisterService is the message type for the RegisterService RPC. -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. - Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` -} - -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} -} -func (m *MsgRegisterService) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterService.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 *MsgRegisterService) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterService.Merge(m, src) -} -func (m *MsgRegisterService) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterService) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterService.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterService proto.InternalMessageInfo - -func (m *MsgRegisterService) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *MsgRegisterService) GetService() *Service { - if m != nil { - return m.Service - } - return nil -} - -// MsgRegisterServiceResponse is the response type for the RegisterService RPC. -type MsgRegisterServiceResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` -} - -func (m *MsgRegisterServiceResponse) Reset() { *m = MsgRegisterServiceResponse{} } -func (m *MsgRegisterServiceResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterServiceResponse) ProtoMessage() {} -func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d73284df019ff211, []int{9} -} -func (m *MsgRegisterServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterServiceResponse.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 *MsgRegisterServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterServiceResponse.Merge(m, src) -} -func (m *MsgRegisterServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterServiceResponse proto.InternalMessageInfo - -func (m *MsgRegisterServiceResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func (m *MsgRegisterServiceResponse) GetDid() string { - if m != nil { - return m.Did - } - return "" -} - func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "did.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "did.v1.MsgUpdateParamsResponse") - 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") + proto.RegisterType((*MsgExecuteTx)(nil), "did.v1.MsgExecuteTx") + proto.RegisterMapType((map[string][]byte)(nil), "did.v1.MsgExecuteTx.MessagesEntry") + proto.RegisterType((*MsgExecuteTxResponse)(nil), "did.v1.MsgExecuteTxResponse") proto.RegisterType((*MsgAuthorizeService)(nil), "did.v1.MsgAuthorizeService") proto.RegisterMapType((map[string]string)(nil), "did.v1.MsgAuthorizeService.PermissionsEntry") proto.RegisterType((*MsgAuthorizeServiceResponse)(nil), "did.v1.MsgAuthorizeServiceResponse") @@ -662,58 +648,58 @@ func init() { func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) } var fileDescriptor_d73284df019ff211 = []byte{ - // 806 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xfb, 0x44, - 0x10, 0x8d, 0xe3, 0xfc, 0xf2, 0x6b, 0x26, 0x6d, 0x13, 0x2d, 0x85, 0xba, 0x2e, 0x4d, 0x83, 0x01, - 0x29, 0x54, 0x25, 0x51, 0x5b, 0x09, 0x55, 0x05, 0x21, 0x35, 0x08, 0xa9, 0x12, 0x0a, 0x14, 0x17, - 0x38, 0xf4, 0x52, 0x39, 0xf6, 0xe2, 0x2c, 0x71, 0xbc, 0xd1, 0xee, 0x26, 0x6a, 0x38, 0xf1, 0xe7, - 0x86, 0x38, 0xf0, 0x05, 0xe0, 0xcc, 0xb1, 0x07, 0xbe, 0x01, 0x97, 0x1e, 0x2b, 0x4e, 0x9c, 0x10, - 0x6a, 0x0f, 0xfd, 0x1a, 0xc8, 0x5e, 0xdb, 0x71, 0xfe, 0x34, 0x6a, 0xcb, 0x25, 0xf2, 0xcc, 0x1b, - 0xcf, 0xbe, 0x37, 0xf3, 0xb2, 0x86, 0x92, 0x43, 0x9c, 0xc6, 0x70, 0xaf, 0x21, 0x2e, 0xeb, 0x7d, - 0x46, 0x05, 0x45, 0x79, 0x87, 0x38, 0xf5, 0xe1, 0x9e, 0xbe, 0x6e, 0x53, 0xde, 0xa3, 0xbc, 0xd1, - 0xe3, 0x6e, 0x80, 0xf7, 0xb8, 0x2b, 0x0b, 0xf4, 0x0d, 0x09, 0x5c, 0x84, 0x51, 0x43, 0x06, 0x11, - 0xb4, 0x16, 0x35, 0x73, 0xb1, 0x8f, 0x39, 0x49, 0xb2, 0x2e, 0x75, 0xa9, 0xac, 0x0e, 0x9e, 0x64, - 0xd6, 0xf8, 0x55, 0x81, 0x52, 0x8b, 0xbb, 0x5f, 0xf6, 0x1d, 0x4b, 0xe0, 0x53, 0x8b, 0x59, 0x3d, - 0x8e, 0xde, 0x83, 0x82, 0x35, 0x10, 0x1d, 0xca, 0x88, 0x18, 0x69, 0x4a, 0x55, 0xa9, 0x15, 0x9a, - 0xda, 0x5f, 0x7f, 0xbc, 0xbb, 0x16, 0x1d, 0x72, 0xec, 0x38, 0x0c, 0x73, 0x7e, 0x26, 0x18, 0xf1, - 0x5d, 0x73, 0x5c, 0x8a, 0x76, 0x21, 0xdf, 0x0f, 0x3b, 0x68, 0xd9, 0xaa, 0x52, 0x2b, 0xee, 0xaf, - 0xd6, 0xa5, 0x88, 0xba, 0xec, 0xdb, 0xcc, 0x5d, 0xff, 0xb3, 0x9d, 0x31, 0xa3, 0x1a, 0xb4, 0x06, - 0x2f, 0x04, 0xed, 0x62, 0x5f, 0x53, 0x83, 0x13, 0x4c, 0x19, 0x1c, 0xad, 0xfe, 0x70, 0x7f, 0xb5, - 0x33, 0xee, 0x69, 0x6c, 0xc0, 0xfa, 0x14, 0x3d, 0x13, 0xf3, 0x3e, 0xf5, 0x39, 0x36, 0x7e, 0x56, - 0xa0, 0xdc, 0xe2, 0xee, 0xb1, 0xe7, 0x51, 0xdb, 0x12, 0xf8, 0x2b, 0x6b, 0xe0, 0x89, 0x67, 0x73, - 0xd7, 0xe0, 0x25, 0x1f, 0xb4, 0xbf, 0xc1, 0xb6, 0x08, 0xc9, 0x17, 0xcc, 0x38, 0x44, 0xaf, 0x41, - 0x9e, 0x32, 0xe2, 0x92, 0x98, 0x68, 0x14, 0xcd, 0x30, 0xfd, 0x51, 0x01, 0x6d, 0x9a, 0x4e, 0xcc, - 0x15, 0x95, 0x41, 0xb5, 0x89, 0x23, 0x09, 0x99, 0xc1, 0x23, 0x7a, 0x03, 0x96, 0xf1, 0x65, 0x9f, - 0xb0, 0xd1, 0x45, 0xdb, 0xa3, 0x76, 0x37, 0x3c, 0x55, 0x35, 0x8b, 0x32, 0xd7, 0x0c, 0x52, 0xf3, - 0x27, 0x84, 0x5e, 0x87, 0x42, 0x70, 0x82, 0xd7, 0xa1, 0x5c, 0x68, 0xb9, 0xaa, 0x52, 0x5b, 0x32, - 0xc7, 0x09, 0xe3, 0x4f, 0x05, 0x5e, 0x6d, 0x71, 0xd7, 0xc4, 0x2e, 0xe1, 0x02, 0xb3, 0x8f, 0xa8, - 0x2f, 0x18, 0xf5, 0x3c, 0xcc, 0x9e, 0x3d, 0x99, 0x0a, 0x80, 0xc5, 0x39, 0x66, 0x82, 0x50, 0x3f, - 0xd8, 0xac, 0x5a, 0x5b, 0x36, 0x53, 0x99, 0x80, 0x4f, 0x17, 0x8f, 0x78, 0xc7, 0x62, 0x98, 0x6b, - 0x6a, 0x08, 0x8f, 0x13, 0xe8, 0x2d, 0x58, 0x19, 0x62, 0x46, 0xbe, 0x26, 0xb6, 0x25, 0x1b, 0xe4, - 0xc2, 0x8a, 0xc9, 0xe4, 0xcc, 0x2c, 0xbf, 0xcf, 0xc2, 0xd6, 0x5c, 0x15, 0xc9, 0x40, 0xc3, 0x7d, - 0xd9, 0x36, 0xe6, 0x3c, 0xd4, 0xb2, 0x64, 0xc6, 0x21, 0x3a, 0x04, 0xb0, 0x93, 0x7a, 0xb9, 0xcc, - 0x05, 0x42, 0x53, 0xb5, 0xe8, 0x33, 0x58, 0xb2, 0x6c, 0x9b, 0x0e, 0x7c, 0x21, 0x85, 0x14, 0xf7, - 0x0f, 0x62, 0x07, 0x2f, 0x24, 0x53, 0x3f, 0x8e, 0xde, 0xfa, 0xd8, 0x17, 0x6c, 0x64, 0x26, 0x4d, - 0xf4, 0xf7, 0x61, 0x65, 0x02, 0x0a, 0x6c, 0xd0, 0xc5, 0xa3, 0xd8, 0x06, 0x5d, 0x3c, 0x0a, 0x76, - 0x3c, 0xb4, 0xbc, 0x01, 0x8e, 0x5c, 0x27, 0x83, 0xa3, 0xec, 0xa1, 0x62, 0xfc, 0x96, 0x85, 0x57, - 0x02, 0x3f, 0xc9, 0xa1, 0x7c, 0x8b, 0xcf, 0x30, 0x1b, 0x12, 0x1b, 0x4f, 0xe9, 0x53, 0x9e, 0xa0, - 0x6f, 0xec, 0xe4, 0x6c, 0xda, 0xc9, 0xe8, 0x53, 0x28, 0xf6, 0x31, 0xeb, 0x11, 0xce, 0xc3, 0x0d, - 0x49, 0xe9, 0xbb, 0x29, 0xe9, 0xd3, 0x1c, 0xea, 0xa7, 0xe3, 0x72, 0xa9, 0x39, 0xdd, 0x60, 0xec, - 0xdb, 0x5c, 0xca, 0xb7, 0xfa, 0x87, 0x50, 0x9e, 0x7e, 0xed, 0x29, 0xf3, 0x38, 0x2a, 0x05, 0x1e, - 0x49, 0xc9, 0x31, 0x5a, 0xb0, 0x39, 0x87, 0xdb, 0x23, 0x1c, 0x92, 0xf0, 0xcb, 0xa6, 0xf8, 0x19, - 0x3f, 0x29, 0x80, 0x52, 0x6b, 0xfe, 0xff, 0xe3, 0x7e, 0x07, 0x5e, 0x72, 0xd9, 0x24, 0xba, 0x0f, - 0x4b, 0xf1, 0x48, 0x63, 0xaa, 0x31, 0x3e, 0xab, 0xed, 0x04, 0xf4, 0x59, 0x2e, 0x8f, 0x90, 0x56, - 0x06, 0xd5, 0x21, 0x4e, 0x24, 0x2c, 0x78, 0xdc, 0xff, 0x5d, 0x05, 0xb5, 0xc5, 0x5d, 0x74, 0x02, - 0xcb, 0x13, 0x97, 0xfc, 0x7a, 0x6a, 0xbf, 0x69, 0x40, 0xdf, 0x7e, 0x00, 0x48, 0x4e, 0xff, 0x02, - 0xca, 0x33, 0xa6, 0xdc, 0x5c, 0xe0, 0x16, 0xfd, 0xcd, 0x05, 0x60, 0xd2, 0xf5, 0x13, 0x58, 0x99, - 0xbc, 0xc9, 0xb5, 0xf4, 0x5b, 0x69, 0x44, 0xaf, 0x3e, 0x84, 0x24, 0xcd, 0xce, 0x01, 0xcd, 0xb9, - 0x01, 0xb7, 0x16, 0xfe, 0x9b, 0xf5, 0xb7, 0x1f, 0xf5, 0x67, 0x47, 0x9f, 0x43, 0x69, 0xda, 0x23, - 0xfa, 0x9c, 0x37, 0x63, 0xf1, 0xc6, 0xc3, 0x58, 0xdc, 0x52, 0x7f, 0xf1, 0xdd, 0xfd, 0xd5, 0x8e, - 0xd2, 0xfc, 0xe0, 0xfa, 0xb6, 0xa2, 0xdc, 0xdc, 0x56, 0x94, 0x7f, 0x6f, 0x2b, 0xca, 0x2f, 0x77, - 0x95, 0xcc, 0xcd, 0x5d, 0x25, 0xf3, 0xf7, 0x5d, 0x25, 0x73, 0x6e, 0xb8, 0x44, 0x74, 0x06, 0xed, - 0xba, 0x4d, 0x7b, 0x0d, 0xea, 0x73, 0xea, 0xb3, 0x46, 0xf8, 0x73, 0xd9, 0x08, 0x3e, 0xf5, 0x62, - 0xd4, 0xc7, 0xbc, 0x9d, 0x0f, 0x3f, 0xe8, 0x07, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x20, 0x91, - 0xda, 0xb5, 0x4b, 0x08, 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. @@ -728,19 +714,20 @@ 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 { - // 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) - // 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) - // 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) - // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. + // 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(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) } type msgClient struct { @@ -751,15 +738,6 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/did.v1.Msg/UpdateParams", 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...) @@ -769,9 +747,9 @@ func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgAuthorizeServic return out, nil } -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...) +func (c *msgClient) ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, error) { + out := new(MsgExecuteTxResponse) + err := c.cc.Invoke(ctx, "/did.v1.Msg/ExecuteTx", in, out, opts...) if err != nil { return nil, err } @@ -796,35 +774,42 @@ func (c *msgClient) RegisterService(ctx context.Context, in *MsgRegisterService, 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, "/did.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 { - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, 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) - // 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) - // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. + // 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(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) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} func (*UnimplementedMsgServer) AuthorizeService(ctx context.Context, req *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") } -func (*UnimplementedMsgServer) AllocateVault(ctx context.Context, req *MsgAllocateVault) (*MsgAllocateVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented") +func (*UnimplementedMsgServer) ExecuteTx(ctx context.Context, req *MsgExecuteTx) (*MsgExecuteTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteTx not implemented") } func (*UnimplementedMsgServer) RegisterController(ctx context.Context, req *MsgRegisterController) (*MsgRegisterControllerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterController not implemented") @@ -832,29 +817,14 @@ func (*UnimplementedMsgServer) RegisterController(ctx context.Context, req *MsgR func (*UnimplementedMsgServer) RegisterService(ctx context.Context, req *MsgRegisterService) (*MsgRegisterServiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterService 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_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: "/did.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) -} - 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 { @@ -873,20 +843,20 @@ func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAllocateVault) +func _Msg_ExecuteTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecuteTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AllocateVault(ctx, in) + return srv.(MsgServer).ExecuteTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/did.v1.Msg/AllocateVault", + FullMethod: "/did.v1.Msg/ExecuteTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault)) + return srv.(MsgServer).ExecuteTx(ctx, req.(*MsgExecuteTx)) } return interceptor(ctx, in, info, handler) } @@ -927,21 +897,35 @@ func _Msg_RegisterService_Handler(srv interface{}, ctx context.Context, dec func 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: "/did.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: "did.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, { MethodName: "AuthorizeService", Handler: _Msg_AuthorizeService_Handler, }, { - MethodName: "AllocateVault", - Handler: _Msg_AllocateVault_Handler, + MethodName: "ExecuteTx", + Handler: _Msg_ExecuteTx_Handler, }, { MethodName: "RegisterController", @@ -951,177 +935,15 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RegisterService", Handler: _Msg_RegisterService_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, 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 *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 - } - { - 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 (m *MsgRegisterController) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1238,6 +1060,104 @@ func (m *MsgRegisterControllerResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgExecuteTx) 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 *MsgExecuteTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecuteTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MacaroonToken) > 0 { + i -= len(m.MacaroonToken) + copy(dAtA[i:], m.MacaroonToken) + i = encodeVarintTx(dAtA, i, uint64(len(m.MacaroonToken))) + i-- + dAtA[i] = 0x1a + } + if len(m.Messages) > 0 { + for k := range m.Messages { + v := m.Messages[k] + baseI := i + if len(v) > 0 { + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintTx(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTx(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTx(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTx(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExecuteTxResponse) 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 *MsgExecuteTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecuteTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TxHash) > 0 { + i -= len(m.TxHash) + copy(dAtA[i:], m.TxHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.TxHash))) + 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 *MsgAuthorizeService) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1504,78 +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 = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.Token) - if l > 0 { - 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 (m *MsgRegisterController) Size() (n int) { if m == nil { return 0 @@ -1631,6 +1479,51 @@ func (m *MsgRegisterControllerResponse) Size() (n int) { return n } +func (m *MsgExecuteTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Messages) > 0 { + for k, v := range m.Messages { + _ = k + _ = v + l = 0 + if len(v) > 0 { + l = 1 + len(v) + sovTx(uint64(len(v))) + } + mapEntrySize := 1 + len(k) + sovTx(uint64(len(k))) + l + n += mapEntrySize + 1 + sovTx(uint64(mapEntrySize)) + } + } + l = len(m.MacaroonToken) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgExecuteTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + l = len(m.TxHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func (m *MsgAuthorizeService) Size() (n int) { if m == nil { return 0 @@ -1709,508 +1602,40 @@ func (m *MsgRegisterServiceResponse) Size() (n int) { return n } +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)) + l = len(m.Token) + if l > 0 { + 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 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 *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 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 - 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 - 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 (m *MsgRegisterController) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2618,6 +2043,350 @@ func (m *MsgRegisterControllerResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgExecuteTx) 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: MsgExecuteTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", 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.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Messages", 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 m.Messages == nil { + m.Messages = make(map[string][]byte) + } + var mapkey string + mapvalue := []byte{} + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthTx + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthTx + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapbyteLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapbyteLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intMapbyteLen := int(mapbyteLen) + if intMapbyteLen < 0 { + return ErrInvalidLengthTx + } + postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex < 0 { + return ErrInvalidLengthTx + } + if postbytesIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = make([]byte, mapbyteLen) + copy(mapvalue, dAtA[iNdEx:postbytesIndex]) + iNdEx = postbytesIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Messages[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MacaroonToken", 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.MacaroonToken = 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 *MsgExecuteTxResponse) 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: MsgExecuteTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteTxResponse: 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 ErrIntOverflowTx + } + 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 TxHash", 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.TxHash = 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 *MsgAuthorizeService) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3213,6 +2982,203 @@ func (m *MsgRegisterServiceResponse) Unmarshal(dAtA []byte) error { } return nil } +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 + 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 + 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/txns/Msg.pkl.go b/x/did/types/txns/Msg.pkl.go deleted file mode 100644 index 316adf06d..000000000 --- a/x/did/types/txns/Msg.pkl.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -type Msg interface { - GetTypeUrl() string -} diff --git a/x/did/types/txns/MsgDidAllocateVault.pkl.go b/x/did/types/txns/MsgDidAllocateVault.pkl.go deleted file mode 100644 index dcb4a04e4..000000000 --- a/x/did/types/txns/MsgDidAllocateVault.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgDidAuthorize.pkl.go b/x/did/types/txns/MsgDidAuthorize.pkl.go deleted file mode 100644 index 344bbe81a..000000000 --- a/x/did/types/txns/MsgDidAuthorize.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgDidProveWitness.pkl.go b/x/did/types/txns/MsgDidProveWitness.pkl.go deleted file mode 100644 index 6ea127769..000000000 --- a/x/did/types/txns/MsgDidProveWitness.pkl.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgDidRegisterController.pkl.go b/x/did/types/txns/MsgDidRegisterController.pkl.go deleted file mode 100644 index dc6d3651b..000000000 --- a/x/did/types/txns/MsgDidRegisterController.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgDidRegisterService.pkl.go b/x/did/types/txns/MsgDidRegisterService.pkl.go deleted file mode 100644 index 3d2f849a5..000000000 --- a/x/did/types/txns/MsgDidRegisterService.pkl.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgDidSyncVault.pkl.go b/x/did/types/txns/MsgDidSyncVault.pkl.go deleted file mode 100644 index c7f38de0a..000000000 --- a/x/did/types/txns/MsgDidSyncVault.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgDidUpdateParams.pkl.go b/x/did/types/txns/MsgDidUpdateParams.pkl.go deleted file mode 100644 index 566383b4f..000000000 --- a/x/did/types/txns/MsgDidUpdateParams.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgGovDeposit.pkl.go b/x/did/types/txns/MsgGovDeposit.pkl.go deleted file mode 100644 index 237e1ff46..000000000 --- a/x/did/types/txns/MsgGovDeposit.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgGovSubmitProposal.pkl.go b/x/did/types/txns/MsgGovSubmitProposal.pkl.go deleted file mode 100644 index 8c7f744fb..000000000 --- a/x/did/types/txns/MsgGovSubmitProposal.pkl.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgGovVote.pkl.go b/x/did/types/txns/MsgGovVote.pkl.go deleted file mode 100644 index 73ff547b2..000000000 --- a/x/did/types/txns/MsgGovVote.pkl.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgGroupCreateGroup.pkl.go b/x/did/types/txns/MsgGroupCreateGroup.pkl.go deleted file mode 100644 index 19fd7173e..000000000 --- a/x/did/types/txns/MsgGroupCreateGroup.pkl.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgGroupSubmitProposal.pkl.go b/x/did/types/txns/MsgGroupSubmitProposal.pkl.go deleted file mode 100644 index 2cb9f0729..000000000 --- a/x/did/types/txns/MsgGroupSubmitProposal.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgGroupVote.pkl.go b/x/did/types/txns/MsgGroupVote.pkl.go deleted file mode 100644 index 79ae04244..000000000 --- a/x/did/types/txns/MsgGroupVote.pkl.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgStakingBeginRedelegate.pkl.go b/x/did/types/txns/MsgStakingBeginRedelegate.pkl.go deleted file mode 100644 index fe803db38..000000000 --- a/x/did/types/txns/MsgStakingBeginRedelegate.pkl.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgStakingCreateValidator.pkl.go b/x/did/types/txns/MsgStakingCreateValidator.pkl.go deleted file mode 100644 index d3c11015c..000000000 --- a/x/did/types/txns/MsgStakingCreateValidator.pkl.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgStakingDelegate.pkl.go b/x/did/types/txns/MsgStakingDelegate.pkl.go deleted file mode 100644 index b6fb170ec..000000000 --- a/x/did/types/txns/MsgStakingDelegate.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/MsgStakingUndelegate.pkl.go b/x/did/types/txns/MsgStakingUndelegate.pkl.go deleted file mode 100644 index c1732c2c2..000000000 --- a/x/did/types/txns/MsgStakingUndelegate.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/Proposal.pkl.go b/x/did/types/txns/Proposal.pkl.go deleted file mode 100644 index 70463d42f..000000000 --- a/x/did/types/txns/Proposal.pkl.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -// 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/x/did/types/txns/TxBody.pkl.go b/x/did/types/txns/TxBody.pkl.go deleted file mode 100644 index 407ba4179..000000000 --- a/x/did/types/txns/TxBody.pkl.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -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/x/did/types/txns/Txns.pkl.go b/x/did/types/txns/Txns.pkl.go deleted file mode 100644 index 288c5c5bc..000000000 --- a/x/did/types/txns/Txns.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Txns struct { -} - -// LoadFromPath loads the pkl module at the given path and evaluates it into a Txns -func LoadFromPath(ctx context.Context, path string) (ret *Txns, 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 Txns -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Txns, error) { - var ret Txns - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/x/did/types/txns/init.pkl.go b/x/did/types/txns/init.pkl.go deleted file mode 100644 index d92d7649e..000000000 --- a/x/did/types/txns/init.pkl.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("txns", Txns{}) - pkl.RegisterMapping("txns#Proposal", Proposal{}) - pkl.RegisterMapping("txns#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{}) - pkl.RegisterMapping("txns#MsgGovVote", MsgGovVoteImpl{}) - pkl.RegisterMapping("txns#MsgGovDeposit", MsgGovDepositImpl{}) - pkl.RegisterMapping("txns#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{}) - pkl.RegisterMapping("txns#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{}) - pkl.RegisterMapping("txns#MsgGroupVote", MsgGroupVoteImpl{}) - pkl.RegisterMapping("txns#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{}) - pkl.RegisterMapping("txns#MsgStakingDelegate", MsgStakingDelegateImpl{}) - pkl.RegisterMapping("txns#MsgStakingUndelegate", MsgStakingUndelegateImpl{}) - pkl.RegisterMapping("txns#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{}) - pkl.RegisterMapping("txns#MsgDidUpdateParams", MsgDidUpdateParamsImpl{}) - pkl.RegisterMapping("txns#MsgDidAllocateVault", MsgDidAllocateVaultImpl{}) - pkl.RegisterMapping("txns#MsgDidProveWitness", MsgDidProveWitnessImpl{}) - pkl.RegisterMapping("txns#MsgDidSyncVault", MsgDidSyncVaultImpl{}) - pkl.RegisterMapping("txns#MsgDidRegisterController", MsgDidRegisterControllerImpl{}) - pkl.RegisterMapping("txns#MsgDidAuthorize", MsgDidAuthorizeImpl{}) - pkl.RegisterMapping("txns#MsgDidRegisterService", MsgDidRegisterServiceImpl{}) - pkl.RegisterMapping("txns#TxBody", TxBody{}) -} diff --git a/x/did/types/zkprop.go b/x/did/types/zkprop.go deleted file mode 100644 index 2674cd60b..000000000 --- a/x/did/types/zkprop.go +++ /dev/null @@ -1,155 +0,0 @@ -package types - -import ( - "fmt" - - "github.com/onsonr/crypto/accumulator" - "github.com/onsonr/crypto/core/curves" -) - -// Accumulator is the accumulator for the ZKP -type Accumulator []byte - -// Element is the element for the BLS scheme -type Element = accumulator.Element - -// Witness is the witness for the ZKP -type Witness []byte - -// NewProof creates a new Proof which is used for ZKP -func NewProof(issuer, property string, pubKey []byte) (*Proof, error) { - input := append(pubKey, []byte(property)...) - hash := []byte(input) - - curve := curves.BLS12381(&curves.PointBls12381G1{}) - key, err := new(accumulator.SecretKey).New(curve, hash[:]) - if err != nil { - return nil, fmt.Errorf("failed to create secret key: %w", err) - } - - keyBytes, err := key.MarshalBinary() - if err != nil { - return nil, fmt.Errorf("failed to marshal secret key: %w", err) - } - - return &Proof{ - Issuer: issuer, - Property: property, - Accumulator: keyBytes, - }, nil -} - -// CreateAccumulator creates a new accumulator for a Proof -func CreateAccumulator(proof *Proof, values ...string) error { - curve := curves.BLS12381(&curves.PointBls12381G1{}) - acc, err := new(accumulator.Accumulator).New(curve) - if err != nil { - return err - } - - secretKey := new(accumulator.SecretKey) - if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { - return err - } - - fin, _, err := acc.Update(secretKey, ConvertValuesToZeroKnowledgeElements(values), nil) - if err != nil { - return err - } - - accBytes, err := fin.MarshalBinary() - if err != nil { - return fmt.Errorf("failed to marshal accumulator: %w", err) - } - - proof.Accumulator = accBytes - return nil -} - -// CreateWitness creates a witness for the accumulator in a Proof for a given value -func CreateWitness(proof *Proof, value string) ([]byte, error) { - curve := curves.BLS12381(&curves.PointBls12381G1{}) - element := curve.Scalar.Hash([]byte(value)) - - secretKey := new(accumulator.SecretKey) - if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { - return nil, err - } - - accObj := new(accumulator.Accumulator) - if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { - return nil, fmt.Errorf("failed to unmarshal accumulator: %w", err) - } - - mw, err := new(accumulator.MembershipWitness).New(element, accObj, secretKey) - if err != nil { - return nil, err - } - - witnessBytes, err := mw.MarshalBinary() - if err != nil { - return nil, fmt.Errorf("failed to marshal witness: %w", err) - } - return witnessBytes, nil -} - -// VerifyWitness proves that a value is a member of the accumulator -func VerifyWitness(proof *Proof, acc Accumulator, witness Witness) error { - secretKey := new(accumulator.SecretKey) - if err := secretKey.UnmarshalBinary([]byte(proof.Id)); err != nil { - return err - } - - curve := curves.BLS12381(&curves.PointBls12381G1{}) - publicKey, err := secretKey.GetPublicKey(curve) - if err != nil { - return err - } - - accObj := new(accumulator.Accumulator) - if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { - return fmt.Errorf("failed to unmarshal accumulator: %w", err) - } - - witnessObj := new(accumulator.MembershipWitness) - if err := witnessObj.UnmarshalBinary(witness); err != nil { - return fmt.Errorf("failed to unmarshal witness: %w", err) - } - return witnessObj.Verify(publicKey, accObj) -} - -// UpdateAccumulator updates the accumulator in a Proof with new values -func UpdateAccumulator(proof *Proof, addValues []string, removeValues []string) error { - secretKey := new(accumulator.SecretKey) - if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { - return err - } - - accObj := new(accumulator.Accumulator) - if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { - return fmt.Errorf("failed to unmarshal accumulator: %w", err) - } - - updatedAcc, _, err := accObj.Update(secretKey, ConvertValuesToZeroKnowledgeElements(addValues), ConvertValuesToZeroKnowledgeElements(removeValues)) - if err != nil { - return err - } - - updatedAccBytes, err := updatedAcc.MarshalBinary() - if err != nil { - return fmt.Errorf("failed to marshal updated accumulator: %w", err) - } - - proof.Accumulator = updatedAccBytes - return nil -} - -// ConvertValuesToZeroKnowledgeElements converts a slice of strings to a slice of accumulator elements -func ConvertValuesToZeroKnowledgeElements(values []string) []Element { - curve := curves.BLS12381(&curves.PointBls12381G1{}) - elements := make([]accumulator.Element, len(values)) - for i, value := range values { - elements[i] = curve.Scalar.Hash([]byte(value)) - } - return elements -} 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 89% rename from internal/dwn/main.go rename to x/vault/client/dwn/main.go index 6aad26089..d44b2ed7f 100644 --- a/internal/dwn/main.go +++ b/x/vault/client/dwn/main.go @@ -14,16 +14,20 @@ import ( "github.com/labstack/echo/v4" promise "github.com/nlepage/go-js-promise" - "github.com/onsonr/sonr/internal/dwn/handlers" - "github.com/onsonr/sonr/internal/dwn/middleware" - "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.RouteViews(e) - handlers.RegisterState(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/handlers/auth.go b/x/vault/client/dwn/state/auth.go similarity index 98% rename from internal/dwn/handlers/auth.go rename to x/vault/client/dwn/state/auth.go index d725449a3..6aa053b12 100644 --- a/internal/dwn/handlers/auth.go +++ b/x/vault/client/dwn/state/auth.go @@ -1,4 +1,4 @@ -package handlers +package state import ( "encoding/json" diff --git a/x/vault/client/dwn/state/manifest.go b/x/vault/client/dwn/state/manifest.go new file mode 100644 index 000000000..7bf2df5b4 --- /dev/null +++ b/x/vault/client/dwn/state/manifest.go @@ -0,0 +1 @@ +package state diff --git a/internal/dwn/handlers/openid.go b/x/vault/client/dwn/state/openid.go similarity index 96% rename from internal/dwn/handlers/openid.go rename to x/vault/client/dwn/state/openid.go index 0d981247f..941c3d1a3 100644 --- a/internal/dwn/handlers/openid.go +++ b/x/vault/client/dwn/state/openid.go @@ -1,4 +1,4 @@ -package handlers +package state import ( "github.com/labstack/echo/v4" diff --git a/internal/dwn/handlers/routes.go b/x/vault/client/dwn/state/routes.go similarity index 80% rename from internal/dwn/handlers/routes.go rename to x/vault/client/dwn/state/routes.go index 0b8af5917..3e0589f35 100644 --- a/internal/dwn/handlers/routes.go +++ b/x/vault/client/dwn/state/routes.go @@ -1,11 +1,11 @@ -package handlers +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 RegisterState(e *echo.Echo) { +func RegisterHandlers(e *echo.Echo) { g := e.Group("state") g.POST("/login/:identifier", handleCredentialAssertion) // g.GET("/discovery", state.GetDiscovery) diff --git a/x/vault/client/dwn/state/views.go b/x/vault/client/dwn/state/views.go new file mode 100644 index 000000000..7bf2df5b4 --- /dev/null +++ b/x/vault/client/dwn/state/views.go @@ -0,0 +1 @@ +package state diff --git a/x/vault/client/dwn/state/wellknown.go b/x/vault/client/dwn/state/wellknown.go new file mode 100644 index 000000000..7bf2df5b4 --- /dev/null +++ b/x/vault/client/dwn/state/wellknown.go @@ -0,0 +1 @@ +package state 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 +}