diff --git a/.github/linters/.golangci.yaml b/.github/linters/.golangci.yaml index 08695c2c1..7c95f5769 100644 --- a/.github/linters/.golangci.yaml +++ b/.github/linters/.golangci.yaml @@ -1,25 +1,45 @@ run: - timeout: 5m + timeout: 10m linters: enable: - - deadcode + - bodyclose + - depguard + - dogsled - errcheck - - gosimple + - exportloopref + - goconst + - gocritic - gofumpt + - goimports + - gosimple - govet - ineffassign - misspell + - nakedret - nestif + - nolintlint - staticcheck - - structcheck + - stylecheck - typecheck + - unconvert - unused - - varcheck linters-settings: + dogsled: + # Checks assignments with too many blank identifiers. + # Default: 2 + max-blank-identifiers: 3 + + gocritic: + # Which checks should be disabled; can't be combined with 'enabled-checks'. + # See https://go-critic.github.io/overview#checks-overview. + # Default: [] + disabled-checks: + - regexpMust + - badCall # Remove this after CI workflow PR gofumpt: lang-version: "1.18" @@ -27,3 +47,18 @@ linters-settings: misspell: ignore-words: - cheqd + - cheq + - ncheq + + stylecheck: + # Select the Go version to target. + go: "1.18" + # STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks + # Default: ["*"] + checks: ["all"] + # https://staticcheck.io/docs/configuration/options/#dot_import_whitelist + dot-import-whitelist: + - "github.com/cheqd/cheqd-node/x/did/utils" + - "github.com/onsi/gomega" + # https://staticcheck.io/docs/configuration/options/#initialisms + initialisms: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"] diff --git a/.github/linters/.openapirc.yml b/.github/linters/.openapirc.yml new file mode 100644 index 000000000..7cf6bacbf --- /dev/null +++ b/.github/linters/.openapirc.yml @@ -0,0 +1,11 @@ +--- + +########################## +########################## +## OpenAPI Linter rules ## +########################## +########################## + +extends: spectral:oas +rules: + oas2-schema: warn \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 67fa424df..8a915e2f1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -48,7 +48,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.47 + version: v1.49.0 args: --config .github/linters/.golangci.yaml proto-lint: @@ -64,12 +64,14 @@ jobs: # Lint - uses: bufbuild/buf-lint-action@v1 + with: + input: proto # Breaking change detection - uses: bufbuild/buf-breaking-action@v1 continue-on-error: true with: - input: 'proto' + input: proto against: 'https://github.com/cheqd/cheqd-node.git#branch=main,ref=HEAD~1,subdir=proto' super-lint: @@ -88,7 +90,7 @@ jobs: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LOG_LEVEL: WARN - VALIDATE_ALL_CODEBASE: true + VALIDATE_ALL_CODEBASE: false MULTI_STATUS: true VALIDATE_BASH: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da695c934..4cc8349e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,41 @@ permissions: jobs: + # Super Linter only runs on diffs in PRs + # For release, we run it on VALIDATE_ALL_CODEBASE=true + # List of languages enabled is smaller than in lint workflow + super-lint: + name: "Super Linter" + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Required to fetch version + + - name: Run Super Linter + uses: github/super-linter/slim@v4 + env: + IGNORE_GITIGNORED_FILES: true + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LOG_LEVEL: WARN + VALIDATE_ALL_CODEBASE: true + MULTI_STATUS: true + + VALIDATE_BASH: true + VALIDATE_DOCKERFILE_HADOLINT: true + VALIDATE_JSON: true + VALIDATE_OPENAPI: true + VALIDATE_PYTHON_PYLINT: true + VALIDATE_XML: true + VALIDATE_YAML: true + release-binary: name: "Node binary" runs-on: ubuntu-20.04 + needs: super-lint outputs: RELEASE_VERSION: ${{ steps.set-version.outputs.RELEASE_VERSION }} @@ -36,7 +67,7 @@ jobs: cache-dependency-path: '**/package-lock.json' # Setup for pushing to Buf.build later - - uses: bufbuild/buf-setup-action@v1.11.0 + - uses: bufbuild/buf-setup-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -68,18 +99,19 @@ jobs: - name: Set release version number id: set-version run: | - RELEASE_VERSION=$( git describe --tags ${{ github.sha }}) - echo ::set-output name=RELEASE_VERSION::"$RELEASE_VERSION" + RELEASE_VERSION=$( git describe --tags "${{ github.sha }}") + echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_OUTPUT" # Push Protobufs to Buf.build registry - uses: bufbuild/buf-push-action@v1 with: input: proto buf_token: ${{ secrets.BUF_TOKEN }} + draft: ${{ github.ref_name != 'main'}} release-docker: name: "Docker image" - needs: release-binary + needs: [ super-lint, release-binary ] runs-on: ubuntu-20.04 env: IMAGE_NAME: ${{ github.repository }} diff --git a/.gitignore b/.gitignore index 614ac98bd..8027ac56b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,17 @@ ### APP-SPECIFIC EXCLUSIONS ### + +# Ignored directories +api/docs/cheqd/** +api/docs/swagger-ui/** build/ dist/ - -# Tests **/network-config -**/node_configs -# Python -.pytest_cache -**/__pycache__ +# Ignored files +api/docs/config.yaml + +# Allowed files +!api/docs/swagger-ui/**/swagger-initializer.js ### GENERAL EXCLUSIONS ### @@ -93,10 +96,6 @@ Temporary Items # Dependency directories (remove the comment below to include it) # vendor/ -# Go workspace file -go.work - - ### Node/JavaScript ### # Logs logs diff --git a/.goreleaser.yml b/.goreleaser.yml index 9d427a359..d698093a1 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,9 +8,10 @@ env: before: hooks: - make clean - - go mod tidy - - go mod download + - make tidy + - make install - make proto-gen + - make swagger builds: - id: ubuntu-latest-amd64 @@ -22,7 +23,7 @@ builds: - CGO_ENABLED=1 flags: - -mod=readonly - - -tags="netgo ledger" + - -tags="netgo ledger goleveldb" - -trimpath ldflags: - -s -w @@ -42,7 +43,7 @@ builds: - sudo apt update && sudo apt install clang gcc-multilib g++-multilib -y flags: - -mod=readonly - - -tags="netgo ledger" + - -tags="netgo ledger goleveldb" - -trimpath ldflags: - -s -w diff --git a/Makefile b/Makefile index eadfcfea7..afe96aae5 100644 --- a/Makefile +++ b/Makefile @@ -150,7 +150,7 @@ clean: GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1) GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) MIN_GO_MAJOR_VERSION = 1 -MIN_GO_MINOR_VERSION = 17 +MIN_GO_MINOR_VERSION = 18 GO_VERSION_ERROR = Golang version $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION) is not supported, \ please update to at least $(MIN_GO_MAJOR_VERSION).$(MIN_GO_MINOR_VERSION) @@ -245,6 +245,5 @@ include make/proto.mk ############################################################################### swagger: proto-swagger-gen - @./scripts/generate_swagger_docs.sh .PHONY: swagger diff --git a/ante/fee.go b/ante/fee.go index 0a0d200de..9f2803246 100644 --- a/ante/fee.go +++ b/ante/fee.go @@ -161,7 +161,7 @@ func IsSufficientFee(ctx sdk.Context, tax, reward, burn, feeProvided sdk.Coins, // Determine the required fees by multiplying each required minimum gas // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). - glDec := sdk.NewDec(int64(gasRequested)) + glDec := sdk.NewDec(gasRequested) for i, gp := range minGasPrices { fee := gp.Amount.Mul(glDec) requiredFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) diff --git a/ante/testdata_test.go b/ante/testdata_test.go index 7e965cccd..7b8d6b5bb 100644 --- a/ante/testdata_test.go +++ b/ante/testdata_test.go @@ -22,7 +22,7 @@ func SandboxDidDoc() *didtypes.MsgCreateDidDoc { var signatures []*didtypes.SignInfo signatures = append(signatures, &didtypes.SignInfo{ - VerificationMethodId: didDocInfo.SignInput.VerificationMethodId, + VerificationMethodId: didDocInfo.SignInput.VerificationMethodID, Signature: ed25519.Sign(didDocInfo.SignInput.Key, signBytes), }) @@ -41,7 +41,7 @@ func SandboxResource() *resourcetypes.MsgCreateResource { var signatures []*didtypes.SignInfo signatures = append(signatures, &didtypes.SignInfo{ - VerificationMethodId: didDocInfo.SignInput.VerificationMethodId, + VerificationMethodId: didDocInfo.SignInput.VerificationMethodID, Signature: ed25519.Sign(didDocInfo.SignInput.Key, signBytes), }) diff --git a/ante/testutil_test.go b/ante/testutil_test.go index 30235f3c0..e9c46df7e 100644 --- a/ante/testutil_test.go +++ b/ante/testutil_test.go @@ -130,7 +130,7 @@ func (s *AnteTestSuite) CreateTestAccounts(numAccs int) ([]TestAccount, error) { func (s *AnteTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) { // First round: we gather all the signer infos. We use the "set empty // signature" hack to do that. - var sigsV2 []signing.SignatureV2 + sigsV2 := make([]signing.SignatureV2, 0, len(privs)) for i, priv := range privs { sigV2 := signing.SignatureV2{ PubKey: priv.PubKey(), diff --git a/ante/tx_msg_filters.go b/ante/tx_msg_filters.go index e939298c0..bd9359bd5 100644 --- a/ante/tx_msg_filters.go +++ b/ante/tx_msg_filters.go @@ -15,7 +15,7 @@ const ( MsgDeactivateDidDoc MsgCreateResourceDefault MsgCreateResourceImage - MsgCreateResourceJson + MsgCreateResourceJSON TaxableMsgFeeCount ) @@ -37,7 +37,7 @@ var TaxableMsgFees = TaxableMsgFee{ MsgDeactivateDidDoc: (sdk.Coins)(nil), MsgCreateResourceDefault: (sdk.Coins)(nil), MsgCreateResourceImage: (sdk.Coins)(nil), - MsgCreateResourceJson: (sdk.Coins)(nil), + MsgCreateResourceJSON: (sdk.Coins)(nil), } var BurnFactors = BurnFactor{ @@ -97,8 +97,8 @@ func GetResourceTaxableMsgFee(ctx sdk.Context, msg *resourcetypes.MsgCreateResou // Mime type json if strings.HasPrefix(mediaType, "application/json") { - burnPortion := GetBurnFeePortion(BurnFactors[BurnFactorResource], TaxableMsgFees[MsgCreateResourceJson]) - return GetRewardPortion(TaxableMsgFees[MsgCreateResourceJson], burnPortion), burnPortion, true + burnPortion := GetBurnFeePortion(BurnFactors[BurnFactorResource], TaxableMsgFees[MsgCreateResourceJSON]) + return GetRewardPortion(TaxableMsgFees[MsgCreateResourceJSON], burnPortion), burnPortion, true } // Default mime type @@ -114,7 +114,7 @@ func checkFeeParamsFromSubspace(ctx sdk.Context, didKeeper DidKeeper, resourceKe resourceParams := resourceKeeper.GetParams(ctx) TaxableMsgFees[MsgCreateResourceImage] = sdk.NewCoins(resourceParams.Image) - TaxableMsgFees[MsgCreateResourceJson] = sdk.NewCoins(resourceParams.Json) + TaxableMsgFees[MsgCreateResourceJSON] = sdk.NewCoins(resourceParams.Json) TaxableMsgFees[MsgCreateResourceDefault] = sdk.NewCoins(resourceParams.Default) BurnFactors[BurnFactorDid] = didParams.BurnFactor diff --git a/api/cheqd/did/v2/diddoc.pulsar.go b/api/cheqd/did/v2/diddoc.pulsar.go new file mode 100644 index 000000000..d130062ee --- /dev/null +++ b/api/cheqd/did/v2/diddoc.pulsar.go @@ -0,0 +1,4837 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package didv2 + +import ( + 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" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_DidDoc_1_list)(nil) + +type _DidDoc_1_list struct { + list *[]string +} + +func (x *_DidDoc_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DidDoc_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DidDoc at list field Context as it is not of Message kind")) +} + +func (x *_DidDoc_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DidDoc_1_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_3_list)(nil) + +type _DidDoc_3_list struct { + list *[]string +} + +func (x *_DidDoc_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DidDoc_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DidDoc at list field Controller as it is not of Message kind")) +} + +func (x *_DidDoc_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DidDoc_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_4_list)(nil) + +type _DidDoc_4_list struct { + list *[]*VerificationMethod +} + +func (x *_DidDoc_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DidDoc_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_4_list) AppendMutable() protoreflect.Value { + v := new(VerificationMethod) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DidDoc_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_4_list) NewElement() protoreflect.Value { + v := new(VerificationMethod) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DidDoc_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_5_list)(nil) + +type _DidDoc_5_list struct { + list *[]string +} + +func (x *_DidDoc_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DidDoc_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DidDoc at list field Authentication as it is not of Message kind")) +} + +func (x *_DidDoc_5_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DidDoc_5_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_6_list)(nil) + +type _DidDoc_6_list struct { + list *[]string +} + +func (x *_DidDoc_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DidDoc_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DidDoc at list field AssertionMethod as it is not of Message kind")) +} + +func (x *_DidDoc_6_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_6_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DidDoc_6_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_7_list)(nil) + +type _DidDoc_7_list struct { + list *[]string +} + +func (x *_DidDoc_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DidDoc_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_7_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DidDoc at list field CapabilityInvocation as it is not of Message kind")) +} + +func (x *_DidDoc_7_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_7_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DidDoc_7_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_8_list)(nil) + +type _DidDoc_8_list struct { + list *[]string +} + +func (x *_DidDoc_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DidDoc_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DidDoc at list field CapabilityDelegation as it is not of Message kind")) +} + +func (x *_DidDoc_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DidDoc_8_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_9_list)(nil) + +type _DidDoc_9_list struct { + list *[]string +} + +func (x *_DidDoc_9_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_9_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DidDoc_9_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_9_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_9_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DidDoc at list field KeyAgreement as it is not of Message kind")) +} + +func (x *_DidDoc_9_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_9_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DidDoc_9_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_10_list)(nil) + +type _DidDoc_10_list struct { + list *[]*Service +} + +func (x *_DidDoc_10_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_10_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DidDoc_10_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Service) + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_10_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Service) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_10_list) AppendMutable() protoreflect.Value { + v := new(Service) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DidDoc_10_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_10_list) NewElement() protoreflect.Value { + v := new(Service) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DidDoc_10_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_DidDoc_11_list)(nil) + +type _DidDoc_11_list struct { + list *[]string +} + +func (x *_DidDoc_11_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDoc_11_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DidDoc_11_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DidDoc_11_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDoc_11_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DidDoc at list field AlsoKnownAs as it is not of Message kind")) +} + +func (x *_DidDoc_11_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DidDoc_11_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DidDoc_11_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DidDoc protoreflect.MessageDescriptor + fd_DidDoc_context protoreflect.FieldDescriptor + fd_DidDoc_id protoreflect.FieldDescriptor + fd_DidDoc_controller protoreflect.FieldDescriptor + fd_DidDoc_verification_method protoreflect.FieldDescriptor + fd_DidDoc_authentication protoreflect.FieldDescriptor + fd_DidDoc_assertion_method protoreflect.FieldDescriptor + fd_DidDoc_capability_invocation protoreflect.FieldDescriptor + fd_DidDoc_capability_delegation protoreflect.FieldDescriptor + fd_DidDoc_key_agreement protoreflect.FieldDescriptor + fd_DidDoc_service protoreflect.FieldDescriptor + fd_DidDoc_also_known_as protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_diddoc_proto_init() + md_DidDoc = File_cheqd_did_v2_diddoc_proto.Messages().ByName("DidDoc") + fd_DidDoc_context = md_DidDoc.Fields().ByName("context") + fd_DidDoc_id = md_DidDoc.Fields().ByName("id") + fd_DidDoc_controller = md_DidDoc.Fields().ByName("controller") + fd_DidDoc_verification_method = md_DidDoc.Fields().ByName("verification_method") + fd_DidDoc_authentication = md_DidDoc.Fields().ByName("authentication") + fd_DidDoc_assertion_method = md_DidDoc.Fields().ByName("assertion_method") + fd_DidDoc_capability_invocation = md_DidDoc.Fields().ByName("capability_invocation") + fd_DidDoc_capability_delegation = md_DidDoc.Fields().ByName("capability_delegation") + fd_DidDoc_key_agreement = md_DidDoc.Fields().ByName("key_agreement") + fd_DidDoc_service = md_DidDoc.Fields().ByName("service") + fd_DidDoc_also_known_as = md_DidDoc.Fields().ByName("also_known_as") +} + +var _ protoreflect.Message = (*fastReflection_DidDoc)(nil) + +type fastReflection_DidDoc DidDoc + +func (x *DidDoc) ProtoReflect() protoreflect.Message { + return (*fastReflection_DidDoc)(x) +} + +func (x *DidDoc) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_diddoc_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_DidDoc_messageType fastReflection_DidDoc_messageType +var _ protoreflect.MessageType = fastReflection_DidDoc_messageType{} + +type fastReflection_DidDoc_messageType struct{} + +func (x fastReflection_DidDoc_messageType) Zero() protoreflect.Message { + return (*fastReflection_DidDoc)(nil) +} +func (x fastReflection_DidDoc_messageType) New() protoreflect.Message { + return new(fastReflection_DidDoc) +} +func (x fastReflection_DidDoc_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DidDoc +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DidDoc) Descriptor() protoreflect.MessageDescriptor { + return md_DidDoc +} + +// 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_DidDoc) Type() protoreflect.MessageType { + return _fastReflection_DidDoc_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DidDoc) New() protoreflect.Message { + return new(fastReflection_DidDoc) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DidDoc) Interface() protoreflect.ProtoMessage { + return (*DidDoc)(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_DidDoc) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Context) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_1_list{list: &x.Context}) + if !f(fd_DidDoc_context, value) { + return + } + } + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_DidDoc_id, value) { + return + } + } + if len(x.Controller) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_3_list{list: &x.Controller}) + if !f(fd_DidDoc_controller, value) { + return + } + } + if len(x.VerificationMethod) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_4_list{list: &x.VerificationMethod}) + if !f(fd_DidDoc_verification_method, value) { + return + } + } + if len(x.Authentication) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_5_list{list: &x.Authentication}) + if !f(fd_DidDoc_authentication, value) { + return + } + } + if len(x.AssertionMethod) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_6_list{list: &x.AssertionMethod}) + if !f(fd_DidDoc_assertion_method, value) { + return + } + } + if len(x.CapabilityInvocation) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_7_list{list: &x.CapabilityInvocation}) + if !f(fd_DidDoc_capability_invocation, value) { + return + } + } + if len(x.CapabilityDelegation) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_8_list{list: &x.CapabilityDelegation}) + if !f(fd_DidDoc_capability_delegation, value) { + return + } + } + if len(x.KeyAgreement) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_9_list{list: &x.KeyAgreement}) + if !f(fd_DidDoc_key_agreement, value) { + return + } + } + if len(x.Service) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_10_list{list: &x.Service}) + if !f(fd_DidDoc_service, value) { + return + } + } + if len(x.AlsoKnownAs) != 0 { + value := protoreflect.ValueOfList(&_DidDoc_11_list{list: &x.AlsoKnownAs}) + if !f(fd_DidDoc_also_known_as, 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_DidDoc) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.DidDoc.context": + return len(x.Context) != 0 + case "cheqd.did.v2.DidDoc.id": + return x.Id != "" + case "cheqd.did.v2.DidDoc.controller": + return len(x.Controller) != 0 + case "cheqd.did.v2.DidDoc.verification_method": + return len(x.VerificationMethod) != 0 + case "cheqd.did.v2.DidDoc.authentication": + return len(x.Authentication) != 0 + case "cheqd.did.v2.DidDoc.assertion_method": + return len(x.AssertionMethod) != 0 + case "cheqd.did.v2.DidDoc.capability_invocation": + return len(x.CapabilityInvocation) != 0 + case "cheqd.did.v2.DidDoc.capability_delegation": + return len(x.CapabilityDelegation) != 0 + case "cheqd.did.v2.DidDoc.key_agreement": + return len(x.KeyAgreement) != 0 + case "cheqd.did.v2.DidDoc.service": + return len(x.Service) != 0 + case "cheqd.did.v2.DidDoc.also_known_as": + return len(x.AlsoKnownAs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDoc 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_DidDoc) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.DidDoc.context": + x.Context = nil + case "cheqd.did.v2.DidDoc.id": + x.Id = "" + case "cheqd.did.v2.DidDoc.controller": + x.Controller = nil + case "cheqd.did.v2.DidDoc.verification_method": + x.VerificationMethod = nil + case "cheqd.did.v2.DidDoc.authentication": + x.Authentication = nil + case "cheqd.did.v2.DidDoc.assertion_method": + x.AssertionMethod = nil + case "cheqd.did.v2.DidDoc.capability_invocation": + x.CapabilityInvocation = nil + case "cheqd.did.v2.DidDoc.capability_delegation": + x.CapabilityDelegation = nil + case "cheqd.did.v2.DidDoc.key_agreement": + x.KeyAgreement = nil + case "cheqd.did.v2.DidDoc.service": + x.Service = nil + case "cheqd.did.v2.DidDoc.also_known_as": + x.AlsoKnownAs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDoc 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_DidDoc) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.DidDoc.context": + if len(x.Context) == 0 { + return protoreflect.ValueOfList(&_DidDoc_1_list{}) + } + listValue := &_DidDoc_1_list{list: &x.Context} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.DidDoc.controller": + if len(x.Controller) == 0 { + return protoreflect.ValueOfList(&_DidDoc_3_list{}) + } + listValue := &_DidDoc_3_list{list: &x.Controller} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.verification_method": + if len(x.VerificationMethod) == 0 { + return protoreflect.ValueOfList(&_DidDoc_4_list{}) + } + listValue := &_DidDoc_4_list{list: &x.VerificationMethod} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.authentication": + if len(x.Authentication) == 0 { + return protoreflect.ValueOfList(&_DidDoc_5_list{}) + } + listValue := &_DidDoc_5_list{list: &x.Authentication} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.assertion_method": + if len(x.AssertionMethod) == 0 { + return protoreflect.ValueOfList(&_DidDoc_6_list{}) + } + listValue := &_DidDoc_6_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.capability_invocation": + if len(x.CapabilityInvocation) == 0 { + return protoreflect.ValueOfList(&_DidDoc_7_list{}) + } + listValue := &_DidDoc_7_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.capability_delegation": + if len(x.CapabilityDelegation) == 0 { + return protoreflect.ValueOfList(&_DidDoc_8_list{}) + } + listValue := &_DidDoc_8_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.key_agreement": + if len(x.KeyAgreement) == 0 { + return protoreflect.ValueOfList(&_DidDoc_9_list{}) + } + listValue := &_DidDoc_9_list{list: &x.KeyAgreement} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.service": + if len(x.Service) == 0 { + return protoreflect.ValueOfList(&_DidDoc_10_list{}) + } + listValue := &_DidDoc_10_list{list: &x.Service} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.DidDoc.also_known_as": + if len(x.AlsoKnownAs) == 0 { + return protoreflect.ValueOfList(&_DidDoc_11_list{}) + } + listValue := &_DidDoc_11_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDoc 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_DidDoc) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.DidDoc.context": + lv := value.List() + clv := lv.(*_DidDoc_1_list) + x.Context = *clv.list + case "cheqd.did.v2.DidDoc.id": + x.Id = value.Interface().(string) + case "cheqd.did.v2.DidDoc.controller": + lv := value.List() + clv := lv.(*_DidDoc_3_list) + x.Controller = *clv.list + case "cheqd.did.v2.DidDoc.verification_method": + lv := value.List() + clv := lv.(*_DidDoc_4_list) + x.VerificationMethod = *clv.list + case "cheqd.did.v2.DidDoc.authentication": + lv := value.List() + clv := lv.(*_DidDoc_5_list) + x.Authentication = *clv.list + case "cheqd.did.v2.DidDoc.assertion_method": + lv := value.List() + clv := lv.(*_DidDoc_6_list) + x.AssertionMethod = *clv.list + case "cheqd.did.v2.DidDoc.capability_invocation": + lv := value.List() + clv := lv.(*_DidDoc_7_list) + x.CapabilityInvocation = *clv.list + case "cheqd.did.v2.DidDoc.capability_delegation": + lv := value.List() + clv := lv.(*_DidDoc_8_list) + x.CapabilityDelegation = *clv.list + case "cheqd.did.v2.DidDoc.key_agreement": + lv := value.List() + clv := lv.(*_DidDoc_9_list) + x.KeyAgreement = *clv.list + case "cheqd.did.v2.DidDoc.service": + lv := value.List() + clv := lv.(*_DidDoc_10_list) + x.Service = *clv.list + case "cheqd.did.v2.DidDoc.also_known_as": + lv := value.List() + clv := lv.(*_DidDoc_11_list) + x.AlsoKnownAs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDoc 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_DidDoc) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.DidDoc.context": + if x.Context == nil { + x.Context = []string{} + } + value := &_DidDoc_1_list{list: &x.Context} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.controller": + if x.Controller == nil { + x.Controller = []string{} + } + value := &_DidDoc_3_list{list: &x.Controller} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.verification_method": + if x.VerificationMethod == nil { + x.VerificationMethod = []*VerificationMethod{} + } + value := &_DidDoc_4_list{list: &x.VerificationMethod} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.authentication": + if x.Authentication == nil { + x.Authentication = []string{} + } + value := &_DidDoc_5_list{list: &x.Authentication} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.assertion_method": + if x.AssertionMethod == nil { + x.AssertionMethod = []string{} + } + value := &_DidDoc_6_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.capability_invocation": + if x.CapabilityInvocation == nil { + x.CapabilityInvocation = []string{} + } + value := &_DidDoc_7_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.capability_delegation": + if x.CapabilityDelegation == nil { + x.CapabilityDelegation = []string{} + } + value := &_DidDoc_8_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.key_agreement": + if x.KeyAgreement == nil { + x.KeyAgreement = []string{} + } + value := &_DidDoc_9_list{list: &x.KeyAgreement} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.service": + if x.Service == nil { + x.Service = []*Service{} + } + value := &_DidDoc_10_list{list: &x.Service} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.also_known_as": + if x.AlsoKnownAs == nil { + x.AlsoKnownAs = []string{} + } + value := &_DidDoc_11_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDoc.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.DidDoc is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDoc 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_DidDoc) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.DidDoc.context": + list := []string{} + return protoreflect.ValueOfList(&_DidDoc_1_list{list: &list}) + case "cheqd.did.v2.DidDoc.id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.DidDoc.controller": + list := []string{} + return protoreflect.ValueOfList(&_DidDoc_3_list{list: &list}) + case "cheqd.did.v2.DidDoc.verification_method": + list := []*VerificationMethod{} + return protoreflect.ValueOfList(&_DidDoc_4_list{list: &list}) + case "cheqd.did.v2.DidDoc.authentication": + list := []string{} + return protoreflect.ValueOfList(&_DidDoc_5_list{list: &list}) + case "cheqd.did.v2.DidDoc.assertion_method": + list := []string{} + return protoreflect.ValueOfList(&_DidDoc_6_list{list: &list}) + case "cheqd.did.v2.DidDoc.capability_invocation": + list := []string{} + return protoreflect.ValueOfList(&_DidDoc_7_list{list: &list}) + case "cheqd.did.v2.DidDoc.capability_delegation": + list := []string{} + return protoreflect.ValueOfList(&_DidDoc_8_list{list: &list}) + case "cheqd.did.v2.DidDoc.key_agreement": + list := []string{} + return protoreflect.ValueOfList(&_DidDoc_9_list{list: &list}) + case "cheqd.did.v2.DidDoc.service": + list := []*Service{} + return protoreflect.ValueOfList(&_DidDoc_10_list{list: &list}) + case "cheqd.did.v2.DidDoc.also_known_as": + list := []string{} + return protoreflect.ValueOfList(&_DidDoc_11_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDoc 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_DidDoc) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.DidDoc", 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_DidDoc) 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_DidDoc) 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_DidDoc) 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_DidDoc) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DidDoc) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Context) > 0 { + for _, s := range x.Context { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Controller) > 0 { + for _, s := range x.Controller { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.VerificationMethod) > 0 { + for _, e := range x.VerificationMethod { + l = options.Size(e) + 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)) + } + } + if len(x.AssertionMethod) > 0 { + for _, s := range x.AssertionMethod { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityInvocation) > 0 { + for _, s := range x.CapabilityInvocation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityDelegation) > 0 { + for _, s := range x.CapabilityDelegation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.KeyAgreement) > 0 { + for _, s := range x.KeyAgreement { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Service) > 0 { + for _, e := range x.Service { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.AlsoKnownAs) > 0 { + for _, s := range x.AlsoKnownAs { + l = len(s) + 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().(*DidDoc) + 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.AlsoKnownAs) > 0 { + for iNdEx := len(x.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AlsoKnownAs[iNdEx]) + copy(dAtA[i:], x.AlsoKnownAs[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AlsoKnownAs[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(x.Service) > 0 { + for iNdEx := len(x.Service) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Service[iNdEx]) + 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] = 0x52 + } + } + if len(x.KeyAgreement) > 0 { + for iNdEx := len(x.KeyAgreement) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.KeyAgreement[iNdEx]) + copy(dAtA[i:], x.KeyAgreement[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyAgreement[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(x.CapabilityDelegation) > 0 { + for iNdEx := len(x.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], x.CapabilityDelegation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityDelegation[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(x.CapabilityInvocation) > 0 { + for iNdEx := len(x.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], x.CapabilityInvocation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityInvocation[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(x.AssertionMethod) > 0 { + for iNdEx := len(x.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AssertionMethod[iNdEx]) + copy(dAtA[i:], x.AssertionMethod[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssertionMethod[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + 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] = 0x2a + } + } + if len(x.VerificationMethod) > 0 { + for iNdEx := len(x.VerificationMethod) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VerificationMethod[iNdEx]) + 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] = 0x22 + } + } + if len(x.Controller) > 0 { + for iNdEx := len(x.Controller) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Controller[iNdEx]) + copy(dAtA[i:], x.Controller[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0x12 + } + if len(x.Context) > 0 { + for iNdEx := len(x.Context) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Context[iNdEx]) + copy(dAtA[i:], x.Context[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Context[iNdEx]))) + 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().(*DidDoc) + 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: DidDoc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DidDoc: 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 Context", 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.Context = append(x.Context, 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 Id", 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.Id = 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 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 = append(x.Controller, 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 VerificationMethod", 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 + } + x.VerificationMethod = append(x.VerificationMethod, &VerificationMethod{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VerificationMethod[len(x.VerificationMethod)-1]); 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 Authentication", 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.Authentication = append(x.Authentication, 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 AssertionMethod", 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.AssertionMethod = append(x.AssertionMethod, 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 CapabilityInvocation", 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.CapabilityInvocation = append(x.CapabilityInvocation, 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 CapabilityDelegation", 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.CapabilityDelegation = append(x.CapabilityDelegation, 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 KeyAgreement", 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.KeyAgreement = append(x.KeyAgreement, 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 Service", 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 + } + x.Service = append(x.Service, &Service{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service[len(x.Service)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AlsoKnownAs", 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.AlsoKnownAs = append(x.AlsoKnownAs, 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_VerificationMethod protoreflect.MessageDescriptor + fd_VerificationMethod_id protoreflect.FieldDescriptor + fd_VerificationMethod_verification_method_type protoreflect.FieldDescriptor + fd_VerificationMethod_controller protoreflect.FieldDescriptor + fd_VerificationMethod_verification_material protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_diddoc_proto_init() + md_VerificationMethod = File_cheqd_did_v2_diddoc_proto.Messages().ByName("VerificationMethod") + fd_VerificationMethod_id = md_VerificationMethod.Fields().ByName("id") + fd_VerificationMethod_verification_method_type = md_VerificationMethod.Fields().ByName("verification_method_type") + fd_VerificationMethod_controller = md_VerificationMethod.Fields().ByName("controller") + fd_VerificationMethod_verification_material = md_VerificationMethod.Fields().ByName("verification_material") +} + +var _ protoreflect.Message = (*fastReflection_VerificationMethod)(nil) + +type fastReflection_VerificationMethod VerificationMethod + +func (x *VerificationMethod) ProtoReflect() protoreflect.Message { + return (*fastReflection_VerificationMethod)(x) +} + +func (x *VerificationMethod) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_diddoc_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_VerificationMethod_messageType fastReflection_VerificationMethod_messageType +var _ protoreflect.MessageType = fastReflection_VerificationMethod_messageType{} + +type fastReflection_VerificationMethod_messageType struct{} + +func (x fastReflection_VerificationMethod_messageType) Zero() protoreflect.Message { + return (*fastReflection_VerificationMethod)(nil) +} +func (x fastReflection_VerificationMethod_messageType) New() protoreflect.Message { + return new(fastReflection_VerificationMethod) +} +func (x fastReflection_VerificationMethod_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_VerificationMethod +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_VerificationMethod) Descriptor() protoreflect.MessageDescriptor { + return md_VerificationMethod +} + +// 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_VerificationMethod) Type() protoreflect.MessageType { + return _fastReflection_VerificationMethod_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_VerificationMethod) New() protoreflect.Message { + return new(fastReflection_VerificationMethod) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_VerificationMethod) Interface() protoreflect.ProtoMessage { + return (*VerificationMethod)(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_VerificationMethod) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_VerificationMethod_id, value) { + return + } + } + if x.VerificationMethodType != "" { + value := protoreflect.ValueOfString(x.VerificationMethodType) + if !f(fd_VerificationMethod_verification_method_type, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_VerificationMethod_controller, value) { + return + } + } + if x.VerificationMaterial != "" { + value := protoreflect.ValueOfString(x.VerificationMaterial) + if !f(fd_VerificationMethod_verification_material, 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_VerificationMethod) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.VerificationMethod.id": + return x.Id != "" + case "cheqd.did.v2.VerificationMethod.verification_method_type": + return x.VerificationMethodType != "" + case "cheqd.did.v2.VerificationMethod.controller": + return x.Controller != "" + case "cheqd.did.v2.VerificationMethod.verification_material": + return x.VerificationMaterial != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.VerificationMethod")) + } + panic(fmt.Errorf("message cheqd.did.v2.VerificationMethod 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_VerificationMethod) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.VerificationMethod.id": + x.Id = "" + case "cheqd.did.v2.VerificationMethod.verification_method_type": + x.VerificationMethodType = "" + case "cheqd.did.v2.VerificationMethod.controller": + x.Controller = "" + case "cheqd.did.v2.VerificationMethod.verification_material": + x.VerificationMaterial = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.VerificationMethod")) + } + panic(fmt.Errorf("message cheqd.did.v2.VerificationMethod 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_VerificationMethod) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.VerificationMethod.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.VerificationMethod.verification_method_type": + value := x.VerificationMethodType + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.VerificationMethod.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.VerificationMethod.verification_material": + value := x.VerificationMaterial + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.VerificationMethod")) + } + panic(fmt.Errorf("message cheqd.did.v2.VerificationMethod 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_VerificationMethod) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.VerificationMethod.id": + x.Id = value.Interface().(string) + case "cheqd.did.v2.VerificationMethod.verification_method_type": + x.VerificationMethodType = value.Interface().(string) + case "cheqd.did.v2.VerificationMethod.controller": + x.Controller = value.Interface().(string) + case "cheqd.did.v2.VerificationMethod.verification_material": + x.VerificationMaterial = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.VerificationMethod")) + } + panic(fmt.Errorf("message cheqd.did.v2.VerificationMethod 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_VerificationMethod) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.VerificationMethod.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.VerificationMethod is not mutable")) + case "cheqd.did.v2.VerificationMethod.verification_method_type": + panic(fmt.Errorf("field verification_method_type of message cheqd.did.v2.VerificationMethod is not mutable")) + case "cheqd.did.v2.VerificationMethod.controller": + panic(fmt.Errorf("field controller of message cheqd.did.v2.VerificationMethod is not mutable")) + case "cheqd.did.v2.VerificationMethod.verification_material": + panic(fmt.Errorf("field verification_material of message cheqd.did.v2.VerificationMethod is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.VerificationMethod")) + } + panic(fmt.Errorf("message cheqd.did.v2.VerificationMethod 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_VerificationMethod) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.VerificationMethod.id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.VerificationMethod.verification_method_type": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.VerificationMethod.controller": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.VerificationMethod.verification_material": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.VerificationMethod")) + } + panic(fmt.Errorf("message cheqd.did.v2.VerificationMethod 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_VerificationMethod) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.VerificationMethod", 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_VerificationMethod) 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_VerificationMethod) 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_VerificationMethod) 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_VerificationMethod) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*VerificationMethod) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.VerificationMethodType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.VerificationMaterial) + 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().(*VerificationMethod) + 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.VerificationMaterial) > 0 { + i -= len(x.VerificationMaterial) + copy(dAtA[i:], x.VerificationMaterial) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VerificationMaterial))) + i-- + dAtA[i] = 0x22 + } + 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] = 0x1a + } + if len(x.VerificationMethodType) > 0 { + i -= len(x.VerificationMethodType) + copy(dAtA[i:], x.VerificationMethodType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VerificationMethodType))) + 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))) + 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().(*VerificationMethod) + 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: VerificationMethod: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VerificationMethod: 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 Id", 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.Id = 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 VerificationMethodType", 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.VerificationMethodType = 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 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 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VerificationMaterial", 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.VerificationMaterial = 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.List = (*_Service_3_list)(nil) + +type _Service_3_list struct { + list *[]string +} + +func (x *_Service_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Service_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Service_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Service_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Service_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Service at list field ServiceEndpoint as it is not of Message kind")) +} + +func (x *_Service_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Service_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Service_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Service protoreflect.MessageDescriptor + fd_Service_id protoreflect.FieldDescriptor + fd_Service_service_type protoreflect.FieldDescriptor + fd_Service_service_endpoint protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_diddoc_proto_init() + md_Service = File_cheqd_did_v2_diddoc_proto.Messages().ByName("Service") + fd_Service_id = md_Service.Fields().ByName("id") + fd_Service_service_type = md_Service.Fields().ByName("service_type") + fd_Service_service_endpoint = md_Service.Fields().ByName("service_endpoint") +} + +var _ protoreflect.Message = (*fastReflection_Service)(nil) + +type fastReflection_Service Service + +func (x *Service) ProtoReflect() protoreflect.Message { + return (*fastReflection_Service)(x) +} + +func (x *Service) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_diddoc_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_Service_messageType fastReflection_Service_messageType +var _ protoreflect.MessageType = fastReflection_Service_messageType{} + +type fastReflection_Service_messageType struct{} + +func (x fastReflection_Service_messageType) Zero() protoreflect.Message { + return (*fastReflection_Service)(nil) +} +func (x fastReflection_Service_messageType) New() protoreflect.Message { + return new(fastReflection_Service) +} +func (x fastReflection_Service_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Service +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Service) Descriptor() protoreflect.MessageDescriptor { + return md_Service +} + +// 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_Service) Type() protoreflect.MessageType { + return _fastReflection_Service_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Service) New() protoreflect.Message { + return new(fastReflection_Service) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Service) Interface() protoreflect.ProtoMessage { + return (*Service)(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_Service) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Service_id, value) { + return + } + } + if x.ServiceType != "" { + value := protoreflect.ValueOfString(x.ServiceType) + if !f(fd_Service_service_type, value) { + return + } + } + if len(x.ServiceEndpoint) != 0 { + value := protoreflect.ValueOfList(&_Service_3_list{list: &x.ServiceEndpoint}) + if !f(fd_Service_service_endpoint, 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_Service) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.Service.id": + return x.Id != "" + case "cheqd.did.v2.Service.service_type": + return x.ServiceType != "" + case "cheqd.did.v2.Service.service_endpoint": + return len(x.ServiceEndpoint) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Service")) + } + panic(fmt.Errorf("message cheqd.did.v2.Service 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_Service) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.Service.id": + x.Id = "" + case "cheqd.did.v2.Service.service_type": + x.ServiceType = "" + case "cheqd.did.v2.Service.service_endpoint": + x.ServiceEndpoint = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Service")) + } + panic(fmt.Errorf("message cheqd.did.v2.Service 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_Service) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.Service.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.Service.service_type": + value := x.ServiceType + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.Service.service_endpoint": + if len(x.ServiceEndpoint) == 0 { + return protoreflect.ValueOfList(&_Service_3_list{}) + } + listValue := &_Service_3_list{list: &x.ServiceEndpoint} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Service")) + } + panic(fmt.Errorf("message cheqd.did.v2.Service 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_Service) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.Service.id": + x.Id = value.Interface().(string) + case "cheqd.did.v2.Service.service_type": + x.ServiceType = value.Interface().(string) + case "cheqd.did.v2.Service.service_endpoint": + lv := value.List() + clv := lv.(*_Service_3_list) + x.ServiceEndpoint = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Service")) + } + panic(fmt.Errorf("message cheqd.did.v2.Service 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_Service) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.Service.service_endpoint": + if x.ServiceEndpoint == nil { + x.ServiceEndpoint = []string{} + } + value := &_Service_3_list{list: &x.ServiceEndpoint} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.Service.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.Service is not mutable")) + case "cheqd.did.v2.Service.service_type": + panic(fmt.Errorf("field service_type of message cheqd.did.v2.Service is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Service")) + } + panic(fmt.Errorf("message cheqd.did.v2.Service 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_Service) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.Service.id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.Service.service_type": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.Service.service_endpoint": + list := []string{} + return protoreflect.ValueOfList(&_Service_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Service")) + } + panic(fmt.Errorf("message cheqd.did.v2.Service 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_Service) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.Service", 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_Service) 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_Service) 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_Service) 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_Service) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Service) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ServiceType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ServiceEndpoint) > 0 { + for _, s := range x.ServiceEndpoint { + l = len(s) + 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().(*Service) + 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.ServiceEndpoint) > 0 { + for iNdEx := len(x.ServiceEndpoint) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.ServiceEndpoint[iNdEx]) + copy(dAtA[i:], x.ServiceEndpoint[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceEndpoint[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.ServiceType) > 0 { + i -= len(x.ServiceType) + copy(dAtA[i:], x.ServiceType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceType))) + 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))) + 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().(*Service) + 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: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Service: 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 Id", 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.Id = 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 ServiceType", 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.ServiceType = 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 ServiceEndpoint", 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.ServiceEndpoint = append(x.ServiceEndpoint, 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_DidDocWithMetadata protoreflect.MessageDescriptor + fd_DidDocWithMetadata_did_doc protoreflect.FieldDescriptor + fd_DidDocWithMetadata_metadata protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_diddoc_proto_init() + md_DidDocWithMetadata = File_cheqd_did_v2_diddoc_proto.Messages().ByName("DidDocWithMetadata") + fd_DidDocWithMetadata_did_doc = md_DidDocWithMetadata.Fields().ByName("did_doc") + fd_DidDocWithMetadata_metadata = md_DidDocWithMetadata.Fields().ByName("metadata") +} + +var _ protoreflect.Message = (*fastReflection_DidDocWithMetadata)(nil) + +type fastReflection_DidDocWithMetadata DidDocWithMetadata + +func (x *DidDocWithMetadata) ProtoReflect() protoreflect.Message { + return (*fastReflection_DidDocWithMetadata)(x) +} + +func (x *DidDocWithMetadata) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_diddoc_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_DidDocWithMetadata_messageType fastReflection_DidDocWithMetadata_messageType +var _ protoreflect.MessageType = fastReflection_DidDocWithMetadata_messageType{} + +type fastReflection_DidDocWithMetadata_messageType struct{} + +func (x fastReflection_DidDocWithMetadata_messageType) Zero() protoreflect.Message { + return (*fastReflection_DidDocWithMetadata)(nil) +} +func (x fastReflection_DidDocWithMetadata_messageType) New() protoreflect.Message { + return new(fastReflection_DidDocWithMetadata) +} +func (x fastReflection_DidDocWithMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DidDocWithMetadata +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DidDocWithMetadata) Descriptor() protoreflect.MessageDescriptor { + return md_DidDocWithMetadata +} + +// 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_DidDocWithMetadata) Type() protoreflect.MessageType { + return _fastReflection_DidDocWithMetadata_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DidDocWithMetadata) New() protoreflect.Message { + return new(fastReflection_DidDocWithMetadata) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DidDocWithMetadata) Interface() protoreflect.ProtoMessage { + return (*DidDocWithMetadata)(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_DidDocWithMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DidDoc != nil { + value := protoreflect.ValueOfMessage(x.DidDoc.ProtoReflect()) + if !f(fd_DidDocWithMetadata_did_doc, value) { + return + } + } + if x.Metadata != nil { + value := protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) + if !f(fd_DidDocWithMetadata_metadata, 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_DidDocWithMetadata) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.DidDocWithMetadata.did_doc": + return x.DidDoc != nil + case "cheqd.did.v2.DidDocWithMetadata.metadata": + return x.Metadata != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocWithMetadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocWithMetadata 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_DidDocWithMetadata) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.DidDocWithMetadata.did_doc": + x.DidDoc = nil + case "cheqd.did.v2.DidDocWithMetadata.metadata": + x.Metadata = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocWithMetadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocWithMetadata 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_DidDocWithMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.DidDocWithMetadata.did_doc": + value := x.DidDoc + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.DidDocWithMetadata.metadata": + value := x.Metadata + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocWithMetadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocWithMetadata 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_DidDocWithMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.DidDocWithMetadata.did_doc": + x.DidDoc = value.Message().Interface().(*DidDoc) + case "cheqd.did.v2.DidDocWithMetadata.metadata": + x.Metadata = value.Message().Interface().(*Metadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocWithMetadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocWithMetadata 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_DidDocWithMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.DidDocWithMetadata.did_doc": + if x.DidDoc == nil { + x.DidDoc = new(DidDoc) + } + return protoreflect.ValueOfMessage(x.DidDoc.ProtoReflect()) + case "cheqd.did.v2.DidDocWithMetadata.metadata": + if x.Metadata == nil { + x.Metadata = new(Metadata) + } + return protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocWithMetadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocWithMetadata 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_DidDocWithMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.DidDocWithMetadata.did_doc": + m := new(DidDoc) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.DidDocWithMetadata.metadata": + m := new(Metadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocWithMetadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocWithMetadata 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_DidDocWithMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.DidDocWithMetadata", 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_DidDocWithMetadata) 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_DidDocWithMetadata) 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_DidDocWithMetadata) 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_DidDocWithMetadata) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DidDocWithMetadata) + 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.DidDoc != nil { + l = options.Size(x.DidDoc) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Metadata != nil { + l = options.Size(x.Metadata) + 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().(*DidDocWithMetadata) + 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.Metadata != nil { + encoded, err := options.Marshal(x.Metadata) + 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 x.DidDoc != nil { + encoded, err := options.Marshal(x.DidDoc) + 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().(*DidDocWithMetadata) + 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: DidDocWithMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DidDocWithMetadata: 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 DidDoc", 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.DidDoc == nil { + x.DidDoc = &DidDoc{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DidDoc); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata == nil { + x.Metadata = &Metadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Metadata); 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_Metadata protoreflect.MessageDescriptor + fd_Metadata_created protoreflect.FieldDescriptor + fd_Metadata_updated protoreflect.FieldDescriptor + fd_Metadata_deactivated protoreflect.FieldDescriptor + fd_Metadata_version_id protoreflect.FieldDescriptor + fd_Metadata_next_version_id protoreflect.FieldDescriptor + fd_Metadata_previous_version_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_diddoc_proto_init() + md_Metadata = File_cheqd_did_v2_diddoc_proto.Messages().ByName("Metadata") + fd_Metadata_created = md_Metadata.Fields().ByName("created") + fd_Metadata_updated = md_Metadata.Fields().ByName("updated") + fd_Metadata_deactivated = md_Metadata.Fields().ByName("deactivated") + fd_Metadata_version_id = md_Metadata.Fields().ByName("version_id") + fd_Metadata_next_version_id = md_Metadata.Fields().ByName("next_version_id") + fd_Metadata_previous_version_id = md_Metadata.Fields().ByName("previous_version_id") +} + +var _ protoreflect.Message = (*fastReflection_Metadata)(nil) + +type fastReflection_Metadata Metadata + +func (x *Metadata) ProtoReflect() protoreflect.Message { + return (*fastReflection_Metadata)(x) +} + +func (x *Metadata) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_diddoc_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_Metadata_messageType fastReflection_Metadata_messageType +var _ protoreflect.MessageType = fastReflection_Metadata_messageType{} + +type fastReflection_Metadata_messageType struct{} + +func (x fastReflection_Metadata_messageType) Zero() protoreflect.Message { + return (*fastReflection_Metadata)(nil) +} +func (x fastReflection_Metadata_messageType) New() protoreflect.Message { + return new(fastReflection_Metadata) +} +func (x fastReflection_Metadata_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Metadata +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Metadata) Descriptor() protoreflect.MessageDescriptor { + return md_Metadata +} + +// 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_Metadata) Type() protoreflect.MessageType { + return _fastReflection_Metadata_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Metadata) New() protoreflect.Message { + return new(fastReflection_Metadata) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Metadata) Interface() protoreflect.ProtoMessage { + return (*Metadata)(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_Metadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Created != nil { + value := protoreflect.ValueOfMessage(x.Created.ProtoReflect()) + if !f(fd_Metadata_created, value) { + return + } + } + if x.Updated != nil { + value := protoreflect.ValueOfMessage(x.Updated.ProtoReflect()) + if !f(fd_Metadata_updated, value) { + return + } + } + if x.Deactivated != false { + value := protoreflect.ValueOfBool(x.Deactivated) + if !f(fd_Metadata_deactivated, value) { + return + } + } + if x.VersionId != "" { + value := protoreflect.ValueOfString(x.VersionId) + if !f(fd_Metadata_version_id, value) { + return + } + } + if x.NextVersionId != "" { + value := protoreflect.ValueOfString(x.NextVersionId) + if !f(fd_Metadata_next_version_id, value) { + return + } + } + if x.PreviousVersionId != "" { + value := protoreflect.ValueOfString(x.PreviousVersionId) + if !f(fd_Metadata_previous_version_id, 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_Metadata) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.Metadata.created": + return x.Created != nil + case "cheqd.did.v2.Metadata.updated": + return x.Updated != nil + case "cheqd.did.v2.Metadata.deactivated": + return x.Deactivated != false + case "cheqd.did.v2.Metadata.version_id": + return x.VersionId != "" + case "cheqd.did.v2.Metadata.next_version_id": + return x.NextVersionId != "" + case "cheqd.did.v2.Metadata.previous_version_id": + return x.PreviousVersionId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.Metadata 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_Metadata) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.Metadata.created": + x.Created = nil + case "cheqd.did.v2.Metadata.updated": + x.Updated = nil + case "cheqd.did.v2.Metadata.deactivated": + x.Deactivated = false + case "cheqd.did.v2.Metadata.version_id": + x.VersionId = "" + case "cheqd.did.v2.Metadata.next_version_id": + x.NextVersionId = "" + case "cheqd.did.v2.Metadata.previous_version_id": + x.PreviousVersionId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.Metadata 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_Metadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.Metadata.created": + value := x.Created + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.Metadata.updated": + value := x.Updated + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.Metadata.deactivated": + value := x.Deactivated + return protoreflect.ValueOfBool(value) + case "cheqd.did.v2.Metadata.version_id": + value := x.VersionId + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.Metadata.next_version_id": + value := x.NextVersionId + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.Metadata.previous_version_id": + value := x.PreviousVersionId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.Metadata 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_Metadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.Metadata.created": + x.Created = value.Message().Interface().(*timestamppb.Timestamp) + case "cheqd.did.v2.Metadata.updated": + x.Updated = value.Message().Interface().(*timestamppb.Timestamp) + case "cheqd.did.v2.Metadata.deactivated": + x.Deactivated = value.Bool() + case "cheqd.did.v2.Metadata.version_id": + x.VersionId = value.Interface().(string) + case "cheqd.did.v2.Metadata.next_version_id": + x.NextVersionId = value.Interface().(string) + case "cheqd.did.v2.Metadata.previous_version_id": + x.PreviousVersionId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.Metadata 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_Metadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.Metadata.created": + if x.Created == nil { + x.Created = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Created.ProtoReflect()) + case "cheqd.did.v2.Metadata.updated": + if x.Updated == nil { + x.Updated = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Updated.ProtoReflect()) + case "cheqd.did.v2.Metadata.deactivated": + panic(fmt.Errorf("field deactivated of message cheqd.did.v2.Metadata is not mutable")) + case "cheqd.did.v2.Metadata.version_id": + panic(fmt.Errorf("field version_id of message cheqd.did.v2.Metadata is not mutable")) + case "cheqd.did.v2.Metadata.next_version_id": + panic(fmt.Errorf("field next_version_id of message cheqd.did.v2.Metadata is not mutable")) + case "cheqd.did.v2.Metadata.previous_version_id": + panic(fmt.Errorf("field previous_version_id of message cheqd.did.v2.Metadata is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.Metadata 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_Metadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.Metadata.created": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.Metadata.updated": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.Metadata.deactivated": + return protoreflect.ValueOfBool(false) + case "cheqd.did.v2.Metadata.version_id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.Metadata.next_version_id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.Metadata.previous_version_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.did.v2.Metadata 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_Metadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.Metadata", 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_Metadata) 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_Metadata) 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_Metadata) 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_Metadata) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Metadata) + 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.Created != nil { + l = options.Size(x.Created) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Updated != nil { + l = options.Size(x.Updated) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Deactivated { + n += 2 + } + l = len(x.VersionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.NextVersionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PreviousVersionId) + 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().(*Metadata) + 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.PreviousVersionId) > 0 { + i -= len(x.PreviousVersionId) + copy(dAtA[i:], x.PreviousVersionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PreviousVersionId))) + i-- + dAtA[i] = 0x32 + } + if len(x.NextVersionId) > 0 { + i -= len(x.NextVersionId) + copy(dAtA[i:], x.NextVersionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NextVersionId))) + i-- + dAtA[i] = 0x2a + } + if len(x.VersionId) > 0 { + i -= len(x.VersionId) + copy(dAtA[i:], x.VersionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VersionId))) + i-- + dAtA[i] = 0x22 + } + if x.Deactivated { + i-- + if x.Deactivated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if x.Updated != nil { + encoded, err := options.Marshal(x.Updated) + 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 x.Created != nil { + encoded, err := options.Marshal(x.Created) + 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().(*Metadata) + 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: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Metadata: 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 Created", 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.Created == nil { + x.Created = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Created); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Updated", 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.Updated == nil { + x.Updated = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Updated); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Deactivated", 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.Deactivated = bool(v != 0) + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VersionId", 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.VersionId = 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 NextVersionId", 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.NextVersionId = 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 PreviousVersionId", 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.PreviousVersionId = 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: cheqd/did/v2/diddoc.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) +) + +// DidDoc defines a DID Document, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/ +type DidDoc struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 + Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` + // id is the DID of the DID document. + // Format: did:cheqd:: + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // controller is a list of DIDs that are allowed to control the DID document. + Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. + VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. + Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. + AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. + CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. + CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. + KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` + // service is a list of services that can be used to interact with the DID subject. + Service []*Service `protobuf:"bytes,10,rep,name=service,proto3" json:"service,omitempty"` + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. + AlsoKnownAs []string `protobuf:"bytes,11,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` +} + +func (x *DidDoc) Reset() { + *x = DidDoc{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_diddoc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DidDoc) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DidDoc) ProtoMessage() {} + +// Deprecated: Use DidDoc.ProtoReflect.Descriptor instead. +func (*DidDoc) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_diddoc_proto_rawDescGZIP(), []int{0} +} + +func (x *DidDoc) GetContext() []string { + if x != nil { + return x.Context + } + return nil +} + +func (x *DidDoc) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DidDoc) GetController() []string { + if x != nil { + return x.Controller + } + return nil +} + +func (x *DidDoc) GetVerificationMethod() []*VerificationMethod { + if x != nil { + return x.VerificationMethod + } + return nil +} + +func (x *DidDoc) GetAuthentication() []string { + if x != nil { + return x.Authentication + } + return nil +} + +func (x *DidDoc) GetAssertionMethod() []string { + if x != nil { + return x.AssertionMethod + } + return nil +} + +func (x *DidDoc) GetCapabilityInvocation() []string { + if x != nil { + return x.CapabilityInvocation + } + return nil +} + +func (x *DidDoc) GetCapabilityDelegation() []string { + if x != nil { + return x.CapabilityDelegation + } + return nil +} + +func (x *DidDoc) GetKeyAgreement() []string { + if x != nil { + return x.KeyAgreement + } + return nil +} + +func (x *DidDoc) GetService() []*Service { + if x != nil { + return x.Service + } + return nil +} + +func (x *DidDoc) GetAlsoKnownAs() []string { + if x != nil { + return x.AlsoKnownAs + } + return nil +} + +// VerificationMethod defines a verification method, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#verification-methods +type VerificationMethod struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id is the unique identifier of the verification method. + // Format: did:cheqd::# + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // type is the type of the verification method. + // Example: Ed25519VerificationKey2020 + VerificationMethodType string `protobuf:"bytes,2,opt,name=verification_method_type,json=verificationMethodType,proto3" json:"verification_method_type,omitempty"` + // controller is the DID of the controller of the verification method. + // Format: did:cheqd:: + Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` + // verification_material is the public key of the verification method. + // Commonly used verification material types: publicJwk, publicKeyBase58, publicKeyMultibase + VerificationMaterial string `protobuf:"bytes,4,opt,name=verification_material,json=verificationMaterial,proto3" json:"verification_material,omitempty"` +} + +func (x *VerificationMethod) Reset() { + *x = VerificationMethod{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_diddoc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerificationMethod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerificationMethod) ProtoMessage() {} + +// Deprecated: Use VerificationMethod.ProtoReflect.Descriptor instead. +func (*VerificationMethod) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_diddoc_proto_rawDescGZIP(), []int{1} +} + +func (x *VerificationMethod) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *VerificationMethod) GetVerificationMethodType() string { + if x != nil { + return x.VerificationMethodType + } + return "" +} + +func (x *VerificationMethod) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *VerificationMethod) GetVerificationMaterial() string { + if x != nil { + return x.VerificationMaterial + } + return "" +} + +// Service defines a service, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#services +type Service struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id is the unique identifier of the service. + // Format: did:cheqd::# + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // type is the type of the service. + // Example: LinkedResource + ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + // serviceEndpoint is the endpoint of the service. + // Example: https://example.com/endpoint + ServiceEndpoint []string `protobuf:"bytes,3,rep,name=service_endpoint,json=serviceEndpoint,proto3" json:"service_endpoint,omitempty"` +} + +func (x *Service) Reset() { + *x = Service{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_diddoc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Service) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Service) ProtoMessage() {} + +// Deprecated: Use Service.ProtoReflect.Descriptor instead. +func (*Service) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_diddoc_proto_rawDescGZIP(), []int{2} +} + +func (x *Service) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Service) GetServiceType() string { + if x != nil { + return x.ServiceType + } + return "" +} + +func (x *Service) GetServiceEndpoint() []string { + if x != nil { + return x.ServiceEndpoint + } + return nil +} + +// DidDocWithMetadata defines a DID Document with metadata, as defined in the DID Core specification. +// Contains the DID Document, as well as DID Document metadata. +type DidDocWithMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // didDocument is the DID Document. + DidDoc *DidDoc `protobuf:"bytes,1,opt,name=did_doc,json=didDoc,proto3" json:"did_doc,omitempty"` + // didDocumentMetadata is the DID Document metadata. + Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *DidDocWithMetadata) Reset() { + *x = DidDocWithMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_diddoc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DidDocWithMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DidDocWithMetadata) ProtoMessage() {} + +// Deprecated: Use DidDocWithMetadata.ProtoReflect.Descriptor instead. +func (*DidDocWithMetadata) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_diddoc_proto_rawDescGZIP(), []int{3} +} + +func (x *DidDocWithMetadata) GetDidDoc() *DidDoc { + if x != nil { + return x.DidDoc + } + return nil +} + +func (x *DidDocWithMetadata) GetMetadata() *Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +// Metadata defines DID Document metadata, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#did-document-metadata-properties +type Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // created is the timestamp of the creation of the DID Document. + // Format: RFC3339 + // Example: 2021-03-10T15:16:17Z + Created *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"` + // updated is the timestamp of the last update of the DID Document. + // Format: RFC3339 + // Example: 2021-03-10T15:16:17Z + Updated *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated,proto3" json:"updated,omitempty"` + // deactivated is a flag that indicates whether the DID Document is deactivated. + // Default: false + Deactivated bool `protobuf:"varint,3,opt,name=deactivated,proto3" json:"deactivated,omitempty"` + // version_id is the version identifier of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 + VersionId string `protobuf:"bytes,4,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` + // next_version_id is the version identifier of the next version of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 + NextVersionId string `protobuf:"bytes,5,opt,name=next_version_id,json=nextVersionId,proto3" json:"next_version_id,omitempty"` + // previous_version_id is the version identifier of the previous version of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 + PreviousVersionId string `protobuf:"bytes,6,opt,name=previous_version_id,json=previousVersionId,proto3" json:"previous_version_id,omitempty"` +} + +func (x *Metadata) Reset() { + *x = Metadata{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_diddoc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metadata) ProtoMessage() {} + +// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_diddoc_proto_rawDescGZIP(), []int{4} +} + +func (x *Metadata) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *Metadata) GetUpdated() *timestamppb.Timestamp { + if x != nil { + return x.Updated + } + return nil +} + +func (x *Metadata) GetDeactivated() bool { + if x != nil { + return x.Deactivated + } + return false +} + +func (x *Metadata) GetVersionId() string { + if x != nil { + return x.VersionId + } + return "" +} + +func (x *Metadata) GetNextVersionId() string { + if x != nil { + return x.NextVersionId + } + return "" +} + +func (x *Metadata) GetPreviousVersionId() string { + if x != nil { + return x.PreviousVersionId + } + return "" +} + +var File_cheqd_did_v2_diddoc_proto protoreflect.FileDescriptor + +var file_cheqd_did_v2_diddoc_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x64, + 0x69, 0x64, 0x64, 0x6f, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xdc, 0x03, 0x0a, 0x06, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x32, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 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, 0x06, 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, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 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, 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, 0x08, 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, 0x23, 0x0a, 0x0d, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x67, 0x72, + 0x65, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6b, 0x65, + 0x79, 0x41, 0x67, 0x72, 0x65, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, + 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x61, + 0x6c, 0x73, 0x6f, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0b, 0x61, 0x6c, 0x73, 0x6f, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x41, 0x73, 0x22, + 0xb3, 0x01, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x12, 0x33, 0x0a, 0x15, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x22, 0x67, 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, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0xa1, + 0x01, 0x0a, 0x12, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x07, 0x64, 0x69, 0x64, 0x5f, 0x64, 0x6f, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x42, 0x0f, 0xea, 0xde, + 0x1f, 0x0b, 0x64, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x64, + 0x69, 0x64, 0x44, 0x6f, 0x63, 0x12, 0x4b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, + 0x17, 0xea, 0xde, 0x1f, 0x13, 0x64, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x22, 0xaf, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x3e, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, + 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, + 0x3e, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, + 0x1f, 0x01, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x2c, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x01, 0x52, + 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x34, + 0x0a, 0x13, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x01, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x42, 0xa5, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x42, 0x0b, 0x44, 0x69, 0x64, 0x64, 0x6f, + 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, + 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, + 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, + 0x44, 0x58, 0xaa, 0x02, 0x0c, 0x43, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x44, 0x69, 0x64, 0x2e, 0x56, + 0x32, 0xca, 0x02, 0x0c, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x32, + 0xe2, 0x02, 0x18, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x32, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x43, 0x68, + 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_did_v2_diddoc_proto_rawDescOnce sync.Once + file_cheqd_did_v2_diddoc_proto_rawDescData = file_cheqd_did_v2_diddoc_proto_rawDesc +) + +func file_cheqd_did_v2_diddoc_proto_rawDescGZIP() []byte { + file_cheqd_did_v2_diddoc_proto_rawDescOnce.Do(func() { + file_cheqd_did_v2_diddoc_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_did_v2_diddoc_proto_rawDescData) + }) + return file_cheqd_did_v2_diddoc_proto_rawDescData +} + +var file_cheqd_did_v2_diddoc_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_cheqd_did_v2_diddoc_proto_goTypes = []interface{}{ + (*DidDoc)(nil), // 0: cheqd.did.v2.DidDoc + (*VerificationMethod)(nil), // 1: cheqd.did.v2.VerificationMethod + (*Service)(nil), // 2: cheqd.did.v2.Service + (*DidDocWithMetadata)(nil), // 3: cheqd.did.v2.DidDocWithMetadata + (*Metadata)(nil), // 4: cheqd.did.v2.Metadata + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp +} +var file_cheqd_did_v2_diddoc_proto_depIdxs = []int32{ + 1, // 0: cheqd.did.v2.DidDoc.verification_method:type_name -> cheqd.did.v2.VerificationMethod + 2, // 1: cheqd.did.v2.DidDoc.service:type_name -> cheqd.did.v2.Service + 0, // 2: cheqd.did.v2.DidDocWithMetadata.did_doc:type_name -> cheqd.did.v2.DidDoc + 4, // 3: cheqd.did.v2.DidDocWithMetadata.metadata:type_name -> cheqd.did.v2.Metadata + 5, // 4: cheqd.did.v2.Metadata.created:type_name -> google.protobuf.Timestamp + 5, // 5: cheqd.did.v2.Metadata.updated:type_name -> google.protobuf.Timestamp + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_cheqd_did_v2_diddoc_proto_init() } +func file_cheqd_did_v2_diddoc_proto_init() { + if File_cheqd_did_v2_diddoc_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cheqd_did_v2_diddoc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DidDoc); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_diddoc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerificationMethod); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_diddoc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Service); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_diddoc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DidDocWithMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_diddoc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metadata); 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_cheqd_did_v2_diddoc_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cheqd_did_v2_diddoc_proto_goTypes, + DependencyIndexes: file_cheqd_did_v2_diddoc_proto_depIdxs, + MessageInfos: file_cheqd_did_v2_diddoc_proto_msgTypes, + }.Build() + File_cheqd_did_v2_diddoc_proto = out.File + file_cheqd_did_v2_diddoc_proto_rawDesc = nil + file_cheqd_did_v2_diddoc_proto_goTypes = nil + file_cheqd_did_v2_diddoc_proto_depIdxs = nil +} diff --git a/api/cheqd/did/v2/fee.pulsar.go b/api/cheqd/did/v2/fee.pulsar.go new file mode 100644 index 000000000..fc47a396a --- /dev/null +++ b/api/cheqd/did/v2/fee.pulsar.go @@ -0,0 +1,868 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package didv2 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/v1beta1" + _ "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_FeeParams protoreflect.MessageDescriptor + fd_FeeParams_create_did protoreflect.FieldDescriptor + fd_FeeParams_update_did protoreflect.FieldDescriptor + fd_FeeParams_deactivate_did protoreflect.FieldDescriptor + fd_FeeParams_burn_factor protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_fee_proto_init() + md_FeeParams = File_cheqd_did_v2_fee_proto.Messages().ByName("FeeParams") + fd_FeeParams_create_did = md_FeeParams.Fields().ByName("create_did") + fd_FeeParams_update_did = md_FeeParams.Fields().ByName("update_did") + fd_FeeParams_deactivate_did = md_FeeParams.Fields().ByName("deactivate_did") + fd_FeeParams_burn_factor = md_FeeParams.Fields().ByName("burn_factor") +} + +var _ protoreflect.Message = (*fastReflection_FeeParams)(nil) + +type fastReflection_FeeParams FeeParams + +func (x *FeeParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_FeeParams)(x) +} + +func (x *FeeParams) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_fee_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_FeeParams_messageType fastReflection_FeeParams_messageType +var _ protoreflect.MessageType = fastReflection_FeeParams_messageType{} + +type fastReflection_FeeParams_messageType struct{} + +func (x fastReflection_FeeParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_FeeParams)(nil) +} +func (x fastReflection_FeeParams_messageType) New() protoreflect.Message { + return new(fastReflection_FeeParams) +} +func (x fastReflection_FeeParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_FeeParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_FeeParams) Descriptor() protoreflect.MessageDescriptor { + return md_FeeParams +} + +// 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_FeeParams) Type() protoreflect.MessageType { + return _fastReflection_FeeParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_FeeParams) New() protoreflect.Message { + return new(fastReflection_FeeParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_FeeParams) Interface() protoreflect.ProtoMessage { + return (*FeeParams)(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_FeeParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CreateDid != nil { + value := protoreflect.ValueOfMessage(x.CreateDid.ProtoReflect()) + if !f(fd_FeeParams_create_did, value) { + return + } + } + if x.UpdateDid != nil { + value := protoreflect.ValueOfMessage(x.UpdateDid.ProtoReflect()) + if !f(fd_FeeParams_update_did, value) { + return + } + } + if x.DeactivateDid != nil { + value := protoreflect.ValueOfMessage(x.DeactivateDid.ProtoReflect()) + if !f(fd_FeeParams_deactivate_did, value) { + return + } + } + if x.BurnFactor != "" { + value := protoreflect.ValueOfString(x.BurnFactor) + if !f(fd_FeeParams_burn_factor, 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_FeeParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.FeeParams.create_did": + return x.CreateDid != nil + case "cheqd.did.v2.FeeParams.update_did": + return x.UpdateDid != nil + case "cheqd.did.v2.FeeParams.deactivate_did": + return x.DeactivateDid != nil + case "cheqd.did.v2.FeeParams.burn_factor": + return x.BurnFactor != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.did.v2.FeeParams 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_FeeParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.FeeParams.create_did": + x.CreateDid = nil + case "cheqd.did.v2.FeeParams.update_did": + x.UpdateDid = nil + case "cheqd.did.v2.FeeParams.deactivate_did": + x.DeactivateDid = nil + case "cheqd.did.v2.FeeParams.burn_factor": + x.BurnFactor = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.did.v2.FeeParams 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_FeeParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.FeeParams.create_did": + value := x.CreateDid + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.FeeParams.update_did": + value := x.UpdateDid + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.FeeParams.deactivate_did": + value := x.DeactivateDid + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.FeeParams.burn_factor": + value := x.BurnFactor + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.did.v2.FeeParams 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_FeeParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.FeeParams.create_did": + x.CreateDid = value.Message().Interface().(*v1beta1.Coin) + case "cheqd.did.v2.FeeParams.update_did": + x.UpdateDid = value.Message().Interface().(*v1beta1.Coin) + case "cheqd.did.v2.FeeParams.deactivate_did": + x.DeactivateDid = value.Message().Interface().(*v1beta1.Coin) + case "cheqd.did.v2.FeeParams.burn_factor": + x.BurnFactor = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.did.v2.FeeParams 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_FeeParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.FeeParams.create_did": + if x.CreateDid == nil { + x.CreateDid = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.CreateDid.ProtoReflect()) + case "cheqd.did.v2.FeeParams.update_did": + if x.UpdateDid == nil { + x.UpdateDid = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.UpdateDid.ProtoReflect()) + case "cheqd.did.v2.FeeParams.deactivate_did": + if x.DeactivateDid == nil { + x.DeactivateDid = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.DeactivateDid.ProtoReflect()) + case "cheqd.did.v2.FeeParams.burn_factor": + panic(fmt.Errorf("field burn_factor of message cheqd.did.v2.FeeParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.did.v2.FeeParams 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_FeeParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.FeeParams.create_did": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.FeeParams.update_did": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.FeeParams.deactivate_did": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.FeeParams.burn_factor": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.did.v2.FeeParams 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_FeeParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.FeeParams", 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_FeeParams) 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_FeeParams) 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_FeeParams) 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_FeeParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*FeeParams) + 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.CreateDid != nil { + l = options.Size(x.CreateDid) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.UpdateDid != nil { + l = options.Size(x.UpdateDid) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.DeactivateDid != nil { + l = options.Size(x.DeactivateDid) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.BurnFactor) + 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().(*FeeParams) + 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.BurnFactor) > 0 { + i -= len(x.BurnFactor) + copy(dAtA[i:], x.BurnFactor) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BurnFactor))) + i-- + dAtA[i] = 0x22 + } + if x.DeactivateDid != nil { + encoded, err := options.Marshal(x.DeactivateDid) + 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.UpdateDid != nil { + encoded, err := options.Marshal(x.UpdateDid) + 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 x.CreateDid != nil { + encoded, err := options.Marshal(x.CreateDid) + 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().(*FeeParams) + 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: FeeParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FeeParams: 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 CreateDid", 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.CreateDid == nil { + x.CreateDid = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreateDid); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UpdateDid", 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.UpdateDid == nil { + x.UpdateDid = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UpdateDid); 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 DeactivateDid", 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.DeactivateDid == nil { + x.DeactivateDid = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DeactivateDid); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BurnFactor", 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.BurnFactor = 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: cheqd/did/v2/fee.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) +) + +// FeeParams defines the parameters for the cheqd DID module fixed fee +type FeeParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Fixed fee for creating a DID + // + // Default: 50 CHEQ or 50000000000ncheq + CreateDid *v1beta1.Coin `protobuf:"bytes,1,opt,name=create_did,json=createDid,proto3" json:"create_did,omitempty"` + // Fixed fee for updating a DID + // + // Default: 25 CHEQ or 25000000000ncheq + UpdateDid *v1beta1.Coin `protobuf:"bytes,2,opt,name=update_did,json=updateDid,proto3" json:"update_did,omitempty"` + // Fixed fee for deactivating a DID + // + // Default: 10 CHEQ or 10000000000ncheq + DeactivateDid *v1beta1.Coin `protobuf:"bytes,3,opt,name=deactivate_did,json=deactivateDid,proto3" json:"deactivate_did,omitempty"` + // Percentage of the fixed fee that will be burned + // + // Default: 0.5 (50%) + BurnFactor string `protobuf:"bytes,4,opt,name=burn_factor,json=burnFactor,proto3" json:"burn_factor,omitempty"` +} + +func (x *FeeParams) Reset() { + *x = FeeParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_fee_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeeParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeeParams) ProtoMessage() {} + +// Deprecated: Use FeeParams.ProtoReflect.Descriptor instead. +func (*FeeParams) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_fee_proto_rawDescGZIP(), []int{0} +} + +func (x *FeeParams) GetCreateDid() *v1beta1.Coin { + if x != nil { + return x.CreateDid + } + return nil +} + +func (x *FeeParams) GetUpdateDid() *v1beta1.Coin { + if x != nil { + return x.UpdateDid + } + return nil +} + +func (x *FeeParams) GetDeactivateDid() *v1beta1.Coin { + if x != nil { + return x.DeactivateDid + } + return nil +} + +func (x *FeeParams) GetBurnFactor() string { + if x != nil { + return x.BurnFactor + } + return "" +} + +var File_cheqd_did_v2_fee_proto protoreflect.FileDescriptor + +var file_cheqd_did_v2_fee_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x66, + 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, + 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, 0x22, 0xb2, 0x02, 0x0a, 0x09, 0x46, 0x65, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, + 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x69, 0x64, 0x12, 0x3e, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x44, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x0e, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, + 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x12, 0x5d, 0x0a, + 0x0b, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, + 0x52, 0x0a, 0x62, 0x75, 0x72, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x42, 0xa6, 0x01, 0x0a, + 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x32, 0x42, 0x08, 0x46, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, + 0x63, 0x68, 0x65, 0x71, 0x64, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x3b, 0x64, 0x69, 0x64, 0x76, + 0x32, 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x0c, 0x43, 0x68, 0x65, 0x71, 0x64, 0x2e, + 0x44, 0x69, 0x64, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x44, + 0x69, 0x64, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x44, 0x69, + 0x64, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0e, 0x43, 0x68, 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, + 0x32, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_did_v2_fee_proto_rawDescOnce sync.Once + file_cheqd_did_v2_fee_proto_rawDescData = file_cheqd_did_v2_fee_proto_rawDesc +) + +func file_cheqd_did_v2_fee_proto_rawDescGZIP() []byte { + file_cheqd_did_v2_fee_proto_rawDescOnce.Do(func() { + file_cheqd_did_v2_fee_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_did_v2_fee_proto_rawDescData) + }) + return file_cheqd_did_v2_fee_proto_rawDescData +} + +var file_cheqd_did_v2_fee_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cheqd_did_v2_fee_proto_goTypes = []interface{}{ + (*FeeParams)(nil), // 0: cheqd.did.v2.FeeParams + (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin +} +var file_cheqd_did_v2_fee_proto_depIdxs = []int32{ + 1, // 0: cheqd.did.v2.FeeParams.create_did:type_name -> cosmos.base.v1beta1.Coin + 1, // 1: cheqd.did.v2.FeeParams.update_did:type_name -> cosmos.base.v1beta1.Coin + 1, // 2: cheqd.did.v2.FeeParams.deactivate_did:type_name -> cosmos.base.v1beta1.Coin + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_cheqd_did_v2_fee_proto_init() } +func file_cheqd_did_v2_fee_proto_init() { + if File_cheqd_did_v2_fee_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cheqd_did_v2_fee_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeeParams); 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_cheqd_did_v2_fee_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cheqd_did_v2_fee_proto_goTypes, + DependencyIndexes: file_cheqd_did_v2_fee_proto_depIdxs, + MessageInfos: file_cheqd_did_v2_fee_proto_msgTypes, + }.Build() + File_cheqd_did_v2_fee_proto = out.File + file_cheqd_did_v2_fee_proto_rawDesc = nil + file_cheqd_did_v2_fee_proto_goTypes = nil + file_cheqd_did_v2_fee_proto_depIdxs = nil +} diff --git a/api/cheqd/did/v2/genesis.pulsar.go b/api/cheqd/did/v2/genesis.pulsar.go new file mode 100644 index 000000000..470722513 --- /dev/null +++ b/api/cheqd/did/v2/genesis.pulsar.go @@ -0,0 +1,1449 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package didv2 + +import ( + 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 _ protoreflect.List = (*_DidDocVersionSet_2_list)(nil) + +type _DidDocVersionSet_2_list struct { + list *[]*DidDocWithMetadata +} + +func (x *_DidDocVersionSet_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DidDocVersionSet_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DidDocVersionSet_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DidDocWithMetadata) + (*x.list)[i] = concreteValue +} + +func (x *_DidDocVersionSet_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DidDocWithMetadata) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DidDocVersionSet_2_list) AppendMutable() protoreflect.Value { + v := new(DidDocWithMetadata) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DidDocVersionSet_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DidDocVersionSet_2_list) NewElement() protoreflect.Value { + v := new(DidDocWithMetadata) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DidDocVersionSet_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DidDocVersionSet protoreflect.MessageDescriptor + fd_DidDocVersionSet_latest_version protoreflect.FieldDescriptor + fd_DidDocVersionSet_did_docs protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_genesis_proto_init() + md_DidDocVersionSet = File_cheqd_did_v2_genesis_proto.Messages().ByName("DidDocVersionSet") + fd_DidDocVersionSet_latest_version = md_DidDocVersionSet.Fields().ByName("latest_version") + fd_DidDocVersionSet_did_docs = md_DidDocVersionSet.Fields().ByName("did_docs") +} + +var _ protoreflect.Message = (*fastReflection_DidDocVersionSet)(nil) + +type fastReflection_DidDocVersionSet DidDocVersionSet + +func (x *DidDocVersionSet) ProtoReflect() protoreflect.Message { + return (*fastReflection_DidDocVersionSet)(x) +} + +func (x *DidDocVersionSet) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_DidDocVersionSet_messageType fastReflection_DidDocVersionSet_messageType +var _ protoreflect.MessageType = fastReflection_DidDocVersionSet_messageType{} + +type fastReflection_DidDocVersionSet_messageType struct{} + +func (x fastReflection_DidDocVersionSet_messageType) Zero() protoreflect.Message { + return (*fastReflection_DidDocVersionSet)(nil) +} +func (x fastReflection_DidDocVersionSet_messageType) New() protoreflect.Message { + return new(fastReflection_DidDocVersionSet) +} +func (x fastReflection_DidDocVersionSet_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DidDocVersionSet +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DidDocVersionSet) Descriptor() protoreflect.MessageDescriptor { + return md_DidDocVersionSet +} + +// 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_DidDocVersionSet) Type() protoreflect.MessageType { + return _fastReflection_DidDocVersionSet_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DidDocVersionSet) New() protoreflect.Message { + return new(fastReflection_DidDocVersionSet) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DidDocVersionSet) Interface() protoreflect.ProtoMessage { + return (*DidDocVersionSet)(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_DidDocVersionSet) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.LatestVersion != "" { + value := protoreflect.ValueOfString(x.LatestVersion) + if !f(fd_DidDocVersionSet_latest_version, value) { + return + } + } + if len(x.DidDocs) != 0 { + value := protoreflect.ValueOfList(&_DidDocVersionSet_2_list{list: &x.DidDocs}) + if !f(fd_DidDocVersionSet_did_docs, 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_DidDocVersionSet) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.DidDocVersionSet.latest_version": + return x.LatestVersion != "" + case "cheqd.did.v2.DidDocVersionSet.did_docs": + return len(x.DidDocs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocVersionSet")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocVersionSet 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_DidDocVersionSet) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.DidDocVersionSet.latest_version": + x.LatestVersion = "" + case "cheqd.did.v2.DidDocVersionSet.did_docs": + x.DidDocs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocVersionSet")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocVersionSet 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_DidDocVersionSet) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.DidDocVersionSet.latest_version": + value := x.LatestVersion + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.DidDocVersionSet.did_docs": + if len(x.DidDocs) == 0 { + return protoreflect.ValueOfList(&_DidDocVersionSet_2_list{}) + } + listValue := &_DidDocVersionSet_2_list{list: &x.DidDocs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocVersionSet")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocVersionSet 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_DidDocVersionSet) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.DidDocVersionSet.latest_version": + x.LatestVersion = value.Interface().(string) + case "cheqd.did.v2.DidDocVersionSet.did_docs": + lv := value.List() + clv := lv.(*_DidDocVersionSet_2_list) + x.DidDocs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocVersionSet")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocVersionSet 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_DidDocVersionSet) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.DidDocVersionSet.did_docs": + if x.DidDocs == nil { + x.DidDocs = []*DidDocWithMetadata{} + } + value := &_DidDocVersionSet_2_list{list: &x.DidDocs} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.DidDocVersionSet.latest_version": + panic(fmt.Errorf("field latest_version of message cheqd.did.v2.DidDocVersionSet is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocVersionSet")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocVersionSet 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_DidDocVersionSet) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.DidDocVersionSet.latest_version": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.DidDocVersionSet.did_docs": + list := []*DidDocWithMetadata{} + return protoreflect.ValueOfList(&_DidDocVersionSet_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.DidDocVersionSet")) + } + panic(fmt.Errorf("message cheqd.did.v2.DidDocVersionSet 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_DidDocVersionSet) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.DidDocVersionSet", 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_DidDocVersionSet) 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_DidDocVersionSet) 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_DidDocVersionSet) 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_DidDocVersionSet) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DidDocVersionSet) + 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.LatestVersion) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.DidDocs) > 0 { + for _, e := range x.DidDocs { + l = options.Size(e) + 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().(*DidDocVersionSet) + 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.DidDocs) > 0 { + for iNdEx := len(x.DidDocs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.DidDocs[iNdEx]) + 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.LatestVersion) > 0 { + i -= len(x.LatestVersion) + copy(dAtA[i:], x.LatestVersion) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.LatestVersion))) + 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().(*DidDocVersionSet) + 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: DidDocVersionSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DidDocVersionSet: 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 LatestVersion", 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.LatestVersion = 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 DidDocs", 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 + } + x.DidDocs = append(x.DidDocs, &DidDocWithMetadata{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DidDocs[len(x.DidDocs)-1]); 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 _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*DidDocVersionSet +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DidDocVersionSet) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DidDocVersionSet) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(DidDocVersionSet) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(DidDocVersionSet) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_did_namespace protoreflect.FieldDescriptor + fd_GenesisState_version_sets protoreflect.FieldDescriptor + fd_GenesisState_fee_params protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_genesis_proto_init() + md_GenesisState = File_cheqd_did_v2_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_did_namespace = md_GenesisState.Fields().ByName("did_namespace") + fd_GenesisState_version_sets = md_GenesisState.Fields().ByName("version_sets") + fd_GenesisState_fee_params = md_GenesisState.Fields().ByName("fee_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_cheqd_did_v2_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_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.DidNamespace != "" { + value := protoreflect.ValueOfString(x.DidNamespace) + if !f(fd_GenesisState_did_namespace, value) { + return + } + } + if len(x.VersionSets) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.VersionSets}) + if !f(fd_GenesisState_version_sets, value) { + return + } + } + if x.FeeParams != nil { + value := protoreflect.ValueOfMessage(x.FeeParams.ProtoReflect()) + if !f(fd_GenesisState_fee_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 "cheqd.did.v2.GenesisState.did_namespace": + return x.DidNamespace != "" + case "cheqd.did.v2.GenesisState.version_sets": + return len(x.VersionSets) != 0 + case "cheqd.did.v2.GenesisState.fee_params": + return x.FeeParams != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.did.v2.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 "cheqd.did.v2.GenesisState.did_namespace": + x.DidNamespace = "" + case "cheqd.did.v2.GenesisState.version_sets": + x.VersionSets = nil + case "cheqd.did.v2.GenesisState.fee_params": + x.FeeParams = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.did.v2.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 "cheqd.did.v2.GenesisState.did_namespace": + value := x.DidNamespace + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.GenesisState.version_sets": + if len(x.VersionSets) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.VersionSets} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.GenesisState.fee_params": + value := x.FeeParams + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.did.v2.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 "cheqd.did.v2.GenesisState.did_namespace": + x.DidNamespace = value.Interface().(string) + case "cheqd.did.v2.GenesisState.version_sets": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.VersionSets = *clv.list + case "cheqd.did.v2.GenesisState.fee_params": + x.FeeParams = value.Message().Interface().(*FeeParams) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.did.v2.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 "cheqd.did.v2.GenesisState.version_sets": + if x.VersionSets == nil { + x.VersionSets = []*DidDocVersionSet{} + } + value := &_GenesisState_2_list{list: &x.VersionSets} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.GenesisState.fee_params": + if x.FeeParams == nil { + x.FeeParams = new(FeeParams) + } + return protoreflect.ValueOfMessage(x.FeeParams.ProtoReflect()) + case "cheqd.did.v2.GenesisState.did_namespace": + panic(fmt.Errorf("field did_namespace of message cheqd.did.v2.GenesisState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.did.v2.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 "cheqd.did.v2.GenesisState.did_namespace": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.GenesisState.version_sets": + list := []*DidDocVersionSet{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + case "cheqd.did.v2.GenesisState.fee_params": + m := new(FeeParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.did.v2.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 cheqd.did.v2.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 + l = len(x.DidNamespace) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.VersionSets) > 0 { + for _, e := range x.VersionSets { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.FeeParams != nil { + l = options.Size(x.FeeParams) + 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.FeeParams != nil { + encoded, err := options.Marshal(x.FeeParams) + 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.VersionSets) > 0 { + for iNdEx := len(x.VersionSets) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VersionSets[iNdEx]) + 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.DidNamespace) > 0 { + i -= len(x.DidNamespace) + copy(dAtA[i:], x.DidNamespace) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DidNamespace))) + 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 DidNamespace", 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.DidNamespace = 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 VersionSets", 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 + } + x.VersionSets = append(x.VersionSets, &DidDocVersionSet{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VersionSets[len(x.VersionSets)-1]); 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 FeeParams", 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.FeeParams == nil { + x.FeeParams = &FeeParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.FeeParams); 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cheqd/did/v2/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) +) + +// DidDocVersionSet contains all versions of DID Documents and their metadata for a given DID. +// The latest version of the DID Document set is stored in the latest_version field. +type DidDocVersionSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Latest version of the DID Document set + LatestVersion string `protobuf:"bytes,1,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` + // All versions of the DID Document set + DidDocs []*DidDocWithMetadata `protobuf:"bytes,2,rep,name=did_docs,json=didDocs,proto3" json:"did_docs,omitempty"` +} + +func (x *DidDocVersionSet) Reset() { + *x = DidDocVersionSet{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DidDocVersionSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DidDocVersionSet) ProtoMessage() {} + +// Deprecated: Use DidDocVersionSet.ProtoReflect.Descriptor instead. +func (*DidDocVersionSet) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *DidDocVersionSet) GetLatestVersion() string { + if x != nil { + return x.LatestVersion + } + return "" +} + +func (x *DidDocVersionSet) GetDidDocs() []*DidDocWithMetadata { + if x != nil { + return x.DidDocs + } + return nil +} + +// GenesisState defines the cheqd DID module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Namespace for the DID module + // Example: mainnet, testnet, local + DidNamespace string `protobuf:"bytes,1,opt,name=did_namespace,json=didNamespace,proto3" json:"did_namespace,omitempty"` + // All DID Document version sets (contains all versions of all DID Documents) + VersionSets []*DidDocVersionSet `protobuf:"bytes,2,rep,name=version_sets,json=versionSets,proto3" json:"version_sets,omitempty"` + // Fee parameters for the DID module + // Defines fixed fees and burn percentage for each DID operation type (create, update, delete) + FeeParams *FeeParams `protobuf:"bytes,3,opt,name=fee_params,json=feeParams,proto3" json:"fee_params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_genesis_proto_msgTypes[1] + 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_cheqd_did_v2_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *GenesisState) GetDidNamespace() string { + if x != nil { + return x.DidNamespace + } + return "" +} + +func (x *GenesisState) GetVersionSets() []*DidDocVersionSet { + if x != nil { + return x.VersionSets + } + return nil +} + +func (x *GenesisState) GetFeeParams() *FeeParams { + if x != nil { + return x.FeeParams + } + return nil +} + +var File_cheqd_did_v2_genesis_proto protoreflect.FileDescriptor + +var file_cheqd_did_v2_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x67, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x68, + 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x1a, 0x19, 0x63, 0x68, 0x65, 0x71, + 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x64, 0x69, 0x64, 0x64, 0x6f, 0x63, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, + 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, 0x0a, + 0x10, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x08, 0x64, 0x69, 0x64, 0x5f, + 0x64, 0x6f, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, + 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x64, 0x69, + 0x64, 0x44, 0x6f, 0x63, 0x73, 0x22, 0xae, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x64, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, + 0x69, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, + 0x2e, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x74, 0x52, 0x0b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x73, 0x12, 0x36, + 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x32, 0x2e, 0x46, 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x09, 0x66, 0x65, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xa6, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x47, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, + 0x65, 0x71, 0x64, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x32, 0xa2, + 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x0c, 0x43, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x44, 0x69, + 0x64, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x44, 0x69, 0x64, + 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0e, 0x43, 0x68, 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x32, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_did_v2_genesis_proto_rawDescOnce sync.Once + file_cheqd_did_v2_genesis_proto_rawDescData = file_cheqd_did_v2_genesis_proto_rawDesc +) + +func file_cheqd_did_v2_genesis_proto_rawDescGZIP() []byte { + file_cheqd_did_v2_genesis_proto_rawDescOnce.Do(func() { + file_cheqd_did_v2_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_did_v2_genesis_proto_rawDescData) + }) + return file_cheqd_did_v2_genesis_proto_rawDescData +} + +var file_cheqd_did_v2_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cheqd_did_v2_genesis_proto_goTypes = []interface{}{ + (*DidDocVersionSet)(nil), // 0: cheqd.did.v2.DidDocVersionSet + (*GenesisState)(nil), // 1: cheqd.did.v2.GenesisState + (*DidDocWithMetadata)(nil), // 2: cheqd.did.v2.DidDocWithMetadata + (*FeeParams)(nil), // 3: cheqd.did.v2.FeeParams +} +var file_cheqd_did_v2_genesis_proto_depIdxs = []int32{ + 2, // 0: cheqd.did.v2.DidDocVersionSet.did_docs:type_name -> cheqd.did.v2.DidDocWithMetadata + 0, // 1: cheqd.did.v2.GenesisState.version_sets:type_name -> cheqd.did.v2.DidDocVersionSet + 3, // 2: cheqd.did.v2.GenesisState.fee_params:type_name -> cheqd.did.v2.FeeParams + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_cheqd_did_v2_genesis_proto_init() } +func file_cheqd_did_v2_genesis_proto_init() { + if File_cheqd_did_v2_genesis_proto != nil { + return + } + file_cheqd_did_v2_diddoc_proto_init() + file_cheqd_did_v2_fee_proto_init() + if !protoimpl.UnsafeEnabled { + file_cheqd_did_v2_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DidDocVersionSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_genesis_proto_msgTypes[1].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 + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cheqd_did_v2_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cheqd_did_v2_genesis_proto_goTypes, + DependencyIndexes: file_cheqd_did_v2_genesis_proto_depIdxs, + MessageInfos: file_cheqd_did_v2_genesis_proto_msgTypes, + }.Build() + File_cheqd_did_v2_genesis_proto = out.File + file_cheqd_did_v2_genesis_proto_rawDesc = nil + file_cheqd_did_v2_genesis_proto_goTypes = nil + file_cheqd_did_v2_genesis_proto_depIdxs = nil +} diff --git a/api/cheqd/did/v2/query.pulsar.go b/api/cheqd/did/v2/query.pulsar.go new file mode 100644 index 000000000..d46828fcd --- /dev/null +++ b/api/cheqd/did/v2/query.pulsar.go @@ -0,0 +1,3385 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package didv2 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/query/v1beta1" + _ "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_QueryDidDocRequest protoreflect.MessageDescriptor + fd_QueryDidDocRequest_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_query_proto_init() + md_QueryDidDocRequest = File_cheqd_did_v2_query_proto.Messages().ByName("QueryDidDocRequest") + fd_QueryDidDocRequest_id = md_QueryDidDocRequest.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_QueryDidDocRequest)(nil) + +type fastReflection_QueryDidDocRequest QueryDidDocRequest + +func (x *QueryDidDocRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDidDocRequest)(x) +} + +func (x *QueryDidDocRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_QueryDidDocRequest_messageType fastReflection_QueryDidDocRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDidDocRequest_messageType{} + +type fastReflection_QueryDidDocRequest_messageType struct{} + +func (x fastReflection_QueryDidDocRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDidDocRequest)(nil) +} +func (x fastReflection_QueryDidDocRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDidDocRequest) +} +func (x fastReflection_QueryDidDocRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDidDocRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDidDocRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDidDocRequest +} + +// 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_QueryDidDocRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDidDocRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDidDocRequest) New() protoreflect.Message { + return new(fastReflection_QueryDidDocRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDidDocRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDidDocRequest)(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_QueryDidDocRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_QueryDidDocRequest_id, 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_QueryDidDocRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocRequest.id": + return x.Id != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocRequest 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_QueryDidDocRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocRequest.id": + x.Id = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocRequest 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_QueryDidDocRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.QueryDidDocRequest.id": + value := x.Id + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocRequest 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_QueryDidDocRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocRequest.id": + x.Id = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocRequest 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_QueryDidDocRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocRequest.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.QueryDidDocRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocRequest 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_QueryDidDocRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocRequest.id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocRequest 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_QueryDidDocRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.QueryDidDocRequest", 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_QueryDidDocRequest) 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_QueryDidDocRequest) 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_QueryDidDocRequest) 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_QueryDidDocRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDidDocRequest) + 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.Id) + 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().(*QueryDidDocRequest) + 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.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + 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().(*QueryDidDocRequest) + 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: QueryDidDocRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDidDocRequest: 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 Id", 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.Id = 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_QueryDidDocResponse protoreflect.MessageDescriptor + fd_QueryDidDocResponse_value protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_query_proto_init() + md_QueryDidDocResponse = File_cheqd_did_v2_query_proto.Messages().ByName("QueryDidDocResponse") + fd_QueryDidDocResponse_value = md_QueryDidDocResponse.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_QueryDidDocResponse)(nil) + +type fastReflection_QueryDidDocResponse QueryDidDocResponse + +func (x *QueryDidDocResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDidDocResponse)(x) +} + +func (x *QueryDidDocResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_QueryDidDocResponse_messageType fastReflection_QueryDidDocResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDidDocResponse_messageType{} + +type fastReflection_QueryDidDocResponse_messageType struct{} + +func (x fastReflection_QueryDidDocResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDidDocResponse)(nil) +} +func (x fastReflection_QueryDidDocResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDidDocResponse) +} +func (x fastReflection_QueryDidDocResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDidDocResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDidDocResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDidDocResponse +} + +// 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_QueryDidDocResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDidDocResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDidDocResponse) New() protoreflect.Message { + return new(fastReflection_QueryDidDocResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDidDocResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDidDocResponse)(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_QueryDidDocResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Value != nil { + value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + if !f(fd_QueryDidDocResponse_value, 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_QueryDidDocResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocResponse.value": + return x.Value != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocResponse 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_QueryDidDocResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocResponse.value": + x.Value = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocResponse 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_QueryDidDocResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.QueryDidDocResponse.value": + value := x.Value + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocResponse 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_QueryDidDocResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocResponse.value": + x.Value = value.Message().Interface().(*DidDocWithMetadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocResponse 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_QueryDidDocResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocResponse.value": + if x.Value == nil { + x.Value = new(DidDocWithMetadata) + } + return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocResponse 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_QueryDidDocResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocResponse.value": + m := new(DidDocWithMetadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocResponse 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_QueryDidDocResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.QueryDidDocResponse", 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_QueryDidDocResponse) 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_QueryDidDocResponse) 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_QueryDidDocResponse) 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_QueryDidDocResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDidDocResponse) + 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.Value != nil { + l = options.Size(x.Value) + 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().(*QueryDidDocResponse) + 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.Value != nil { + encoded, err := options.Marshal(x.Value) + 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().(*QueryDidDocResponse) + 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: QueryDidDocResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDidDocResponse: 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 Value", 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.Value == nil { + x.Value = &DidDocWithMetadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); 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_QueryDidDocVersionRequest protoreflect.MessageDescriptor + fd_QueryDidDocVersionRequest_id protoreflect.FieldDescriptor + fd_QueryDidDocVersionRequest_version protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_query_proto_init() + md_QueryDidDocVersionRequest = File_cheqd_did_v2_query_proto.Messages().ByName("QueryDidDocVersionRequest") + fd_QueryDidDocVersionRequest_id = md_QueryDidDocVersionRequest.Fields().ByName("id") + fd_QueryDidDocVersionRequest_version = md_QueryDidDocVersionRequest.Fields().ByName("version") +} + +var _ protoreflect.Message = (*fastReflection_QueryDidDocVersionRequest)(nil) + +type fastReflection_QueryDidDocVersionRequest QueryDidDocVersionRequest + +func (x *QueryDidDocVersionRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDidDocVersionRequest)(x) +} + +func (x *QueryDidDocVersionRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_QueryDidDocVersionRequest_messageType fastReflection_QueryDidDocVersionRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDidDocVersionRequest_messageType{} + +type fastReflection_QueryDidDocVersionRequest_messageType struct{} + +func (x fastReflection_QueryDidDocVersionRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDidDocVersionRequest)(nil) +} +func (x fastReflection_QueryDidDocVersionRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDidDocVersionRequest) +} +func (x fastReflection_QueryDidDocVersionRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDidDocVersionRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDidDocVersionRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDidDocVersionRequest +} + +// 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_QueryDidDocVersionRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDidDocVersionRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDidDocVersionRequest) New() protoreflect.Message { + return new(fastReflection_QueryDidDocVersionRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDidDocVersionRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDidDocVersionRequest)(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_QueryDidDocVersionRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_QueryDidDocVersionRequest_id, value) { + return + } + } + if x.Version != "" { + value := protoreflect.ValueOfString(x.Version) + if !f(fd_QueryDidDocVersionRequest_version, 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_QueryDidDocVersionRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionRequest.id": + return x.Id != "" + case "cheqd.did.v2.QueryDidDocVersionRequest.version": + return x.Version != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionRequest 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_QueryDidDocVersionRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionRequest.id": + x.Id = "" + case "cheqd.did.v2.QueryDidDocVersionRequest.version": + x.Version = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionRequest 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_QueryDidDocVersionRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.QueryDidDocVersionRequest.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.QueryDidDocVersionRequest.version": + value := x.Version + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionRequest 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_QueryDidDocVersionRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionRequest.id": + x.Id = value.Interface().(string) + case "cheqd.did.v2.QueryDidDocVersionRequest.version": + x.Version = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionRequest 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_QueryDidDocVersionRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionRequest.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.QueryDidDocVersionRequest is not mutable")) + case "cheqd.did.v2.QueryDidDocVersionRequest.version": + panic(fmt.Errorf("field version of message cheqd.did.v2.QueryDidDocVersionRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionRequest 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_QueryDidDocVersionRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionRequest.id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.QueryDidDocVersionRequest.version": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionRequest 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_QueryDidDocVersionRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.QueryDidDocVersionRequest", 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_QueryDidDocVersionRequest) 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_QueryDidDocVersionRequest) 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_QueryDidDocVersionRequest) 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_QueryDidDocVersionRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDidDocVersionRequest) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Version) + 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().(*QueryDidDocVersionRequest) + 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.Version) > 0 { + i -= len(x.Version) + copy(dAtA[i:], x.Version) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Version))) + 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))) + 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().(*QueryDidDocVersionRequest) + 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: QueryDidDocVersionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDidDocVersionRequest: 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 Id", 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.Id = 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 Version", 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.Version = 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_QueryDidDocVersionResponse protoreflect.MessageDescriptor + fd_QueryDidDocVersionResponse_value protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_query_proto_init() + md_QueryDidDocVersionResponse = File_cheqd_did_v2_query_proto.Messages().ByName("QueryDidDocVersionResponse") + fd_QueryDidDocVersionResponse_value = md_QueryDidDocVersionResponse.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_QueryDidDocVersionResponse)(nil) + +type fastReflection_QueryDidDocVersionResponse QueryDidDocVersionResponse + +func (x *QueryDidDocVersionResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDidDocVersionResponse)(x) +} + +func (x *QueryDidDocVersionResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_QueryDidDocVersionResponse_messageType fastReflection_QueryDidDocVersionResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDidDocVersionResponse_messageType{} + +type fastReflection_QueryDidDocVersionResponse_messageType struct{} + +func (x fastReflection_QueryDidDocVersionResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDidDocVersionResponse)(nil) +} +func (x fastReflection_QueryDidDocVersionResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDidDocVersionResponse) +} +func (x fastReflection_QueryDidDocVersionResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDidDocVersionResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDidDocVersionResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDidDocVersionResponse +} + +// 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_QueryDidDocVersionResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDidDocVersionResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDidDocVersionResponse) New() protoreflect.Message { + return new(fastReflection_QueryDidDocVersionResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDidDocVersionResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDidDocVersionResponse)(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_QueryDidDocVersionResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Value != nil { + value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + if !f(fd_QueryDidDocVersionResponse_value, 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_QueryDidDocVersionResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionResponse.value": + return x.Value != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionResponse 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_QueryDidDocVersionResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionResponse.value": + x.Value = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionResponse 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_QueryDidDocVersionResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.QueryDidDocVersionResponse.value": + value := x.Value + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionResponse 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_QueryDidDocVersionResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionResponse.value": + x.Value = value.Message().Interface().(*DidDocWithMetadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionResponse 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_QueryDidDocVersionResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionResponse.value": + if x.Value == nil { + x.Value = new(DidDocWithMetadata) + } + return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionResponse 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_QueryDidDocVersionResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryDidDocVersionResponse.value": + m := new(DidDocWithMetadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryDidDocVersionResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryDidDocVersionResponse 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_QueryDidDocVersionResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.QueryDidDocVersionResponse", 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_QueryDidDocVersionResponse) 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_QueryDidDocVersionResponse) 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_QueryDidDocVersionResponse) 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_QueryDidDocVersionResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDidDocVersionResponse) + 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.Value != nil { + l = options.Size(x.Value) + 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().(*QueryDidDocVersionResponse) + 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.Value != nil { + encoded, err := options.Marshal(x.Value) + 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().(*QueryDidDocVersionResponse) + 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: QueryDidDocVersionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDidDocVersionResponse: 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 Value", 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.Value == nil { + x.Value = &DidDocWithMetadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); 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_QueryAllDidDocVersionsMetadataRequest protoreflect.MessageDescriptor + fd_QueryAllDidDocVersionsMetadataRequest_id protoreflect.FieldDescriptor + fd_QueryAllDidDocVersionsMetadataRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_query_proto_init() + md_QueryAllDidDocVersionsMetadataRequest = File_cheqd_did_v2_query_proto.Messages().ByName("QueryAllDidDocVersionsMetadataRequest") + fd_QueryAllDidDocVersionsMetadataRequest_id = md_QueryAllDidDocVersionsMetadataRequest.Fields().ByName("id") + fd_QueryAllDidDocVersionsMetadataRequest_pagination = md_QueryAllDidDocVersionsMetadataRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllDidDocVersionsMetadataRequest)(nil) + +type fastReflection_QueryAllDidDocVersionsMetadataRequest QueryAllDidDocVersionsMetadataRequest + +func (x *QueryAllDidDocVersionsMetadataRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllDidDocVersionsMetadataRequest)(x) +} + +func (x *QueryAllDidDocVersionsMetadataRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_QueryAllDidDocVersionsMetadataRequest_messageType fastReflection_QueryAllDidDocVersionsMetadataRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllDidDocVersionsMetadataRequest_messageType{} + +type fastReflection_QueryAllDidDocVersionsMetadataRequest_messageType struct{} + +func (x fastReflection_QueryAllDidDocVersionsMetadataRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllDidDocVersionsMetadataRequest)(nil) +} +func (x fastReflection_QueryAllDidDocVersionsMetadataRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllDidDocVersionsMetadataRequest) +} +func (x fastReflection_QueryAllDidDocVersionsMetadataRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllDidDocVersionsMetadataRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllDidDocVersionsMetadataRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllDidDocVersionsMetadataRequest +} + +// 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_QueryAllDidDocVersionsMetadataRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllDidDocVersionsMetadataRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllDidDocVersionsMetadataRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllDidDocVersionsMetadataRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllDidDocVersionsMetadataRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllDidDocVersionsMetadataRequest)(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_QueryAllDidDocVersionsMetadataRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_QueryAllDidDocVersionsMetadataRequest_id, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllDidDocVersionsMetadataRequest_pagination, 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_QueryAllDidDocVersionsMetadataRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.id": + return x.Id != "" + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest 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_QueryAllDidDocVersionsMetadataRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.id": + x.Id = "" + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest 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_QueryAllDidDocVersionsMetadataRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest 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_QueryAllDidDocVersionsMetadataRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.id": + x.Id = value.Interface().(string) + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest 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_QueryAllDidDocVersionsMetadataRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest 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_QueryAllDidDocVersionsMetadataRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest 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_QueryAllDidDocVersionsMetadataRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest", 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_QueryAllDidDocVersionsMetadataRequest) 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_QueryAllDidDocVersionsMetadataRequest) 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_QueryAllDidDocVersionsMetadataRequest) 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_QueryAllDidDocVersionsMetadataRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllDidDocVersionsMetadataRequest) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + 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().(*QueryAllDidDocVersionsMetadataRequest) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + 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.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + 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().(*QueryAllDidDocVersionsMetadataRequest) + 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: QueryAllDidDocVersionsMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllDidDocVersionsMetadataRequest: 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 Id", 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.Id = 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 Pagination", 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.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); 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 _ protoreflect.List = (*_QueryAllDidDocVersionsMetadataResponse_1_list)(nil) + +type _QueryAllDidDocVersionsMetadataResponse_1_list struct { + list *[]*Metadata +} + +func (x *_QueryAllDidDocVersionsMetadataResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllDidDocVersionsMetadataResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllDidDocVersionsMetadataResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Metadata) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllDidDocVersionsMetadataResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Metadata) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllDidDocVersionsMetadataResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Metadata) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllDidDocVersionsMetadataResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllDidDocVersionsMetadataResponse_1_list) NewElement() protoreflect.Value { + v := new(Metadata) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllDidDocVersionsMetadataResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllDidDocVersionsMetadataResponse protoreflect.MessageDescriptor + fd_QueryAllDidDocVersionsMetadataResponse_versions protoreflect.FieldDescriptor + fd_QueryAllDidDocVersionsMetadataResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_query_proto_init() + md_QueryAllDidDocVersionsMetadataResponse = File_cheqd_did_v2_query_proto.Messages().ByName("QueryAllDidDocVersionsMetadataResponse") + fd_QueryAllDidDocVersionsMetadataResponse_versions = md_QueryAllDidDocVersionsMetadataResponse.Fields().ByName("versions") + fd_QueryAllDidDocVersionsMetadataResponse_pagination = md_QueryAllDidDocVersionsMetadataResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllDidDocVersionsMetadataResponse)(nil) + +type fastReflection_QueryAllDidDocVersionsMetadataResponse QueryAllDidDocVersionsMetadataResponse + +func (x *QueryAllDidDocVersionsMetadataResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllDidDocVersionsMetadataResponse)(x) +} + +func (x *QueryAllDidDocVersionsMetadataResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_QueryAllDidDocVersionsMetadataResponse_messageType fastReflection_QueryAllDidDocVersionsMetadataResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllDidDocVersionsMetadataResponse_messageType{} + +type fastReflection_QueryAllDidDocVersionsMetadataResponse_messageType struct{} + +func (x fastReflection_QueryAllDidDocVersionsMetadataResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllDidDocVersionsMetadataResponse)(nil) +} +func (x fastReflection_QueryAllDidDocVersionsMetadataResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllDidDocVersionsMetadataResponse) +} +func (x fastReflection_QueryAllDidDocVersionsMetadataResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllDidDocVersionsMetadataResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllDidDocVersionsMetadataResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllDidDocVersionsMetadataResponse +} + +// 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_QueryAllDidDocVersionsMetadataResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllDidDocVersionsMetadataResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllDidDocVersionsMetadataResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllDidDocVersionsMetadataResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllDidDocVersionsMetadataResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllDidDocVersionsMetadataResponse)(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_QueryAllDidDocVersionsMetadataResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Versions) != 0 { + value := protoreflect.ValueOfList(&_QueryAllDidDocVersionsMetadataResponse_1_list{list: &x.Versions}) + if !f(fd_QueryAllDidDocVersionsMetadataResponse_versions, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllDidDocVersionsMetadataResponse_pagination, 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_QueryAllDidDocVersionsMetadataResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.versions": + return len(x.Versions) != 0 + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse 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_QueryAllDidDocVersionsMetadataResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.versions": + x.Versions = nil + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse 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_QueryAllDidDocVersionsMetadataResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.versions": + if len(x.Versions) == 0 { + return protoreflect.ValueOfList(&_QueryAllDidDocVersionsMetadataResponse_1_list{}) + } + listValue := &_QueryAllDidDocVersionsMetadataResponse_1_list{list: &x.Versions} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse 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_QueryAllDidDocVersionsMetadataResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.versions": + lv := value.List() + clv := lv.(*_QueryAllDidDocVersionsMetadataResponse_1_list) + x.Versions = *clv.list + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse 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_QueryAllDidDocVersionsMetadataResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.versions": + if x.Versions == nil { + x.Versions = []*Metadata{} + } + value := &_QueryAllDidDocVersionsMetadataResponse_1_list{list: &x.Versions} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse 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_QueryAllDidDocVersionsMetadataResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.versions": + list := []*Metadata{} + return protoreflect.ValueOfList(&_QueryAllDidDocVersionsMetadataResponse_1_list{list: &list}) + case "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse 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_QueryAllDidDocVersionsMetadataResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse", 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_QueryAllDidDocVersionsMetadataResponse) 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_QueryAllDidDocVersionsMetadataResponse) 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_QueryAllDidDocVersionsMetadataResponse) 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_QueryAllDidDocVersionsMetadataResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllDidDocVersionsMetadataResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Versions) > 0 { + for _, e := range x.Versions { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + 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().(*QueryAllDidDocVersionsMetadataResponse) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + 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.Versions) > 0 { + for iNdEx := len(x.Versions) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Versions[iNdEx]) + 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().(*QueryAllDidDocVersionsMetadataResponse) + 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: QueryAllDidDocVersionsMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllDidDocVersionsMetadataResponse: 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 Versions", 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 + } + x.Versions = append(x.Versions, &Metadata{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Versions[len(x.Versions)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cheqd/did/v2/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) +) + +// QueryDidDocRequest is the request type for the Query/DidDoc method +type QueryDidDocRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DID unique identifier of the DID Document to fetch. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryDidDocRequest) Reset() { + *x = QueryDidDocRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDidDocRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDidDocRequest) ProtoMessage() {} + +// Deprecated: Use QueryDidDocRequest.ProtoReflect.Descriptor instead. +func (*QueryDidDocRequest) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_query_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryDidDocRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +// QueryDidDocResponse is the response type for the Query/DidDoc method +type QueryDidDocResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Successful resolution of the DID Document returns the following: + // - did_doc is the latest version of the DID Document + // - metadata is is the DID Document metadata associated with the latest version of the DID Document + Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *QueryDidDocResponse) Reset() { + *x = QueryDidDocResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDidDocResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDidDocResponse) ProtoMessage() {} + +// Deprecated: Use QueryDidDocResponse.ProtoReflect.Descriptor instead. +func (*QueryDidDocResponse) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryDidDocResponse) GetValue() *DidDocWithMetadata { + if x != nil { + return x.Value + } + return nil +} + +// QueryDidDocVersionRequest is the request type for the Query/DidDocVersion method +type QueryDidDocVersionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DID unique identifier of the DID Document to fetch. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique version identifier of the DID Document to fetch. + // Returns the specified version of the DID Document. + // + // Format: + // + // Example: 93f2573c-eca9-4098-96cb-a1ec676a29ed + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *QueryDidDocVersionRequest) Reset() { + *x = QueryDidDocVersionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDidDocVersionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDidDocVersionRequest) ProtoMessage() {} + +// Deprecated: Use QueryDidDocVersionRequest.ProtoReflect.Descriptor instead. +func (*QueryDidDocVersionRequest) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryDidDocVersionRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *QueryDidDocVersionRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +// QueryDidDocVersionResponse is the response type for the Query/DidDocVersion method +type QueryDidDocVersionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Successful resolution of the DID Document returns the following: + // - did_doc is the requested version of the DID Document + // - metadata is DID Document metadata associated with the requested version of the DID Document + Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *QueryDidDocVersionResponse) Reset() { + *x = QueryDidDocVersionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDidDocVersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDidDocVersionResponse) ProtoMessage() {} + +// Deprecated: Use QueryDidDocVersionResponse.ProtoReflect.Descriptor instead. +func (*QueryDidDocVersionResponse) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryDidDocVersionResponse) GetValue() *DidDocWithMetadata { + if x != nil { + return x.Value + } + return nil +} + +// QueryAllDidDocVersionsMetadataRequest is the request type for the Query/AllDidDocVersionsMetadata method +type QueryAllDidDocVersionsMetadataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DID unique identifier of the DID Document to fetch version metadata. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllDidDocVersionsMetadataRequest) Reset() { + *x = QueryAllDidDocVersionsMetadataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllDidDocVersionsMetadataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllDidDocVersionsMetadataRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllDidDocVersionsMetadataRequest.ProtoReflect.Descriptor instead. +func (*QueryAllDidDocVersionsMetadataRequest) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryAllDidDocVersionsMetadataRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *QueryAllDidDocVersionsMetadataRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryAllDidDocVersionsMetadataResponse is the response type for the Query/AllDidDocVersionsMetadata method +type QueryAllDidDocVersionsMetadataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // versions is the list of all versions of the requested DID Document + Versions []*Metadata `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllDidDocVersionsMetadataResponse) Reset() { + *x = QueryAllDidDocVersionsMetadataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllDidDocVersionsMetadataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllDidDocVersionsMetadataResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllDidDocVersionsMetadataResponse.ProtoReflect.Descriptor instead. +func (*QueryAllDidDocVersionsMetadataResponse) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryAllDidDocVersionsMetadataResponse) GetVersions() []*Metadata { + if x != nil { + return x.Versions + } + return nil +} + +func (x *QueryAllDidDocVersionsMetadataResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +var File_cheqd_did_v2_query_proto protoreflect.FileDescriptor + +var file_cheqd_did_v2_query_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x68, 0x65, 0x71, + 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x1a, 0x19, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, + 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x64, 0x69, 0x64, 0x64, 0x6f, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, + 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x22, 0x24, 0x0a, + 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x4d, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x69, 0x64, 0x44, + 0x6f, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x65, 0x71, + 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x57, + 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x45, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x69, 0x64, 0x44, 0x6f, + 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x1a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x57, 0x69, 0x74, 0x68, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x7f, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x64, 0x44, 0x6f, + 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0xa5, 0x01, 0x0a, 0x26, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x64, + 0x44, 0x6f, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xb3, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x69, 0x0a, 0x06, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x12, 0x20, 0x2e, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x63, 0x68, 0x65, 0x71, + 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x90, 0x01, + 0x0a, 0x0d, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x27, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x69, 0x64, + 0x44, 0x6f, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d, + 0x12, 0xab, 0x01, 0x0a, 0x19, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x33, + 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x64, 0x44, 0x6f, + 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xa4, + 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x32, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, + 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x3b, + 0x64, 0x69, 0x64, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x0c, 0x43, 0x68, + 0x65, 0x71, 0x64, 0x2e, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x43, 0x68, 0x65, + 0x71, 0x64, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x43, 0x68, 0x65, 0x71, + 0x64, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x43, 0x68, 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x44, 0x69, + 0x64, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_did_v2_query_proto_rawDescOnce sync.Once + file_cheqd_did_v2_query_proto_rawDescData = file_cheqd_did_v2_query_proto_rawDesc +) + +func file_cheqd_did_v2_query_proto_rawDescGZIP() []byte { + file_cheqd_did_v2_query_proto_rawDescOnce.Do(func() { + file_cheqd_did_v2_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_did_v2_query_proto_rawDescData) + }) + return file_cheqd_did_v2_query_proto_rawDescData +} + +var file_cheqd_did_v2_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cheqd_did_v2_query_proto_goTypes = []interface{}{ + (*QueryDidDocRequest)(nil), // 0: cheqd.did.v2.QueryDidDocRequest + (*QueryDidDocResponse)(nil), // 1: cheqd.did.v2.QueryDidDocResponse + (*QueryDidDocVersionRequest)(nil), // 2: cheqd.did.v2.QueryDidDocVersionRequest + (*QueryDidDocVersionResponse)(nil), // 3: cheqd.did.v2.QueryDidDocVersionResponse + (*QueryAllDidDocVersionsMetadataRequest)(nil), // 4: cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest + (*QueryAllDidDocVersionsMetadataResponse)(nil), // 5: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse + (*DidDocWithMetadata)(nil), // 6: cheqd.did.v2.DidDocWithMetadata + (*v1beta1.PageRequest)(nil), // 7: cosmos.base.query.v1beta1.PageRequest + (*Metadata)(nil), // 8: cheqd.did.v2.Metadata + (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse +} +var file_cheqd_did_v2_query_proto_depIdxs = []int32{ + 6, // 0: cheqd.did.v2.QueryDidDocResponse.value:type_name -> cheqd.did.v2.DidDocWithMetadata + 6, // 1: cheqd.did.v2.QueryDidDocVersionResponse.value:type_name -> cheqd.did.v2.DidDocWithMetadata + 7, // 2: cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 8, // 3: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.versions:type_name -> cheqd.did.v2.Metadata + 9, // 4: cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 5: cheqd.did.v2.Query.DidDoc:input_type -> cheqd.did.v2.QueryDidDocRequest + 2, // 6: cheqd.did.v2.Query.DidDocVersion:input_type -> cheqd.did.v2.QueryDidDocVersionRequest + 4, // 7: cheqd.did.v2.Query.AllDidDocVersionsMetadata:input_type -> cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest + 1, // 8: cheqd.did.v2.Query.DidDoc:output_type -> cheqd.did.v2.QueryDidDocResponse + 3, // 9: cheqd.did.v2.Query.DidDocVersion:output_type -> cheqd.did.v2.QueryDidDocVersionResponse + 5, // 10: cheqd.did.v2.Query.AllDidDocVersionsMetadata:output_type -> cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] 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_cheqd_did_v2_query_proto_init() } +func file_cheqd_did_v2_query_proto_init() { + if File_cheqd_did_v2_query_proto != nil { + return + } + file_cheqd_did_v2_diddoc_proto_init() + if !protoimpl.UnsafeEnabled { + file_cheqd_did_v2_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDidDocRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDidDocResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDidDocVersionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDidDocVersionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllDidDocVersionsMetadataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllDidDocVersionsMetadataResponse); 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_cheqd_did_v2_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cheqd_did_v2_query_proto_goTypes, + DependencyIndexes: file_cheqd_did_v2_query_proto_depIdxs, + MessageInfos: file_cheqd_did_v2_query_proto_msgTypes, + }.Build() + File_cheqd_did_v2_query_proto = out.File + file_cheqd_did_v2_query_proto_rawDesc = nil + file_cheqd_did_v2_query_proto_goTypes = nil + file_cheqd_did_v2_query_proto_depIdxs = nil +} diff --git a/api/cheqd/did/v2/query_grpc.pb.go b/api/cheqd/did/v2/query_grpc.pb.go new file mode 100644 index 000000000..6fe59f328 --- /dev/null +++ b/api/cheqd/did/v2/query_grpc.pb.go @@ -0,0 +1,183 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: cheqd/did/v2/query.proto + +package didv2 + +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 + +// 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 { + // Fetch latest version of a DID Document for a given DID + DidDoc(ctx context.Context, in *QueryDidDocRequest, opts ...grpc.CallOption) (*QueryDidDocResponse, error) + // Fetch specific version of a DID Document for a given DID + DidDocVersion(ctx context.Context, in *QueryDidDocVersionRequest, opts ...grpc.CallOption) (*QueryDidDocVersionResponse, error) + // Fetch list of all versions of DID Documents for a given DID + AllDidDocVersionsMetadata(ctx context.Context, in *QueryAllDidDocVersionsMetadataRequest, opts ...grpc.CallOption) (*QueryAllDidDocVersionsMetadataResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) DidDoc(ctx context.Context, in *QueryDidDocRequest, opts ...grpc.CallOption) (*QueryDidDocResponse, error) { + out := new(QueryDidDocResponse) + err := c.cc.Invoke(ctx, "/cheqd.did.v2.Query/DidDoc", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DidDocVersion(ctx context.Context, in *QueryDidDocVersionRequest, opts ...grpc.CallOption) (*QueryDidDocVersionResponse, error) { + out := new(QueryDidDocVersionResponse) + err := c.cc.Invoke(ctx, "/cheqd.did.v2.Query/DidDocVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllDidDocVersionsMetadata(ctx context.Context, in *QueryAllDidDocVersionsMetadataRequest, opts ...grpc.CallOption) (*QueryAllDidDocVersionsMetadataResponse, error) { + out := new(QueryAllDidDocVersionsMetadataResponse) + err := c.cc.Invoke(ctx, "/cheqd.did.v2.Query/AllDidDocVersionsMetadata", 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 { + // Fetch latest version of a DID Document for a given DID + DidDoc(context.Context, *QueryDidDocRequest) (*QueryDidDocResponse, error) + // Fetch specific version of a DID Document for a given DID + DidDocVersion(context.Context, *QueryDidDocVersionRequest) (*QueryDidDocVersionResponse, error) + // Fetch list of all versions of DID Documents for a given DID + AllDidDocVersionsMetadata(context.Context, *QueryAllDidDocVersionsMetadataRequest) (*QueryAllDidDocVersionsMetadataResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) DidDoc(context.Context, *QueryDidDocRequest) (*QueryDidDocResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DidDoc not implemented") +} +func (UnimplementedQueryServer) DidDocVersion(context.Context, *QueryDidDocVersionRequest) (*QueryDidDocVersionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DidDocVersion not implemented") +} +func (UnimplementedQueryServer) AllDidDocVersionsMetadata(context.Context, *QueryAllDidDocVersionsMetadataRequest) (*QueryAllDidDocVersionsMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllDidDocVersionsMetadata 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_DidDoc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDidDocRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DidDoc(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.did.v2.Query/DidDoc", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DidDoc(ctx, req.(*QueryDidDocRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_DidDocVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDidDocVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DidDocVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.did.v2.Query/DidDocVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DidDocVersion(ctx, req.(*QueryDidDocVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllDidDocVersionsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllDidDocVersionsMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllDidDocVersionsMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.did.v2.Query/AllDidDocVersionsMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllDidDocVersionsMetadata(ctx, req.(*QueryAllDidDocVersionsMetadataRequest)) + } + 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: "cheqd.did.v2.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DidDoc", + Handler: _Query_DidDoc_Handler, + }, + { + MethodName: "DidDocVersion", + Handler: _Query_DidDocVersion_Handler, + }, + { + MethodName: "AllDidDocVersionsMetadata", + Handler: _Query_AllDidDocVersionsMetadata_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cheqd/did/v2/query.proto", +} diff --git a/api/cheqd/did/v2/tx.pulsar.go b/api/cheqd/did/v2/tx.pulsar.go new file mode 100644 index 000000000..23109911c --- /dev/null +++ b/api/cheqd/did/v2/tx.pulsar.go @@ -0,0 +1,8547 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package didv2 + +import ( + 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 _ protoreflect.List = (*_MsgCreateDidDoc_2_list)(nil) + +type _MsgCreateDidDoc_2_list struct { + list *[]*SignInfo +} + +func (x *_MsgCreateDidDoc_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDoc_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateDidDoc_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SignInfo) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDoc_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SignInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDoc_2_list) AppendMutable() protoreflect.Value { + v := new(SignInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateDidDoc_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDoc_2_list) NewElement() protoreflect.Value { + v := new(SignInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateDidDoc_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgCreateDidDoc protoreflect.MessageDescriptor + fd_MsgCreateDidDoc_payload protoreflect.FieldDescriptor + fd_MsgCreateDidDoc_signatures protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgCreateDidDoc = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgCreateDidDoc") + fd_MsgCreateDidDoc_payload = md_MsgCreateDidDoc.Fields().ByName("payload") + fd_MsgCreateDidDoc_signatures = md_MsgCreateDidDoc.Fields().ByName("signatures") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateDidDoc)(nil) + +type fastReflection_MsgCreateDidDoc MsgCreateDidDoc + +func (x *MsgCreateDidDoc) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateDidDoc)(x) +} + +func (x *MsgCreateDidDoc) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_MsgCreateDidDoc_messageType fastReflection_MsgCreateDidDoc_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateDidDoc_messageType{} + +type fastReflection_MsgCreateDidDoc_messageType struct{} + +func (x fastReflection_MsgCreateDidDoc_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateDidDoc)(nil) +} +func (x fastReflection_MsgCreateDidDoc_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateDidDoc) +} +func (x fastReflection_MsgCreateDidDoc_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDidDoc +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateDidDoc) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDidDoc +} + +// 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_MsgCreateDidDoc) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateDidDoc_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateDidDoc) New() protoreflect.Message { + return new(fastReflection_MsgCreateDidDoc) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateDidDoc) Interface() protoreflect.ProtoMessage { + return (*MsgCreateDidDoc)(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_MsgCreateDidDoc) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Payload != nil { + value := protoreflect.ValueOfMessage(x.Payload.ProtoReflect()) + if !f(fd_MsgCreateDidDoc_payload, value) { + return + } + } + if len(x.Signatures) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDoc_2_list{list: &x.Signatures}) + if !f(fd_MsgCreateDidDoc_signatures, 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_MsgCreateDidDoc) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDoc.payload": + return x.Payload != nil + case "cheqd.did.v2.MsgCreateDidDoc.signatures": + return len(x.Signatures) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDoc 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_MsgCreateDidDoc) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDoc.payload": + x.Payload = nil + case "cheqd.did.v2.MsgCreateDidDoc.signatures": + x.Signatures = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDoc 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_MsgCreateDidDoc) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgCreateDidDoc.payload": + value := x.Payload + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.MsgCreateDidDoc.signatures": + if len(x.Signatures) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDoc_2_list{}) + } + listValue := &_MsgCreateDidDoc_2_list{list: &x.Signatures} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDoc 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_MsgCreateDidDoc) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDoc.payload": + x.Payload = value.Message().Interface().(*MsgCreateDidDocPayload) + case "cheqd.did.v2.MsgCreateDidDoc.signatures": + lv := value.List() + clv := lv.(*_MsgCreateDidDoc_2_list) + x.Signatures = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDoc 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_MsgCreateDidDoc) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDoc.payload": + if x.Payload == nil { + x.Payload = new(MsgCreateDidDocPayload) + } + return protoreflect.ValueOfMessage(x.Payload.ProtoReflect()) + case "cheqd.did.v2.MsgCreateDidDoc.signatures": + if x.Signatures == nil { + x.Signatures = []*SignInfo{} + } + value := &_MsgCreateDidDoc_2_list{list: &x.Signatures} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDoc 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_MsgCreateDidDoc) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDoc.payload": + m := new(MsgCreateDidDocPayload) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.MsgCreateDidDoc.signatures": + list := []*SignInfo{} + return protoreflect.ValueOfList(&_MsgCreateDidDoc_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDoc 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_MsgCreateDidDoc) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgCreateDidDoc", 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_MsgCreateDidDoc) 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_MsgCreateDidDoc) 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_MsgCreateDidDoc) 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_MsgCreateDidDoc) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateDidDoc) + 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.Payload != nil { + l = options.Size(x.Payload) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Signatures) > 0 { + for _, e := range x.Signatures { + l = options.Size(e) + 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().(*MsgCreateDidDoc) + 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.Signatures) > 0 { + for iNdEx := len(x.Signatures) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Signatures[iNdEx]) + 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 x.Payload != nil { + encoded, err := options.Marshal(x.Payload) + 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().(*MsgCreateDidDoc) + 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: MsgCreateDidDoc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateDidDoc: 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 Payload", 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.Payload == nil { + x.Payload = &MsgCreateDidDocPayload{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Payload); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signatures", 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 + } + x.Signatures = append(x.Signatures, &SignInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Signatures[len(x.Signatures)-1]); 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 _ protoreflect.List = (*_MsgUpdateDidDoc_2_list)(nil) + +type _MsgUpdateDidDoc_2_list struct { + list *[]*SignInfo +} + +func (x *_MsgUpdateDidDoc_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDoc_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgUpdateDidDoc_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SignInfo) + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDoc_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SignInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDoc_2_list) AppendMutable() protoreflect.Value { + v := new(SignInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateDidDoc_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDoc_2_list) NewElement() protoreflect.Value { + v := new(SignInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateDidDoc_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgUpdateDidDoc protoreflect.MessageDescriptor + fd_MsgUpdateDidDoc_payload protoreflect.FieldDescriptor + fd_MsgUpdateDidDoc_signatures protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgUpdateDidDoc = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgUpdateDidDoc") + fd_MsgUpdateDidDoc_payload = md_MsgUpdateDidDoc.Fields().ByName("payload") + fd_MsgUpdateDidDoc_signatures = md_MsgUpdateDidDoc.Fields().ByName("signatures") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateDidDoc)(nil) + +type fastReflection_MsgUpdateDidDoc MsgUpdateDidDoc + +func (x *MsgUpdateDidDoc) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateDidDoc)(x) +} + +func (x *MsgUpdateDidDoc) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_MsgUpdateDidDoc_messageType fastReflection_MsgUpdateDidDoc_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateDidDoc_messageType{} + +type fastReflection_MsgUpdateDidDoc_messageType struct{} + +func (x fastReflection_MsgUpdateDidDoc_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateDidDoc)(nil) +} +func (x fastReflection_MsgUpdateDidDoc_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateDidDoc) +} +func (x fastReflection_MsgUpdateDidDoc_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateDidDoc +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateDidDoc) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateDidDoc +} + +// 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_MsgUpdateDidDoc) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateDidDoc_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateDidDoc) New() protoreflect.Message { + return new(fastReflection_MsgUpdateDidDoc) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateDidDoc) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateDidDoc)(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_MsgUpdateDidDoc) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Payload != nil { + value := protoreflect.ValueOfMessage(x.Payload.ProtoReflect()) + if !f(fd_MsgUpdateDidDoc_payload, value) { + return + } + } + if len(x.Signatures) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDoc_2_list{list: &x.Signatures}) + if !f(fd_MsgUpdateDidDoc_signatures, 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_MsgUpdateDidDoc) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDoc.payload": + return x.Payload != nil + case "cheqd.did.v2.MsgUpdateDidDoc.signatures": + return len(x.Signatures) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDoc 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_MsgUpdateDidDoc) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDoc.payload": + x.Payload = nil + case "cheqd.did.v2.MsgUpdateDidDoc.signatures": + x.Signatures = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDoc 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_MsgUpdateDidDoc) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgUpdateDidDoc.payload": + value := x.Payload + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.MsgUpdateDidDoc.signatures": + if len(x.Signatures) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDoc_2_list{}) + } + listValue := &_MsgUpdateDidDoc_2_list{list: &x.Signatures} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDoc 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_MsgUpdateDidDoc) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDoc.payload": + x.Payload = value.Message().Interface().(*MsgUpdateDidDocPayload) + case "cheqd.did.v2.MsgUpdateDidDoc.signatures": + lv := value.List() + clv := lv.(*_MsgUpdateDidDoc_2_list) + x.Signatures = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDoc 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_MsgUpdateDidDoc) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDoc.payload": + if x.Payload == nil { + x.Payload = new(MsgUpdateDidDocPayload) + } + return protoreflect.ValueOfMessage(x.Payload.ProtoReflect()) + case "cheqd.did.v2.MsgUpdateDidDoc.signatures": + if x.Signatures == nil { + x.Signatures = []*SignInfo{} + } + value := &_MsgUpdateDidDoc_2_list{list: &x.Signatures} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDoc 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_MsgUpdateDidDoc) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDoc.payload": + m := new(MsgUpdateDidDocPayload) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.MsgUpdateDidDoc.signatures": + list := []*SignInfo{} + return protoreflect.ValueOfList(&_MsgUpdateDidDoc_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDoc 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_MsgUpdateDidDoc) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgUpdateDidDoc", 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_MsgUpdateDidDoc) 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_MsgUpdateDidDoc) 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_MsgUpdateDidDoc) 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_MsgUpdateDidDoc) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateDidDoc) + 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.Payload != nil { + l = options.Size(x.Payload) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Signatures) > 0 { + for _, e := range x.Signatures { + l = options.Size(e) + 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().(*MsgUpdateDidDoc) + 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.Signatures) > 0 { + for iNdEx := len(x.Signatures) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Signatures[iNdEx]) + 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 x.Payload != nil { + encoded, err := options.Marshal(x.Payload) + 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().(*MsgUpdateDidDoc) + 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: MsgUpdateDidDoc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateDidDoc: 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 Payload", 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.Payload == nil { + x.Payload = &MsgUpdateDidDocPayload{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Payload); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signatures", 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 + } + x.Signatures = append(x.Signatures, &SignInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Signatures[len(x.Signatures)-1]); 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 _ protoreflect.List = (*_MsgDeactivateDidDoc_2_list)(nil) + +type _MsgDeactivateDidDoc_2_list struct { + list *[]*SignInfo +} + +func (x *_MsgDeactivateDidDoc_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgDeactivateDidDoc_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgDeactivateDidDoc_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SignInfo) + (*x.list)[i] = concreteValue +} + +func (x *_MsgDeactivateDidDoc_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SignInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgDeactivateDidDoc_2_list) AppendMutable() protoreflect.Value { + v := new(SignInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgDeactivateDidDoc_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgDeactivateDidDoc_2_list) NewElement() protoreflect.Value { + v := new(SignInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgDeactivateDidDoc_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgDeactivateDidDoc protoreflect.MessageDescriptor + fd_MsgDeactivateDidDoc_payload protoreflect.FieldDescriptor + fd_MsgDeactivateDidDoc_signatures protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgDeactivateDidDoc = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgDeactivateDidDoc") + fd_MsgDeactivateDidDoc_payload = md_MsgDeactivateDidDoc.Fields().ByName("payload") + fd_MsgDeactivateDidDoc_signatures = md_MsgDeactivateDidDoc.Fields().ByName("signatures") +} + +var _ protoreflect.Message = (*fastReflection_MsgDeactivateDidDoc)(nil) + +type fastReflection_MsgDeactivateDidDoc MsgDeactivateDidDoc + +func (x *MsgDeactivateDidDoc) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgDeactivateDidDoc)(x) +} + +func (x *MsgDeactivateDidDoc) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_MsgDeactivateDidDoc_messageType fastReflection_MsgDeactivateDidDoc_messageType +var _ protoreflect.MessageType = fastReflection_MsgDeactivateDidDoc_messageType{} + +type fastReflection_MsgDeactivateDidDoc_messageType struct{} + +func (x fastReflection_MsgDeactivateDidDoc_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgDeactivateDidDoc)(nil) +} +func (x fastReflection_MsgDeactivateDidDoc_messageType) New() protoreflect.Message { + return new(fastReflection_MsgDeactivateDidDoc) +} +func (x fastReflection_MsgDeactivateDidDoc_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDeactivateDidDoc +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgDeactivateDidDoc) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDeactivateDidDoc +} + +// 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_MsgDeactivateDidDoc) Type() protoreflect.MessageType { + return _fastReflection_MsgDeactivateDidDoc_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgDeactivateDidDoc) New() protoreflect.Message { + return new(fastReflection_MsgDeactivateDidDoc) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgDeactivateDidDoc) Interface() protoreflect.ProtoMessage { + return (*MsgDeactivateDidDoc)(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_MsgDeactivateDidDoc) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Payload != nil { + value := protoreflect.ValueOfMessage(x.Payload.ProtoReflect()) + if !f(fd_MsgDeactivateDidDoc_payload, value) { + return + } + } + if len(x.Signatures) != 0 { + value := protoreflect.ValueOfList(&_MsgDeactivateDidDoc_2_list{list: &x.Signatures}) + if !f(fd_MsgDeactivateDidDoc_signatures, 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_MsgDeactivateDidDoc) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDoc.payload": + return x.Payload != nil + case "cheqd.did.v2.MsgDeactivateDidDoc.signatures": + return len(x.Signatures) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDoc 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_MsgDeactivateDidDoc) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDoc.payload": + x.Payload = nil + case "cheqd.did.v2.MsgDeactivateDidDoc.signatures": + x.Signatures = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDoc 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_MsgDeactivateDidDoc) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDoc.payload": + value := x.Payload + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.did.v2.MsgDeactivateDidDoc.signatures": + if len(x.Signatures) == 0 { + return protoreflect.ValueOfList(&_MsgDeactivateDidDoc_2_list{}) + } + listValue := &_MsgDeactivateDidDoc_2_list{list: &x.Signatures} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDoc 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_MsgDeactivateDidDoc) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDoc.payload": + x.Payload = value.Message().Interface().(*MsgDeactivateDidDocPayload) + case "cheqd.did.v2.MsgDeactivateDidDoc.signatures": + lv := value.List() + clv := lv.(*_MsgDeactivateDidDoc_2_list) + x.Signatures = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDoc 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_MsgDeactivateDidDoc) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDoc.payload": + if x.Payload == nil { + x.Payload = new(MsgDeactivateDidDocPayload) + } + return protoreflect.ValueOfMessage(x.Payload.ProtoReflect()) + case "cheqd.did.v2.MsgDeactivateDidDoc.signatures": + if x.Signatures == nil { + x.Signatures = []*SignInfo{} + } + value := &_MsgDeactivateDidDoc_2_list{list: &x.Signatures} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDoc 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_MsgDeactivateDidDoc) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDoc.payload": + m := new(MsgDeactivateDidDocPayload) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.did.v2.MsgDeactivateDidDoc.signatures": + list := []*SignInfo{} + return protoreflect.ValueOfList(&_MsgDeactivateDidDoc_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDoc")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDoc 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_MsgDeactivateDidDoc) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgDeactivateDidDoc", 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_MsgDeactivateDidDoc) 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_MsgDeactivateDidDoc) 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_MsgDeactivateDidDoc) 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_MsgDeactivateDidDoc) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgDeactivateDidDoc) + 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.Payload != nil { + l = options.Size(x.Payload) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Signatures) > 0 { + for _, e := range x.Signatures { + l = options.Size(e) + 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().(*MsgDeactivateDidDoc) + 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.Signatures) > 0 { + for iNdEx := len(x.Signatures) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Signatures[iNdEx]) + 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 x.Payload != nil { + encoded, err := options.Marshal(x.Payload) + 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().(*MsgDeactivateDidDoc) + 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: MsgDeactivateDidDoc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDeactivateDidDoc: 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 Payload", 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.Payload == nil { + x.Payload = &MsgDeactivateDidDocPayload{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Payload); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signatures", 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 + } + x.Signatures = append(x.Signatures, &SignInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Signatures[len(x.Signatures)-1]); 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_SignInfo protoreflect.MessageDescriptor + fd_SignInfo_verification_method_id protoreflect.FieldDescriptor + fd_SignInfo_signature protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_SignInfo = File_cheqd_did_v2_tx_proto.Messages().ByName("SignInfo") + fd_SignInfo_verification_method_id = md_SignInfo.Fields().ByName("verification_method_id") + fd_SignInfo_signature = md_SignInfo.Fields().ByName("signature") +} + +var _ protoreflect.Message = (*fastReflection_SignInfo)(nil) + +type fastReflection_SignInfo SignInfo + +func (x *SignInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_SignInfo)(x) +} + +func (x *SignInfo) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_SignInfo_messageType fastReflection_SignInfo_messageType +var _ protoreflect.MessageType = fastReflection_SignInfo_messageType{} + +type fastReflection_SignInfo_messageType struct{} + +func (x fastReflection_SignInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_SignInfo)(nil) +} +func (x fastReflection_SignInfo_messageType) New() protoreflect.Message { + return new(fastReflection_SignInfo) +} +func (x fastReflection_SignInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SignInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SignInfo) Descriptor() protoreflect.MessageDescriptor { + return md_SignInfo +} + +// 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_SignInfo) Type() protoreflect.MessageType { + return _fastReflection_SignInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SignInfo) New() protoreflect.Message { + return new(fastReflection_SignInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SignInfo) Interface() protoreflect.ProtoMessage { + return (*SignInfo)(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_SignInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.VerificationMethodId != "" { + value := protoreflect.ValueOfString(x.VerificationMethodId) + if !f(fd_SignInfo_verification_method_id, value) { + return + } + } + if len(x.Signature) != 0 { + value := protoreflect.ValueOfBytes(x.Signature) + if !f(fd_SignInfo_signature, 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_SignInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.SignInfo.verification_method_id": + return x.VerificationMethodId != "" + case "cheqd.did.v2.SignInfo.signature": + return len(x.Signature) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.SignInfo")) + } + panic(fmt.Errorf("message cheqd.did.v2.SignInfo 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_SignInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.SignInfo.verification_method_id": + x.VerificationMethodId = "" + case "cheqd.did.v2.SignInfo.signature": + x.Signature = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.SignInfo")) + } + panic(fmt.Errorf("message cheqd.did.v2.SignInfo 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_SignInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.SignInfo.verification_method_id": + value := x.VerificationMethodId + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.SignInfo.signature": + value := x.Signature + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.SignInfo")) + } + panic(fmt.Errorf("message cheqd.did.v2.SignInfo 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_SignInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.SignInfo.verification_method_id": + x.VerificationMethodId = value.Interface().(string) + case "cheqd.did.v2.SignInfo.signature": + x.Signature = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.SignInfo")) + } + panic(fmt.Errorf("message cheqd.did.v2.SignInfo 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_SignInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.SignInfo.verification_method_id": + panic(fmt.Errorf("field verification_method_id of message cheqd.did.v2.SignInfo is not mutable")) + case "cheqd.did.v2.SignInfo.signature": + panic(fmt.Errorf("field signature of message cheqd.did.v2.SignInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.SignInfo")) + } + panic(fmt.Errorf("message cheqd.did.v2.SignInfo 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_SignInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.SignInfo.verification_method_id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.SignInfo.signature": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.SignInfo")) + } + panic(fmt.Errorf("message cheqd.did.v2.SignInfo 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_SignInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.SignInfo", 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_SignInfo) 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_SignInfo) 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_SignInfo) 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_SignInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SignInfo) + 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.VerificationMethodId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Signature) + 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().(*SignInfo) + 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.Signature) > 0 { + i -= len(x.Signature) + copy(dAtA[i:], x.Signature) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signature))) + i-- + dAtA[i] = 0x12 + } + if len(x.VerificationMethodId) > 0 { + i -= len(x.VerificationMethodId) + copy(dAtA[i:], x.VerificationMethodId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VerificationMethodId))) + 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().(*SignInfo) + 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: SignInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SignInfo: 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 VerificationMethodId", 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.VerificationMethodId = 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 Signature", 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.Signature = append(x.Signature[:0], dAtA[iNdEx:postIndex]...) + if x.Signature == nil { + x.Signature = []byte{} + } + 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.List = (*_MsgCreateDidDocPayload_1_list)(nil) + +type _MsgCreateDidDocPayload_1_list struct { + list *[]string +} + +func (x *_MsgCreateDidDocPayload_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgCreateDidDocPayload_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDidDocPayload at list field Context as it is not of Message kind")) +} + +func (x *_MsgCreateDidDocPayload_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgCreateDidDocPayload_1_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_3_list)(nil) + +type _MsgCreateDidDocPayload_3_list struct { + list *[]string +} + +func (x *_MsgCreateDidDocPayload_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgCreateDidDocPayload_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDidDocPayload at list field Controller as it is not of Message kind")) +} + +func (x *_MsgCreateDidDocPayload_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgCreateDidDocPayload_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_4_list)(nil) + +type _MsgCreateDidDocPayload_4_list struct { + list *[]*VerificationMethod +} + +func (x *_MsgCreateDidDocPayload_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateDidDocPayload_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_4_list) AppendMutable() protoreflect.Value { + v := new(VerificationMethod) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateDidDocPayload_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_4_list) NewElement() protoreflect.Value { + v := new(VerificationMethod) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateDidDocPayload_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_5_list)(nil) + +type _MsgCreateDidDocPayload_5_list struct { + list *[]string +} + +func (x *_MsgCreateDidDocPayload_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgCreateDidDocPayload_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDidDocPayload at list field Authentication as it is not of Message kind")) +} + +func (x *_MsgCreateDidDocPayload_5_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgCreateDidDocPayload_5_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_6_list)(nil) + +type _MsgCreateDidDocPayload_6_list struct { + list *[]string +} + +func (x *_MsgCreateDidDocPayload_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgCreateDidDocPayload_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDidDocPayload at list field AssertionMethod as it is not of Message kind")) +} + +func (x *_MsgCreateDidDocPayload_6_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_6_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgCreateDidDocPayload_6_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_7_list)(nil) + +type _MsgCreateDidDocPayload_7_list struct { + list *[]string +} + +func (x *_MsgCreateDidDocPayload_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgCreateDidDocPayload_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_7_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDidDocPayload at list field CapabilityInvocation as it is not of Message kind")) +} + +func (x *_MsgCreateDidDocPayload_7_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_7_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgCreateDidDocPayload_7_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_8_list)(nil) + +type _MsgCreateDidDocPayload_8_list struct { + list *[]string +} + +func (x *_MsgCreateDidDocPayload_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgCreateDidDocPayload_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDidDocPayload at list field CapabilityDelegation as it is not of Message kind")) +} + +func (x *_MsgCreateDidDocPayload_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgCreateDidDocPayload_8_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_9_list)(nil) + +type _MsgCreateDidDocPayload_9_list struct { + list *[]string +} + +func (x *_MsgCreateDidDocPayload_9_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_9_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgCreateDidDocPayload_9_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_9_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_9_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDidDocPayload at list field KeyAgreement as it is not of Message kind")) +} + +func (x *_MsgCreateDidDocPayload_9_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_9_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgCreateDidDocPayload_9_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_10_list)(nil) + +type _MsgCreateDidDocPayload_10_list struct { + list *[]*Service +} + +func (x *_MsgCreateDidDocPayload_10_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_10_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateDidDocPayload_10_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Service) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_10_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Service) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_10_list) AppendMutable() protoreflect.Value { + v := new(Service) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateDidDocPayload_10_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_10_list) NewElement() protoreflect.Value { + v := new(Service) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateDidDocPayload_10_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateDidDocPayload_11_list)(nil) + +type _MsgCreateDidDocPayload_11_list struct { + list *[]string +} + +func (x *_MsgCreateDidDocPayload_11_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDidDocPayload_11_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgCreateDidDocPayload_11_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDidDocPayload_11_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDidDocPayload_11_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgCreateDidDocPayload at list field AlsoKnownAs as it is not of Message kind")) +} + +func (x *_MsgCreateDidDocPayload_11_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDidDocPayload_11_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgCreateDidDocPayload_11_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgCreateDidDocPayload protoreflect.MessageDescriptor + fd_MsgCreateDidDocPayload_context protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_id protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_controller protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_verification_method protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_authentication protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_assertion_method protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_capability_invocation protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_capability_delegation protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_key_agreement protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_service protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_also_known_as protoreflect.FieldDescriptor + fd_MsgCreateDidDocPayload_version_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgCreateDidDocPayload = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgCreateDidDocPayload") + fd_MsgCreateDidDocPayload_context = md_MsgCreateDidDocPayload.Fields().ByName("context") + fd_MsgCreateDidDocPayload_id = md_MsgCreateDidDocPayload.Fields().ByName("id") + fd_MsgCreateDidDocPayload_controller = md_MsgCreateDidDocPayload.Fields().ByName("controller") + fd_MsgCreateDidDocPayload_verification_method = md_MsgCreateDidDocPayload.Fields().ByName("verification_method") + fd_MsgCreateDidDocPayload_authentication = md_MsgCreateDidDocPayload.Fields().ByName("authentication") + fd_MsgCreateDidDocPayload_assertion_method = md_MsgCreateDidDocPayload.Fields().ByName("assertion_method") + fd_MsgCreateDidDocPayload_capability_invocation = md_MsgCreateDidDocPayload.Fields().ByName("capability_invocation") + fd_MsgCreateDidDocPayload_capability_delegation = md_MsgCreateDidDocPayload.Fields().ByName("capability_delegation") + fd_MsgCreateDidDocPayload_key_agreement = md_MsgCreateDidDocPayload.Fields().ByName("key_agreement") + fd_MsgCreateDidDocPayload_service = md_MsgCreateDidDocPayload.Fields().ByName("service") + fd_MsgCreateDidDocPayload_also_known_as = md_MsgCreateDidDocPayload.Fields().ByName("also_known_as") + fd_MsgCreateDidDocPayload_version_id = md_MsgCreateDidDocPayload.Fields().ByName("version_id") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateDidDocPayload)(nil) + +type fastReflection_MsgCreateDidDocPayload MsgCreateDidDocPayload + +func (x *MsgCreateDidDocPayload) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateDidDocPayload)(x) +} + +func (x *MsgCreateDidDocPayload) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_tx_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_MsgCreateDidDocPayload_messageType fastReflection_MsgCreateDidDocPayload_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateDidDocPayload_messageType{} + +type fastReflection_MsgCreateDidDocPayload_messageType struct{} + +func (x fastReflection_MsgCreateDidDocPayload_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateDidDocPayload)(nil) +} +func (x fastReflection_MsgCreateDidDocPayload_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateDidDocPayload) +} +func (x fastReflection_MsgCreateDidDocPayload_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDidDocPayload +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateDidDocPayload) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDidDocPayload +} + +// 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_MsgCreateDidDocPayload) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateDidDocPayload_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateDidDocPayload) New() protoreflect.Message { + return new(fastReflection_MsgCreateDidDocPayload) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateDidDocPayload) Interface() protoreflect.ProtoMessage { + return (*MsgCreateDidDocPayload)(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_MsgCreateDidDocPayload) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Context) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_1_list{list: &x.Context}) + if !f(fd_MsgCreateDidDocPayload_context, value) { + return + } + } + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_MsgCreateDidDocPayload_id, value) { + return + } + } + if len(x.Controller) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_3_list{list: &x.Controller}) + if !f(fd_MsgCreateDidDocPayload_controller, value) { + return + } + } + if len(x.VerificationMethod) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_4_list{list: &x.VerificationMethod}) + if !f(fd_MsgCreateDidDocPayload_verification_method, value) { + return + } + } + if len(x.Authentication) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_5_list{list: &x.Authentication}) + if !f(fd_MsgCreateDidDocPayload_authentication, value) { + return + } + } + if len(x.AssertionMethod) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_6_list{list: &x.AssertionMethod}) + if !f(fd_MsgCreateDidDocPayload_assertion_method, value) { + return + } + } + if len(x.CapabilityInvocation) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_7_list{list: &x.CapabilityInvocation}) + if !f(fd_MsgCreateDidDocPayload_capability_invocation, value) { + return + } + } + if len(x.CapabilityDelegation) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_8_list{list: &x.CapabilityDelegation}) + if !f(fd_MsgCreateDidDocPayload_capability_delegation, value) { + return + } + } + if len(x.KeyAgreement) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_9_list{list: &x.KeyAgreement}) + if !f(fd_MsgCreateDidDocPayload_key_agreement, value) { + return + } + } + if len(x.Service) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_10_list{list: &x.Service}) + if !f(fd_MsgCreateDidDocPayload_service, value) { + return + } + } + if len(x.AlsoKnownAs) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDidDocPayload_11_list{list: &x.AlsoKnownAs}) + if !f(fd_MsgCreateDidDocPayload_also_known_as, value) { + return + } + } + if x.VersionId != "" { + value := protoreflect.ValueOfString(x.VersionId) + if !f(fd_MsgCreateDidDocPayload_version_id, 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_MsgCreateDidDocPayload) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocPayload.context": + return len(x.Context) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.id": + return x.Id != "" + case "cheqd.did.v2.MsgCreateDidDocPayload.controller": + return len(x.Controller) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.verification_method": + return len(x.VerificationMethod) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.authentication": + return len(x.Authentication) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.assertion_method": + return len(x.AssertionMethod) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_invocation": + return len(x.CapabilityInvocation) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_delegation": + return len(x.CapabilityDelegation) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.key_agreement": + return len(x.KeyAgreement) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.service": + return len(x.Service) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.also_known_as": + return len(x.AlsoKnownAs) != 0 + case "cheqd.did.v2.MsgCreateDidDocPayload.version_id": + return x.VersionId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocPayload 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_MsgCreateDidDocPayload) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocPayload.context": + x.Context = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.id": + x.Id = "" + case "cheqd.did.v2.MsgCreateDidDocPayload.controller": + x.Controller = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.verification_method": + x.VerificationMethod = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.authentication": + x.Authentication = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.assertion_method": + x.AssertionMethod = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_invocation": + x.CapabilityInvocation = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_delegation": + x.CapabilityDelegation = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.key_agreement": + x.KeyAgreement = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.service": + x.Service = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.also_known_as": + x.AlsoKnownAs = nil + case "cheqd.did.v2.MsgCreateDidDocPayload.version_id": + x.VersionId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocPayload 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_MsgCreateDidDocPayload) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgCreateDidDocPayload.context": + if len(x.Context) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_1_list{}) + } + listValue := &_MsgCreateDidDocPayload_1_list{list: &x.Context} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.controller": + if len(x.Controller) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_3_list{}) + } + listValue := &_MsgCreateDidDocPayload_3_list{list: &x.Controller} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.verification_method": + if len(x.VerificationMethod) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_4_list{}) + } + listValue := &_MsgCreateDidDocPayload_4_list{list: &x.VerificationMethod} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.authentication": + if len(x.Authentication) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_5_list{}) + } + listValue := &_MsgCreateDidDocPayload_5_list{list: &x.Authentication} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.assertion_method": + if len(x.AssertionMethod) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_6_list{}) + } + listValue := &_MsgCreateDidDocPayload_6_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_invocation": + if len(x.CapabilityInvocation) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_7_list{}) + } + listValue := &_MsgCreateDidDocPayload_7_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_delegation": + if len(x.CapabilityDelegation) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_8_list{}) + } + listValue := &_MsgCreateDidDocPayload_8_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.key_agreement": + if len(x.KeyAgreement) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_9_list{}) + } + listValue := &_MsgCreateDidDocPayload_9_list{list: &x.KeyAgreement} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.service": + if len(x.Service) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_10_list{}) + } + listValue := &_MsgCreateDidDocPayload_10_list{list: &x.Service} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.also_known_as": + if len(x.AlsoKnownAs) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_11_list{}) + } + listValue := &_MsgCreateDidDocPayload_11_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgCreateDidDocPayload.version_id": + value := x.VersionId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocPayload 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_MsgCreateDidDocPayload) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocPayload.context": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_1_list) + x.Context = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.id": + x.Id = value.Interface().(string) + case "cheqd.did.v2.MsgCreateDidDocPayload.controller": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_3_list) + x.Controller = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.verification_method": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_4_list) + x.VerificationMethod = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.authentication": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_5_list) + x.Authentication = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.assertion_method": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_6_list) + x.AssertionMethod = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_invocation": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_7_list) + x.CapabilityInvocation = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_delegation": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_8_list) + x.CapabilityDelegation = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.key_agreement": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_9_list) + x.KeyAgreement = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.service": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_10_list) + x.Service = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.also_known_as": + lv := value.List() + clv := lv.(*_MsgCreateDidDocPayload_11_list) + x.AlsoKnownAs = *clv.list + case "cheqd.did.v2.MsgCreateDidDocPayload.version_id": + x.VersionId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocPayload 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_MsgCreateDidDocPayload) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocPayload.context": + if x.Context == nil { + x.Context = []string{} + } + value := &_MsgCreateDidDocPayload_1_list{list: &x.Context} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.controller": + if x.Controller == nil { + x.Controller = []string{} + } + value := &_MsgCreateDidDocPayload_3_list{list: &x.Controller} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.verification_method": + if x.VerificationMethod == nil { + x.VerificationMethod = []*VerificationMethod{} + } + value := &_MsgCreateDidDocPayload_4_list{list: &x.VerificationMethod} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.authentication": + if x.Authentication == nil { + x.Authentication = []string{} + } + value := &_MsgCreateDidDocPayload_5_list{list: &x.Authentication} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.assertion_method": + if x.AssertionMethod == nil { + x.AssertionMethod = []string{} + } + value := &_MsgCreateDidDocPayload_6_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_invocation": + if x.CapabilityInvocation == nil { + x.CapabilityInvocation = []string{} + } + value := &_MsgCreateDidDocPayload_7_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_delegation": + if x.CapabilityDelegation == nil { + x.CapabilityDelegation = []string{} + } + value := &_MsgCreateDidDocPayload_8_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.key_agreement": + if x.KeyAgreement == nil { + x.KeyAgreement = []string{} + } + value := &_MsgCreateDidDocPayload_9_list{list: &x.KeyAgreement} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.service": + if x.Service == nil { + x.Service = []*Service{} + } + value := &_MsgCreateDidDocPayload_10_list{list: &x.Service} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.also_known_as": + if x.AlsoKnownAs == nil { + x.AlsoKnownAs = []string{} + } + value := &_MsgCreateDidDocPayload_11_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgCreateDidDocPayload.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.MsgCreateDidDocPayload is not mutable")) + case "cheqd.did.v2.MsgCreateDidDocPayload.version_id": + panic(fmt.Errorf("field version_id of message cheqd.did.v2.MsgCreateDidDocPayload is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocPayload 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_MsgCreateDidDocPayload) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocPayload.context": + list := []string{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_1_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.MsgCreateDidDocPayload.controller": + list := []string{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_3_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.verification_method": + list := []*VerificationMethod{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_4_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.authentication": + list := []string{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_5_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.assertion_method": + list := []string{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_6_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_invocation": + list := []string{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_7_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.capability_delegation": + list := []string{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_8_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.key_agreement": + list := []string{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_9_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.service": + list := []*Service{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_10_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.also_known_as": + list := []string{} + return protoreflect.ValueOfList(&_MsgCreateDidDocPayload_11_list{list: &list}) + case "cheqd.did.v2.MsgCreateDidDocPayload.version_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocPayload 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_MsgCreateDidDocPayload) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgCreateDidDocPayload", 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_MsgCreateDidDocPayload) 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_MsgCreateDidDocPayload) 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_MsgCreateDidDocPayload) 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_MsgCreateDidDocPayload) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateDidDocPayload) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Context) > 0 { + for _, s := range x.Context { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Controller) > 0 { + for _, s := range x.Controller { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.VerificationMethod) > 0 { + for _, e := range x.VerificationMethod { + l = options.Size(e) + 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)) + } + } + if len(x.AssertionMethod) > 0 { + for _, s := range x.AssertionMethod { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityInvocation) > 0 { + for _, s := range x.CapabilityInvocation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityDelegation) > 0 { + for _, s := range x.CapabilityDelegation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.KeyAgreement) > 0 { + for _, s := range x.KeyAgreement { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Service) > 0 { + for _, e := range x.Service { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.AlsoKnownAs) > 0 { + for _, s := range x.AlsoKnownAs { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.VersionId) + 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().(*MsgCreateDidDocPayload) + 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.VersionId) > 0 { + i -= len(x.VersionId) + copy(dAtA[i:], x.VersionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VersionId))) + i-- + dAtA[i] = 0x62 + } + if len(x.AlsoKnownAs) > 0 { + for iNdEx := len(x.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AlsoKnownAs[iNdEx]) + copy(dAtA[i:], x.AlsoKnownAs[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AlsoKnownAs[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(x.Service) > 0 { + for iNdEx := len(x.Service) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Service[iNdEx]) + 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] = 0x52 + } + } + if len(x.KeyAgreement) > 0 { + for iNdEx := len(x.KeyAgreement) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.KeyAgreement[iNdEx]) + copy(dAtA[i:], x.KeyAgreement[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyAgreement[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(x.CapabilityDelegation) > 0 { + for iNdEx := len(x.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], x.CapabilityDelegation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityDelegation[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(x.CapabilityInvocation) > 0 { + for iNdEx := len(x.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], x.CapabilityInvocation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityInvocation[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(x.AssertionMethod) > 0 { + for iNdEx := len(x.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AssertionMethod[iNdEx]) + copy(dAtA[i:], x.AssertionMethod[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssertionMethod[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + 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] = 0x2a + } + } + if len(x.VerificationMethod) > 0 { + for iNdEx := len(x.VerificationMethod) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VerificationMethod[iNdEx]) + 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] = 0x22 + } + } + if len(x.Controller) > 0 { + for iNdEx := len(x.Controller) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Controller[iNdEx]) + copy(dAtA[i:], x.Controller[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0x12 + } + if len(x.Context) > 0 { + for iNdEx := len(x.Context) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Context[iNdEx]) + copy(dAtA[i:], x.Context[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Context[iNdEx]))) + 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().(*MsgCreateDidDocPayload) + 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: MsgCreateDidDocPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateDidDocPayload: 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 Context", 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.Context = append(x.Context, 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 Id", 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.Id = 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 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 = append(x.Controller, 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 VerificationMethod", 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 + } + x.VerificationMethod = append(x.VerificationMethod, &VerificationMethod{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VerificationMethod[len(x.VerificationMethod)-1]); 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 Authentication", 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.Authentication = append(x.Authentication, 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 AssertionMethod", 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.AssertionMethod = append(x.AssertionMethod, 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 CapabilityInvocation", 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.CapabilityInvocation = append(x.CapabilityInvocation, 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 CapabilityDelegation", 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.CapabilityDelegation = append(x.CapabilityDelegation, 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 KeyAgreement", 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.KeyAgreement = append(x.KeyAgreement, 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 Service", 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 + } + x.Service = append(x.Service, &Service{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service[len(x.Service)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AlsoKnownAs", 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.AlsoKnownAs = append(x.AlsoKnownAs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 12: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VersionId", 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.VersionId = 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_MsgCreateDidDocResponse protoreflect.MessageDescriptor + fd_MsgCreateDidDocResponse_value protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgCreateDidDocResponse = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgCreateDidDocResponse") + fd_MsgCreateDidDocResponse_value = md_MsgCreateDidDocResponse.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateDidDocResponse)(nil) + +type fastReflection_MsgCreateDidDocResponse MsgCreateDidDocResponse + +func (x *MsgCreateDidDocResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateDidDocResponse)(x) +} + +func (x *MsgCreateDidDocResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_tx_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_MsgCreateDidDocResponse_messageType fastReflection_MsgCreateDidDocResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateDidDocResponse_messageType{} + +type fastReflection_MsgCreateDidDocResponse_messageType struct{} + +func (x fastReflection_MsgCreateDidDocResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateDidDocResponse)(nil) +} +func (x fastReflection_MsgCreateDidDocResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateDidDocResponse) +} +func (x fastReflection_MsgCreateDidDocResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDidDocResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateDidDocResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDidDocResponse +} + +// 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_MsgCreateDidDocResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateDidDocResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateDidDocResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateDidDocResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateDidDocResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateDidDocResponse)(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_MsgCreateDidDocResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Value != nil { + value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + if !f(fd_MsgCreateDidDocResponse_value, 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_MsgCreateDidDocResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocResponse.value": + return x.Value != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocResponse 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_MsgCreateDidDocResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocResponse.value": + x.Value = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocResponse 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_MsgCreateDidDocResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgCreateDidDocResponse.value": + value := x.Value + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocResponse 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_MsgCreateDidDocResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocResponse.value": + x.Value = value.Message().Interface().(*DidDocWithMetadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocResponse 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_MsgCreateDidDocResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocResponse.value": + if x.Value == nil { + x.Value = new(DidDocWithMetadata) + } + return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocResponse 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_MsgCreateDidDocResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgCreateDidDocResponse.value": + m := new(DidDocWithMetadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgCreateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgCreateDidDocResponse 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_MsgCreateDidDocResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgCreateDidDocResponse", 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_MsgCreateDidDocResponse) 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_MsgCreateDidDocResponse) 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_MsgCreateDidDocResponse) 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_MsgCreateDidDocResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateDidDocResponse) + 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.Value != nil { + l = options.Size(x.Value) + 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().(*MsgCreateDidDocResponse) + 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.Value != nil { + encoded, err := options.Marshal(x.Value) + 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().(*MsgCreateDidDocResponse) + 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: MsgCreateDidDocResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateDidDocResponse: 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 Value", 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.Value == nil { + x.Value = &DidDocWithMetadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); 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 _ protoreflect.List = (*_MsgUpdateDidDocPayload_1_list)(nil) + +type _MsgUpdateDidDocPayload_1_list struct { + list *[]string +} + +func (x *_MsgUpdateDidDocPayload_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgUpdateDidDocPayload_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateDidDocPayload at list field Context as it is not of Message kind")) +} + +func (x *_MsgUpdateDidDocPayload_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgUpdateDidDocPayload_1_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_3_list)(nil) + +type _MsgUpdateDidDocPayload_3_list struct { + list *[]string +} + +func (x *_MsgUpdateDidDocPayload_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgUpdateDidDocPayload_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateDidDocPayload at list field Controller as it is not of Message kind")) +} + +func (x *_MsgUpdateDidDocPayload_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgUpdateDidDocPayload_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_4_list)(nil) + +type _MsgUpdateDidDocPayload_4_list struct { + list *[]*VerificationMethod +} + +func (x *_MsgUpdateDidDocPayload_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgUpdateDidDocPayload_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_4_list) AppendMutable() protoreflect.Value { + v := new(VerificationMethod) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateDidDocPayload_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_4_list) NewElement() protoreflect.Value { + v := new(VerificationMethod) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateDidDocPayload_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_5_list)(nil) + +type _MsgUpdateDidDocPayload_5_list struct { + list *[]string +} + +func (x *_MsgUpdateDidDocPayload_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgUpdateDidDocPayload_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateDidDocPayload at list field Authentication as it is not of Message kind")) +} + +func (x *_MsgUpdateDidDocPayload_5_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgUpdateDidDocPayload_5_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_6_list)(nil) + +type _MsgUpdateDidDocPayload_6_list struct { + list *[]string +} + +func (x *_MsgUpdateDidDocPayload_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgUpdateDidDocPayload_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateDidDocPayload at list field AssertionMethod as it is not of Message kind")) +} + +func (x *_MsgUpdateDidDocPayload_6_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_6_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgUpdateDidDocPayload_6_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_7_list)(nil) + +type _MsgUpdateDidDocPayload_7_list struct { + list *[]string +} + +func (x *_MsgUpdateDidDocPayload_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgUpdateDidDocPayload_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_7_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateDidDocPayload at list field CapabilityInvocation as it is not of Message kind")) +} + +func (x *_MsgUpdateDidDocPayload_7_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_7_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgUpdateDidDocPayload_7_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_8_list)(nil) + +type _MsgUpdateDidDocPayload_8_list struct { + list *[]string +} + +func (x *_MsgUpdateDidDocPayload_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgUpdateDidDocPayload_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateDidDocPayload at list field CapabilityDelegation as it is not of Message kind")) +} + +func (x *_MsgUpdateDidDocPayload_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgUpdateDidDocPayload_8_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_9_list)(nil) + +type _MsgUpdateDidDocPayload_9_list struct { + list *[]string +} + +func (x *_MsgUpdateDidDocPayload_9_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_9_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgUpdateDidDocPayload_9_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_9_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_9_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateDidDocPayload at list field KeyAgreement as it is not of Message kind")) +} + +func (x *_MsgUpdateDidDocPayload_9_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_9_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgUpdateDidDocPayload_9_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_10_list)(nil) + +type _MsgUpdateDidDocPayload_10_list struct { + list *[]*Service +} + +func (x *_MsgUpdateDidDocPayload_10_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_10_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgUpdateDidDocPayload_10_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Service) + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_10_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Service) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_10_list) AppendMutable() protoreflect.Value { + v := new(Service) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateDidDocPayload_10_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_10_list) NewElement() protoreflect.Value { + v := new(Service) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateDidDocPayload_10_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgUpdateDidDocPayload_11_list)(nil) + +type _MsgUpdateDidDocPayload_11_list struct { + list *[]string +} + +func (x *_MsgUpdateDidDocPayload_11_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateDidDocPayload_11_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgUpdateDidDocPayload_11_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateDidDocPayload_11_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateDidDocPayload_11_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateDidDocPayload at list field AlsoKnownAs as it is not of Message kind")) +} + +func (x *_MsgUpdateDidDocPayload_11_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateDidDocPayload_11_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgUpdateDidDocPayload_11_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgUpdateDidDocPayload protoreflect.MessageDescriptor + fd_MsgUpdateDidDocPayload_context protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_id protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_controller protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_verification_method protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_authentication protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_assertion_method protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_capability_invocation protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_capability_delegation protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_key_agreement protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_service protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_also_known_as protoreflect.FieldDescriptor + fd_MsgUpdateDidDocPayload_version_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgUpdateDidDocPayload = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgUpdateDidDocPayload") + fd_MsgUpdateDidDocPayload_context = md_MsgUpdateDidDocPayload.Fields().ByName("context") + fd_MsgUpdateDidDocPayload_id = md_MsgUpdateDidDocPayload.Fields().ByName("id") + fd_MsgUpdateDidDocPayload_controller = md_MsgUpdateDidDocPayload.Fields().ByName("controller") + fd_MsgUpdateDidDocPayload_verification_method = md_MsgUpdateDidDocPayload.Fields().ByName("verification_method") + fd_MsgUpdateDidDocPayload_authentication = md_MsgUpdateDidDocPayload.Fields().ByName("authentication") + fd_MsgUpdateDidDocPayload_assertion_method = md_MsgUpdateDidDocPayload.Fields().ByName("assertion_method") + fd_MsgUpdateDidDocPayload_capability_invocation = md_MsgUpdateDidDocPayload.Fields().ByName("capability_invocation") + fd_MsgUpdateDidDocPayload_capability_delegation = md_MsgUpdateDidDocPayload.Fields().ByName("capability_delegation") + fd_MsgUpdateDidDocPayload_key_agreement = md_MsgUpdateDidDocPayload.Fields().ByName("key_agreement") + fd_MsgUpdateDidDocPayload_service = md_MsgUpdateDidDocPayload.Fields().ByName("service") + fd_MsgUpdateDidDocPayload_also_known_as = md_MsgUpdateDidDocPayload.Fields().ByName("also_known_as") + fd_MsgUpdateDidDocPayload_version_id = md_MsgUpdateDidDocPayload.Fields().ByName("version_id") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateDidDocPayload)(nil) + +type fastReflection_MsgUpdateDidDocPayload MsgUpdateDidDocPayload + +func (x *MsgUpdateDidDocPayload) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateDidDocPayload)(x) +} + +func (x *MsgUpdateDidDocPayload) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_tx_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_MsgUpdateDidDocPayload_messageType fastReflection_MsgUpdateDidDocPayload_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateDidDocPayload_messageType{} + +type fastReflection_MsgUpdateDidDocPayload_messageType struct{} + +func (x fastReflection_MsgUpdateDidDocPayload_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateDidDocPayload)(nil) +} +func (x fastReflection_MsgUpdateDidDocPayload_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateDidDocPayload) +} +func (x fastReflection_MsgUpdateDidDocPayload_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateDidDocPayload +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateDidDocPayload) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateDidDocPayload +} + +// 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_MsgUpdateDidDocPayload) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateDidDocPayload_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateDidDocPayload) New() protoreflect.Message { + return new(fastReflection_MsgUpdateDidDocPayload) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateDidDocPayload) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateDidDocPayload)(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_MsgUpdateDidDocPayload) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Context) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_1_list{list: &x.Context}) + if !f(fd_MsgUpdateDidDocPayload_context, value) { + return + } + } + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_MsgUpdateDidDocPayload_id, value) { + return + } + } + if len(x.Controller) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_3_list{list: &x.Controller}) + if !f(fd_MsgUpdateDidDocPayload_controller, value) { + return + } + } + if len(x.VerificationMethod) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_4_list{list: &x.VerificationMethod}) + if !f(fd_MsgUpdateDidDocPayload_verification_method, value) { + return + } + } + if len(x.Authentication) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_5_list{list: &x.Authentication}) + if !f(fd_MsgUpdateDidDocPayload_authentication, value) { + return + } + } + if len(x.AssertionMethod) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_6_list{list: &x.AssertionMethod}) + if !f(fd_MsgUpdateDidDocPayload_assertion_method, value) { + return + } + } + if len(x.CapabilityInvocation) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_7_list{list: &x.CapabilityInvocation}) + if !f(fd_MsgUpdateDidDocPayload_capability_invocation, value) { + return + } + } + if len(x.CapabilityDelegation) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_8_list{list: &x.CapabilityDelegation}) + if !f(fd_MsgUpdateDidDocPayload_capability_delegation, value) { + return + } + } + if len(x.KeyAgreement) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_9_list{list: &x.KeyAgreement}) + if !f(fd_MsgUpdateDidDocPayload_key_agreement, value) { + return + } + } + if len(x.Service) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_10_list{list: &x.Service}) + if !f(fd_MsgUpdateDidDocPayload_service, value) { + return + } + } + if len(x.AlsoKnownAs) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_11_list{list: &x.AlsoKnownAs}) + if !f(fd_MsgUpdateDidDocPayload_also_known_as, value) { + return + } + } + if x.VersionId != "" { + value := protoreflect.ValueOfString(x.VersionId) + if !f(fd_MsgUpdateDidDocPayload_version_id, 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_MsgUpdateDidDocPayload) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocPayload.context": + return len(x.Context) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.id": + return x.Id != "" + case "cheqd.did.v2.MsgUpdateDidDocPayload.controller": + return len(x.Controller) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.verification_method": + return len(x.VerificationMethod) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.authentication": + return len(x.Authentication) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.assertion_method": + return len(x.AssertionMethod) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_invocation": + return len(x.CapabilityInvocation) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_delegation": + return len(x.CapabilityDelegation) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.key_agreement": + return len(x.KeyAgreement) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.service": + return len(x.Service) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.also_known_as": + return len(x.AlsoKnownAs) != 0 + case "cheqd.did.v2.MsgUpdateDidDocPayload.version_id": + return x.VersionId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocPayload 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_MsgUpdateDidDocPayload) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocPayload.context": + x.Context = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.id": + x.Id = "" + case "cheqd.did.v2.MsgUpdateDidDocPayload.controller": + x.Controller = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.verification_method": + x.VerificationMethod = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.authentication": + x.Authentication = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.assertion_method": + x.AssertionMethod = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_invocation": + x.CapabilityInvocation = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_delegation": + x.CapabilityDelegation = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.key_agreement": + x.KeyAgreement = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.service": + x.Service = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.also_known_as": + x.AlsoKnownAs = nil + case "cheqd.did.v2.MsgUpdateDidDocPayload.version_id": + x.VersionId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocPayload 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_MsgUpdateDidDocPayload) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocPayload.context": + if len(x.Context) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_1_list{}) + } + listValue := &_MsgUpdateDidDocPayload_1_list{list: &x.Context} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.controller": + if len(x.Controller) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_3_list{}) + } + listValue := &_MsgUpdateDidDocPayload_3_list{list: &x.Controller} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.verification_method": + if len(x.VerificationMethod) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_4_list{}) + } + listValue := &_MsgUpdateDidDocPayload_4_list{list: &x.VerificationMethod} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.authentication": + if len(x.Authentication) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_5_list{}) + } + listValue := &_MsgUpdateDidDocPayload_5_list{list: &x.Authentication} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.assertion_method": + if len(x.AssertionMethod) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_6_list{}) + } + listValue := &_MsgUpdateDidDocPayload_6_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_invocation": + if len(x.CapabilityInvocation) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_7_list{}) + } + listValue := &_MsgUpdateDidDocPayload_7_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_delegation": + if len(x.CapabilityDelegation) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_8_list{}) + } + listValue := &_MsgUpdateDidDocPayload_8_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.key_agreement": + if len(x.KeyAgreement) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_9_list{}) + } + listValue := &_MsgUpdateDidDocPayload_9_list{list: &x.KeyAgreement} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.service": + if len(x.Service) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_10_list{}) + } + listValue := &_MsgUpdateDidDocPayload_10_list{list: &x.Service} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.also_known_as": + if len(x.AlsoKnownAs) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_11_list{}) + } + listValue := &_MsgUpdateDidDocPayload_11_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(listValue) + case "cheqd.did.v2.MsgUpdateDidDocPayload.version_id": + value := x.VersionId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocPayload 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_MsgUpdateDidDocPayload) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocPayload.context": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_1_list) + x.Context = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.id": + x.Id = value.Interface().(string) + case "cheqd.did.v2.MsgUpdateDidDocPayload.controller": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_3_list) + x.Controller = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.verification_method": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_4_list) + x.VerificationMethod = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.authentication": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_5_list) + x.Authentication = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.assertion_method": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_6_list) + x.AssertionMethod = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_invocation": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_7_list) + x.CapabilityInvocation = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_delegation": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_8_list) + x.CapabilityDelegation = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.key_agreement": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_9_list) + x.KeyAgreement = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.service": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_10_list) + x.Service = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.also_known_as": + lv := value.List() + clv := lv.(*_MsgUpdateDidDocPayload_11_list) + x.AlsoKnownAs = *clv.list + case "cheqd.did.v2.MsgUpdateDidDocPayload.version_id": + x.VersionId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocPayload 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_MsgUpdateDidDocPayload) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocPayload.context": + if x.Context == nil { + x.Context = []string{} + } + value := &_MsgUpdateDidDocPayload_1_list{list: &x.Context} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.controller": + if x.Controller == nil { + x.Controller = []string{} + } + value := &_MsgUpdateDidDocPayload_3_list{list: &x.Controller} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.verification_method": + if x.VerificationMethod == nil { + x.VerificationMethod = []*VerificationMethod{} + } + value := &_MsgUpdateDidDocPayload_4_list{list: &x.VerificationMethod} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.authentication": + if x.Authentication == nil { + x.Authentication = []string{} + } + value := &_MsgUpdateDidDocPayload_5_list{list: &x.Authentication} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.assertion_method": + if x.AssertionMethod == nil { + x.AssertionMethod = []string{} + } + value := &_MsgUpdateDidDocPayload_6_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_invocation": + if x.CapabilityInvocation == nil { + x.CapabilityInvocation = []string{} + } + value := &_MsgUpdateDidDocPayload_7_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_delegation": + if x.CapabilityDelegation == nil { + x.CapabilityDelegation = []string{} + } + value := &_MsgUpdateDidDocPayload_8_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.key_agreement": + if x.KeyAgreement == nil { + x.KeyAgreement = []string{} + } + value := &_MsgUpdateDidDocPayload_9_list{list: &x.KeyAgreement} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.service": + if x.Service == nil { + x.Service = []*Service{} + } + value := &_MsgUpdateDidDocPayload_10_list{list: &x.Service} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.also_known_as": + if x.AlsoKnownAs == nil { + x.AlsoKnownAs = []string{} + } + value := &_MsgUpdateDidDocPayload_11_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(value) + case "cheqd.did.v2.MsgUpdateDidDocPayload.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.MsgUpdateDidDocPayload is not mutable")) + case "cheqd.did.v2.MsgUpdateDidDocPayload.version_id": + panic(fmt.Errorf("field version_id of message cheqd.did.v2.MsgUpdateDidDocPayload is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocPayload 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_MsgUpdateDidDocPayload) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocPayload.context": + list := []string{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_1_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.MsgUpdateDidDocPayload.controller": + list := []string{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_3_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.verification_method": + list := []*VerificationMethod{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_4_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.authentication": + list := []string{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_5_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.assertion_method": + list := []string{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_6_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_invocation": + list := []string{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_7_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.capability_delegation": + list := []string{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_8_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.key_agreement": + list := []string{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_9_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.service": + list := []*Service{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_10_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.also_known_as": + list := []string{} + return protoreflect.ValueOfList(&_MsgUpdateDidDocPayload_11_list{list: &list}) + case "cheqd.did.v2.MsgUpdateDidDocPayload.version_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocPayload 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_MsgUpdateDidDocPayload) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgUpdateDidDocPayload", 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_MsgUpdateDidDocPayload) 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_MsgUpdateDidDocPayload) 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_MsgUpdateDidDocPayload) 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_MsgUpdateDidDocPayload) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateDidDocPayload) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Context) > 0 { + for _, s := range x.Context { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Controller) > 0 { + for _, s := range x.Controller { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.VerificationMethod) > 0 { + for _, e := range x.VerificationMethod { + l = options.Size(e) + 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)) + } + } + if len(x.AssertionMethod) > 0 { + for _, s := range x.AssertionMethod { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityInvocation) > 0 { + for _, s := range x.CapabilityInvocation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityDelegation) > 0 { + for _, s := range x.CapabilityDelegation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.KeyAgreement) > 0 { + for _, s := range x.KeyAgreement { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Service) > 0 { + for _, e := range x.Service { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.AlsoKnownAs) > 0 { + for _, s := range x.AlsoKnownAs { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.VersionId) + 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().(*MsgUpdateDidDocPayload) + 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.VersionId) > 0 { + i -= len(x.VersionId) + copy(dAtA[i:], x.VersionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VersionId))) + i-- + dAtA[i] = 0x62 + } + if len(x.AlsoKnownAs) > 0 { + for iNdEx := len(x.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AlsoKnownAs[iNdEx]) + copy(dAtA[i:], x.AlsoKnownAs[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AlsoKnownAs[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(x.Service) > 0 { + for iNdEx := len(x.Service) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Service[iNdEx]) + 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] = 0x52 + } + } + if len(x.KeyAgreement) > 0 { + for iNdEx := len(x.KeyAgreement) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.KeyAgreement[iNdEx]) + copy(dAtA[i:], x.KeyAgreement[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyAgreement[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(x.CapabilityDelegation) > 0 { + for iNdEx := len(x.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], x.CapabilityDelegation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityDelegation[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(x.CapabilityInvocation) > 0 { + for iNdEx := len(x.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], x.CapabilityInvocation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityInvocation[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(x.AssertionMethod) > 0 { + for iNdEx := len(x.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AssertionMethod[iNdEx]) + copy(dAtA[i:], x.AssertionMethod[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssertionMethod[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + 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] = 0x2a + } + } + if len(x.VerificationMethod) > 0 { + for iNdEx := len(x.VerificationMethod) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VerificationMethod[iNdEx]) + 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] = 0x22 + } + } + if len(x.Controller) > 0 { + for iNdEx := len(x.Controller) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Controller[iNdEx]) + copy(dAtA[i:], x.Controller[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0x12 + } + if len(x.Context) > 0 { + for iNdEx := len(x.Context) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Context[iNdEx]) + copy(dAtA[i:], x.Context[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Context[iNdEx]))) + 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().(*MsgUpdateDidDocPayload) + 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: MsgUpdateDidDocPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateDidDocPayload: 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 Context", 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.Context = append(x.Context, 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 Id", 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.Id = 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 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 = append(x.Controller, 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 VerificationMethod", 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 + } + x.VerificationMethod = append(x.VerificationMethod, &VerificationMethod{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VerificationMethod[len(x.VerificationMethod)-1]); 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 Authentication", 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.Authentication = append(x.Authentication, 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 AssertionMethod", 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.AssertionMethod = append(x.AssertionMethod, 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 CapabilityInvocation", 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.CapabilityInvocation = append(x.CapabilityInvocation, 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 CapabilityDelegation", 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.CapabilityDelegation = append(x.CapabilityDelegation, 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 KeyAgreement", 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.KeyAgreement = append(x.KeyAgreement, 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 Service", 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 + } + x.Service = append(x.Service, &Service{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service[len(x.Service)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AlsoKnownAs", 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.AlsoKnownAs = append(x.AlsoKnownAs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 12: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VersionId", 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.VersionId = 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_MsgUpdateDidDocResponse protoreflect.MessageDescriptor + fd_MsgUpdateDidDocResponse_value protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgUpdateDidDocResponse = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgUpdateDidDocResponse") + fd_MsgUpdateDidDocResponse_value = md_MsgUpdateDidDocResponse.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateDidDocResponse)(nil) + +type fastReflection_MsgUpdateDidDocResponse MsgUpdateDidDocResponse + +func (x *MsgUpdateDidDocResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateDidDocResponse)(x) +} + +func (x *MsgUpdateDidDocResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_tx_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_MsgUpdateDidDocResponse_messageType fastReflection_MsgUpdateDidDocResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateDidDocResponse_messageType{} + +type fastReflection_MsgUpdateDidDocResponse_messageType struct{} + +func (x fastReflection_MsgUpdateDidDocResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateDidDocResponse)(nil) +} +func (x fastReflection_MsgUpdateDidDocResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateDidDocResponse) +} +func (x fastReflection_MsgUpdateDidDocResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateDidDocResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateDidDocResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateDidDocResponse +} + +// 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_MsgUpdateDidDocResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateDidDocResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateDidDocResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateDidDocResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateDidDocResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateDidDocResponse)(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_MsgUpdateDidDocResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Value != nil { + value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + if !f(fd_MsgUpdateDidDocResponse_value, 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_MsgUpdateDidDocResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocResponse.value": + return x.Value != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocResponse 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_MsgUpdateDidDocResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocResponse.value": + x.Value = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocResponse 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_MsgUpdateDidDocResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocResponse.value": + value := x.Value + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocResponse 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_MsgUpdateDidDocResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocResponse.value": + x.Value = value.Message().Interface().(*DidDocWithMetadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocResponse 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_MsgUpdateDidDocResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocResponse.value": + if x.Value == nil { + x.Value = new(DidDocWithMetadata) + } + return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocResponse 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_MsgUpdateDidDocResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgUpdateDidDocResponse.value": + m := new(DidDocWithMetadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgUpdateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgUpdateDidDocResponse 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_MsgUpdateDidDocResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgUpdateDidDocResponse", 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_MsgUpdateDidDocResponse) 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_MsgUpdateDidDocResponse) 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_MsgUpdateDidDocResponse) 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_MsgUpdateDidDocResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateDidDocResponse) + 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.Value != nil { + l = options.Size(x.Value) + 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().(*MsgUpdateDidDocResponse) + 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.Value != nil { + encoded, err := options.Marshal(x.Value) + 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().(*MsgUpdateDidDocResponse) + 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: MsgUpdateDidDocResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateDidDocResponse: 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 Value", 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.Value == nil { + x.Value = &DidDocWithMetadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); 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_MsgDeactivateDidDocPayload protoreflect.MessageDescriptor + fd_MsgDeactivateDidDocPayload_id protoreflect.FieldDescriptor + fd_MsgDeactivateDidDocPayload_version_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgDeactivateDidDocPayload = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgDeactivateDidDocPayload") + fd_MsgDeactivateDidDocPayload_id = md_MsgDeactivateDidDocPayload.Fields().ByName("id") + fd_MsgDeactivateDidDocPayload_version_id = md_MsgDeactivateDidDocPayload.Fields().ByName("version_id") +} + +var _ protoreflect.Message = (*fastReflection_MsgDeactivateDidDocPayload)(nil) + +type fastReflection_MsgDeactivateDidDocPayload MsgDeactivateDidDocPayload + +func (x *MsgDeactivateDidDocPayload) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgDeactivateDidDocPayload)(x) +} + +func (x *MsgDeactivateDidDocPayload) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_MsgDeactivateDidDocPayload_messageType fastReflection_MsgDeactivateDidDocPayload_messageType +var _ protoreflect.MessageType = fastReflection_MsgDeactivateDidDocPayload_messageType{} + +type fastReflection_MsgDeactivateDidDocPayload_messageType struct{} + +func (x fastReflection_MsgDeactivateDidDocPayload_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgDeactivateDidDocPayload)(nil) +} +func (x fastReflection_MsgDeactivateDidDocPayload_messageType) New() protoreflect.Message { + return new(fastReflection_MsgDeactivateDidDocPayload) +} +func (x fastReflection_MsgDeactivateDidDocPayload_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDeactivateDidDocPayload +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgDeactivateDidDocPayload) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDeactivateDidDocPayload +} + +// 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_MsgDeactivateDidDocPayload) Type() protoreflect.MessageType { + return _fastReflection_MsgDeactivateDidDocPayload_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgDeactivateDidDocPayload) New() protoreflect.Message { + return new(fastReflection_MsgDeactivateDidDocPayload) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgDeactivateDidDocPayload) Interface() protoreflect.ProtoMessage { + return (*MsgDeactivateDidDocPayload)(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_MsgDeactivateDidDocPayload) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_MsgDeactivateDidDocPayload_id, value) { + return + } + } + if x.VersionId != "" { + value := protoreflect.ValueOfString(x.VersionId) + if !f(fd_MsgDeactivateDidDocPayload_version_id, 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_MsgDeactivateDidDocPayload) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocPayload.id": + return x.Id != "" + case "cheqd.did.v2.MsgDeactivateDidDocPayload.version_id": + return x.VersionId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocPayload 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_MsgDeactivateDidDocPayload) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocPayload.id": + x.Id = "" + case "cheqd.did.v2.MsgDeactivateDidDocPayload.version_id": + x.VersionId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocPayload 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_MsgDeactivateDidDocPayload) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocPayload.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.did.v2.MsgDeactivateDidDocPayload.version_id": + value := x.VersionId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocPayload 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_MsgDeactivateDidDocPayload) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocPayload.id": + x.Id = value.Interface().(string) + case "cheqd.did.v2.MsgDeactivateDidDocPayload.version_id": + x.VersionId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocPayload 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_MsgDeactivateDidDocPayload) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocPayload.id": + panic(fmt.Errorf("field id of message cheqd.did.v2.MsgDeactivateDidDocPayload is not mutable")) + case "cheqd.did.v2.MsgDeactivateDidDocPayload.version_id": + panic(fmt.Errorf("field version_id of message cheqd.did.v2.MsgDeactivateDidDocPayload is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocPayload 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_MsgDeactivateDidDocPayload) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocPayload.id": + return protoreflect.ValueOfString("") + case "cheqd.did.v2.MsgDeactivateDidDocPayload.version_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocPayload")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocPayload 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_MsgDeactivateDidDocPayload) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgDeactivateDidDocPayload", 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_MsgDeactivateDidDocPayload) 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_MsgDeactivateDidDocPayload) 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_MsgDeactivateDidDocPayload) 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_MsgDeactivateDidDocPayload) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgDeactivateDidDocPayload) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.VersionId) + 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().(*MsgDeactivateDidDocPayload) + 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.VersionId) > 0 { + i -= len(x.VersionId) + copy(dAtA[i:], x.VersionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VersionId))) + 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))) + 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().(*MsgDeactivateDidDocPayload) + 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: MsgDeactivateDidDocPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDeactivateDidDocPayload: 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 Id", 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.Id = 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 VersionId", 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.VersionId = 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_MsgDeactivateDidDocResponse protoreflect.MessageDescriptor + fd_MsgDeactivateDidDocResponse_value protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_did_v2_tx_proto_init() + md_MsgDeactivateDidDocResponse = File_cheqd_did_v2_tx_proto.Messages().ByName("MsgDeactivateDidDocResponse") + fd_MsgDeactivateDidDocResponse_value = md_MsgDeactivateDidDocResponse.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_MsgDeactivateDidDocResponse)(nil) + +type fastReflection_MsgDeactivateDidDocResponse MsgDeactivateDidDocResponse + +func (x *MsgDeactivateDidDocResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgDeactivateDidDocResponse)(x) +} + +func (x *MsgDeactivateDidDocResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_did_v2_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_MsgDeactivateDidDocResponse_messageType fastReflection_MsgDeactivateDidDocResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgDeactivateDidDocResponse_messageType{} + +type fastReflection_MsgDeactivateDidDocResponse_messageType struct{} + +func (x fastReflection_MsgDeactivateDidDocResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgDeactivateDidDocResponse)(nil) +} +func (x fastReflection_MsgDeactivateDidDocResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgDeactivateDidDocResponse) +} +func (x fastReflection_MsgDeactivateDidDocResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDeactivateDidDocResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgDeactivateDidDocResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDeactivateDidDocResponse +} + +// 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_MsgDeactivateDidDocResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgDeactivateDidDocResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgDeactivateDidDocResponse) New() protoreflect.Message { + return new(fastReflection_MsgDeactivateDidDocResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgDeactivateDidDocResponse) Interface() protoreflect.ProtoMessage { + return (*MsgDeactivateDidDocResponse)(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_MsgDeactivateDidDocResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Value != nil { + value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + if !f(fd_MsgDeactivateDidDocResponse_value, 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_MsgDeactivateDidDocResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocResponse.value": + return x.Value != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocResponse 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_MsgDeactivateDidDocResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocResponse.value": + x.Value = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocResponse 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_MsgDeactivateDidDocResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocResponse.value": + value := x.Value + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocResponse 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_MsgDeactivateDidDocResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocResponse.value": + x.Value = value.Message().Interface().(*DidDocWithMetadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocResponse 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_MsgDeactivateDidDocResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocResponse.value": + if x.Value == nil { + x.Value = new(DidDocWithMetadata) + } + return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocResponse 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_MsgDeactivateDidDocResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.did.v2.MsgDeactivateDidDocResponse.value": + m := new(DidDocWithMetadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.did.v2.MsgDeactivateDidDocResponse")) + } + panic(fmt.Errorf("message cheqd.did.v2.MsgDeactivateDidDocResponse 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_MsgDeactivateDidDocResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.did.v2.MsgDeactivateDidDocResponse", 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_MsgDeactivateDidDocResponse) 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_MsgDeactivateDidDocResponse) 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_MsgDeactivateDidDocResponse) 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_MsgDeactivateDidDocResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgDeactivateDidDocResponse) + 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.Value != nil { + l = options.Size(x.Value) + 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().(*MsgDeactivateDidDocResponse) + 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.Value != nil { + encoded, err := options.Marshal(x.Value) + 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().(*MsgDeactivateDidDocResponse) + 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: MsgDeactivateDidDocResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDeactivateDidDocResponse: 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 Value", 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.Value == nil { + x.Value = &DidDocWithMetadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cheqd/did/v2/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) +) + +// MsgCreateDidDoc defines the Msg/CreateDidDoc request type. +// It describes the parameters of a request for creating a new DID document. +type MsgCreateDidDoc struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Payload containing the DID Document to be created + Payload *MsgCreateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Signatures of the DID Document's controller(s) + Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (x *MsgCreateDidDoc) Reset() { + *x = MsgCreateDidDoc{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateDidDoc) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateDidDoc) ProtoMessage() {} + +// Deprecated: Use MsgCreateDidDoc.ProtoReflect.Descriptor instead. +func (*MsgCreateDidDoc) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgCreateDidDoc) GetPayload() *MsgCreateDidDocPayload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *MsgCreateDidDoc) GetSignatures() []*SignInfo { + if x != nil { + return x.Signatures + } + return nil +} + +// MsgUpdateDidDoc defines the Msg/UpdateDidDoc request type. +// It describes the parameters of a request for updating an existing DID document. +type MsgUpdateDidDoc struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Payload containing the DID Document to be updated. This should be updated the DID Document. + Payload *MsgUpdateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Signatures of the DID Document's controller(s) + Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (x *MsgUpdateDidDoc) Reset() { + *x = MsgUpdateDidDoc{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateDidDoc) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateDidDoc) ProtoMessage() {} + +// Deprecated: Use MsgUpdateDidDoc.ProtoReflect.Descriptor instead. +func (*MsgUpdateDidDoc) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgUpdateDidDoc) GetPayload() *MsgUpdateDidDocPayload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *MsgUpdateDidDoc) GetSignatures() []*SignInfo { + if x != nil { + return x.Signatures + } + return nil +} + +// MsgDeactivateDidDoc defines the Msg/DeactivateDidDoc request type. +// It describes the parameters of a request for deactivating an existing DID document. +type MsgDeactivateDidDoc struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Payload containing the DID Document to be deactivated + Payload *MsgDeactivateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Signatures of the DID Document's controller(s) + Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (x *MsgDeactivateDidDoc) Reset() { + *x = MsgDeactivateDidDoc{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgDeactivateDidDoc) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgDeactivateDidDoc) ProtoMessage() {} + +// Deprecated: Use MsgDeactivateDidDoc.ProtoReflect.Descriptor instead. +func (*MsgDeactivateDidDoc) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgDeactivateDidDoc) GetPayload() *MsgDeactivateDidDocPayload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *MsgDeactivateDidDoc) GetSignatures() []*SignInfo { + if x != nil { + return x.Signatures + } + return nil +} + +// SignInfo defines the structure of a DID Document controller's signature +type SignInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Verification method ID of the DID Controller + VerificationMethodId string `protobuf:"bytes,1,opt,name=verification_method_id,json=verificationMethodId,proto3" json:"verification_method_id,omitempty"` + // Signature of the DID Document controller + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignInfo) Reset() { + *x = SignInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignInfo) ProtoMessage() {} + +// Deprecated: Use SignInfo.ProtoReflect.Descriptor instead. +func (*SignInfo) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *SignInfo) GetVerificationMethodId() string { + if x != nil { + return x.VerificationMethodId + } + return "" +} + +func (x *SignInfo) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// MsgCreateDidDocPayload defines the structure of the payload for creating a new DID document +type MsgCreateDidDocPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 + Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` + // id is the DID of the DID document. + // Format: did:cheqd:: + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // controller is a list of DIDs that are allowed to control the DID document. + Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. + // Documentation: https://www.w3.org/TR/did-core/#verification-methods + // + // Required fields: + // - id: A unique identifier for the verification method + // - type: A supported verification method type (supported: Ed25519VerificationKey2018, Ed25519VerificationKey2020, JsonWebKey2020) + // - controller: DID of the controller of the verification method + // - verification_material: Public key of the verification method (supported: publicJwk, publicKeyBase58, publicKeyMultibase) + VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. + Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. + AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. + CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. + CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. + KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` + // service is a list of services that can be used to interact with the DID subject. + // Documentation: https://www.w3.org/TR/did-core/#services + // + // Required fields: + // - id: A unique identifier for the service + // - type: A service type defined in DID Specification Registries + // - service_endpoint: Service endpoint(s), provided as a URI or set of URIs + Service []*Service `protobuf:"bytes,10,rep,name=service,proto3" json:"service,omitempty"` + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. + AlsoKnownAs []string `protobuf:"bytes,11,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` + // Version ID of the DID Document to be created + // + // Format: + VersionId string `protobuf:"bytes,12,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` +} + +func (x *MsgCreateDidDocPayload) Reset() { + *x = MsgCreateDidDocPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateDidDocPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateDidDocPayload) ProtoMessage() {} + +// Deprecated: Use MsgCreateDidDocPayload.ProtoReflect.Descriptor instead. +func (*MsgCreateDidDocPayload) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgCreateDidDocPayload) GetContext() []string { + if x != nil { + return x.Context + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MsgCreateDidDocPayload) GetController() []string { + if x != nil { + return x.Controller + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetVerificationMethod() []*VerificationMethod { + if x != nil { + return x.VerificationMethod + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetAuthentication() []string { + if x != nil { + return x.Authentication + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetAssertionMethod() []string { + if x != nil { + return x.AssertionMethod + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetCapabilityInvocation() []string { + if x != nil { + return x.CapabilityInvocation + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetCapabilityDelegation() []string { + if x != nil { + return x.CapabilityDelegation + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetKeyAgreement() []string { + if x != nil { + return x.KeyAgreement + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetService() []*Service { + if x != nil { + return x.Service + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetAlsoKnownAs() []string { + if x != nil { + return x.AlsoKnownAs + } + return nil +} + +func (x *MsgCreateDidDocPayload) GetVersionId() string { + if x != nil { + return x.VersionId + } + return "" +} + +// MsgCreateDidDocResponse defines response type for Msg/CreateDidDoc. +type MsgCreateDidDocResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Return the created DID Document with metadata + Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *MsgCreateDidDocResponse) Reset() { + *x = MsgCreateDidDocResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateDidDocResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateDidDocResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateDidDocResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateDidDocResponse) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{5} +} + +func (x *MsgCreateDidDocResponse) GetValue() *DidDocWithMetadata { + if x != nil { + return x.Value + } + return nil +} + +// MsgUpdateDidDocPayload defines the structure of the payload for updating an existing DID document +type MsgUpdateDidDocPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 + Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` + // id is the DID of the DID document. + // Format: did:cheqd:: + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // controller is a list of DIDs that are allowed to control the DID document. + Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. + // Documentation: https://www.w3.org/TR/did-core/#verification-methods + // + // Required fields: + // - id: A unique identifier for the verification method + // - type: A supported verification method type (supported: Ed25519VerificationKey2018, Ed25519VerificationKey2020, JsonWebKey2020) + // - controller: DID of the controller of the verification method + // - verification_material: Public key of the verification method (supported: publicJwk, publicKeyBase58, publicKeyMultibase) + VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. + Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. + AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. + CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. + CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. + KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` + // service is a list of services that can be used to interact with the DID subject. + // Documentation: https://www.w3.org/TR/did-core/#services + // + // Required fields: + // - id: A unique identifier for the service + // - type: A service type defined in DID Specification Registries + // - service_endpoint: Service endpoint(s), provided as a URI or set of URIs + Service []*Service `protobuf:"bytes,10,rep,name=service,proto3" json:"service,omitempty"` + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. + AlsoKnownAs []string `protobuf:"bytes,11,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` + // Updated version ID of the DID Document. + // Links to next/previous versions of the DID Document will be automatically updated. + // + // Format: + VersionId string `protobuf:"bytes,12,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` +} + +func (x *MsgUpdateDidDocPayload) Reset() { + *x = MsgUpdateDidDocPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateDidDocPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateDidDocPayload) ProtoMessage() {} + +// Deprecated: Use MsgUpdateDidDocPayload.ProtoReflect.Descriptor instead. +func (*MsgUpdateDidDocPayload) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgUpdateDidDocPayload) GetContext() []string { + if x != nil { + return x.Context + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MsgUpdateDidDocPayload) GetController() []string { + if x != nil { + return x.Controller + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetVerificationMethod() []*VerificationMethod { + if x != nil { + return x.VerificationMethod + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetAuthentication() []string { + if x != nil { + return x.Authentication + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetAssertionMethod() []string { + if x != nil { + return x.AssertionMethod + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetCapabilityInvocation() []string { + if x != nil { + return x.CapabilityInvocation + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetCapabilityDelegation() []string { + if x != nil { + return x.CapabilityDelegation + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetKeyAgreement() []string { + if x != nil { + return x.KeyAgreement + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetService() []*Service { + if x != nil { + return x.Service + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetAlsoKnownAs() []string { + if x != nil { + return x.AlsoKnownAs + } + return nil +} + +func (x *MsgUpdateDidDocPayload) GetVersionId() string { + if x != nil { + return x.VersionId + } + return "" +} + +type MsgUpdateDidDocResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Return the updated DID Document with metadata + Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *MsgUpdateDidDocResponse) Reset() { + *x = MsgUpdateDidDocResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateDidDocResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateDidDocResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateDidDocResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateDidDocResponse) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{7} +} + +func (x *MsgUpdateDidDocResponse) GetValue() *DidDocWithMetadata { + if x != nil { + return x.Value + } + return nil +} + +// MsgDeactivateDidDocPayload defines the structure of the payload for deactivating an existing DID document +type MsgDeactivateDidDocPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique identifier of the DID Document to be deactivated + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Version ID of the DID Document to be deactivated + // This is primarily used as a sanity check to ensure that the correct DID Document is being deactivated. + VersionId string `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` +} + +func (x *MsgDeactivateDidDocPayload) Reset() { + *x = MsgDeactivateDidDocPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgDeactivateDidDocPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgDeactivateDidDocPayload) ProtoMessage() {} + +// Deprecated: Use MsgDeactivateDidDocPayload.ProtoReflect.Descriptor instead. +func (*MsgDeactivateDidDocPayload) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgDeactivateDidDocPayload) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MsgDeactivateDidDocPayload) GetVersionId() string { + if x != nil { + return x.VersionId + } + return "" +} + +// MsgDeactivateDidDocResponse defines response type for Msg/DeactivateDidDoc. +type MsgDeactivateDidDocResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Return the deactivated DID Document with metadata + Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *MsgDeactivateDidDocResponse) Reset() { + *x = MsgDeactivateDidDocResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_did_v2_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgDeactivateDidDocResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgDeactivateDidDocResponse) ProtoMessage() {} + +// Deprecated: Use MsgDeactivateDidDocResponse.ProtoReflect.Descriptor instead. +func (*MsgDeactivateDidDocResponse) Descriptor() ([]byte, []int) { + return file_cheqd_did_v2_tx_proto_rawDescGZIP(), []int{9} +} + +func (x *MsgDeactivateDidDocResponse) GetValue() *DidDocWithMetadata { + if x != nil { + return x.Value + } + return nil +} + +var File_cheqd_did_v2_tx_proto protoreflect.FileDescriptor + +var file_cheqd_did_v2_tx_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x74, + 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x32, 0x1a, 0x19, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, + 0x2f, 0x76, 0x32, 0x2f, 0x64, 0x69, 0x64, 0x64, 0x6f, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x89, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, + 0x64, 0x44, 0x6f, 0x63, 0x12, 0x3e, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, + 0x64, 0x44, 0x6f, 0x63, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x89, 0x01, 0x0a, + 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, + 0x12, 0x3e, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x12, 0x36, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, + 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, + 0x12, 0x42, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, + 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x69, + 0x64, 0x44, 0x6f, 0x63, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x5e, 0x0a, 0x08, + 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x34, 0x0a, 0x16, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8b, 0x04, 0x0a, + 0x16, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x12, 0x51, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 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, 0x06, 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, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x07, 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, 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, 0x08, 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, 0x23, 0x0a, 0x0d, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x67, 0x72, 0x65, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6b, 0x65, 0x79, 0x41, 0x67, 0x72, + 0x65, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x6c, 0x73, 0x6f, 0x5f, + 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, + 0x61, 0x6c, 0x73, 0x6f, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x41, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x51, 0x0a, 0x17, 0x4d, 0x73, + 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8b, 0x04, + 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, + 0x63, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x12, 0x51, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 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, 0x06, 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, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x07, 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, 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, 0x08, 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, 0x23, 0x0a, 0x0d, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x67, 0x72, 0x65, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6b, 0x65, 0x79, 0x41, 0x67, + 0x72, 0x65, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x6c, 0x73, 0x6f, + 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0b, 0x61, 0x6c, 0x73, 0x6f, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x41, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x51, 0x0a, 0x17, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x57, 0x69, 0x74, 0x68, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4b, + 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, + 0x69, 0x64, 0x44, 0x6f, 0x63, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x1b, 0x4d, + 0x73, 0x67, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, + 0x6f, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x65, 0x71, + 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x57, + 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x32, 0x93, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x54, 0x0a, 0x0c, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x12, 0x1d, 0x2e, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x1a, 0x25, 0x2e, 0x63, 0x68, 0x65, 0x71, + 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x54, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, + 0x12, 0x1d, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x1a, + 0x25, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x10, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x12, 0x21, 0x2e, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, 0x1a, 0x29, 0x2e, + 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x73, 0x67, + 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x69, 0x64, 0x44, 0x6f, 0x63, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa1, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x42, 0x07, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, + 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, + 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, + 0x44, 0x58, 0xaa, 0x02, 0x0c, 0x43, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x44, 0x69, 0x64, 0x2e, 0x56, + 0x32, 0xca, 0x02, 0x0c, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x32, + 0xe2, 0x02, 0x18, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x32, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x43, 0x68, + 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_did_v2_tx_proto_rawDescOnce sync.Once + file_cheqd_did_v2_tx_proto_rawDescData = file_cheqd_did_v2_tx_proto_rawDesc +) + +func file_cheqd_did_v2_tx_proto_rawDescGZIP() []byte { + file_cheqd_did_v2_tx_proto_rawDescOnce.Do(func() { + file_cheqd_did_v2_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_did_v2_tx_proto_rawDescData) + }) + return file_cheqd_did_v2_tx_proto_rawDescData +} + +var file_cheqd_did_v2_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_cheqd_did_v2_tx_proto_goTypes = []interface{}{ + (*MsgCreateDidDoc)(nil), // 0: cheqd.did.v2.MsgCreateDidDoc + (*MsgUpdateDidDoc)(nil), // 1: cheqd.did.v2.MsgUpdateDidDoc + (*MsgDeactivateDidDoc)(nil), // 2: cheqd.did.v2.MsgDeactivateDidDoc + (*SignInfo)(nil), // 3: cheqd.did.v2.SignInfo + (*MsgCreateDidDocPayload)(nil), // 4: cheqd.did.v2.MsgCreateDidDocPayload + (*MsgCreateDidDocResponse)(nil), // 5: cheqd.did.v2.MsgCreateDidDocResponse + (*MsgUpdateDidDocPayload)(nil), // 6: cheqd.did.v2.MsgUpdateDidDocPayload + (*MsgUpdateDidDocResponse)(nil), // 7: cheqd.did.v2.MsgUpdateDidDocResponse + (*MsgDeactivateDidDocPayload)(nil), // 8: cheqd.did.v2.MsgDeactivateDidDocPayload + (*MsgDeactivateDidDocResponse)(nil), // 9: cheqd.did.v2.MsgDeactivateDidDocResponse + (*VerificationMethod)(nil), // 10: cheqd.did.v2.VerificationMethod + (*Service)(nil), // 11: cheqd.did.v2.Service + (*DidDocWithMetadata)(nil), // 12: cheqd.did.v2.DidDocWithMetadata +} +var file_cheqd_did_v2_tx_proto_depIdxs = []int32{ + 4, // 0: cheqd.did.v2.MsgCreateDidDoc.payload:type_name -> cheqd.did.v2.MsgCreateDidDocPayload + 3, // 1: cheqd.did.v2.MsgCreateDidDoc.signatures:type_name -> cheqd.did.v2.SignInfo + 6, // 2: cheqd.did.v2.MsgUpdateDidDoc.payload:type_name -> cheqd.did.v2.MsgUpdateDidDocPayload + 3, // 3: cheqd.did.v2.MsgUpdateDidDoc.signatures:type_name -> cheqd.did.v2.SignInfo + 8, // 4: cheqd.did.v2.MsgDeactivateDidDoc.payload:type_name -> cheqd.did.v2.MsgDeactivateDidDocPayload + 3, // 5: cheqd.did.v2.MsgDeactivateDidDoc.signatures:type_name -> cheqd.did.v2.SignInfo + 10, // 6: cheqd.did.v2.MsgCreateDidDocPayload.verification_method:type_name -> cheqd.did.v2.VerificationMethod + 11, // 7: cheqd.did.v2.MsgCreateDidDocPayload.service:type_name -> cheqd.did.v2.Service + 12, // 8: cheqd.did.v2.MsgCreateDidDocResponse.value:type_name -> cheqd.did.v2.DidDocWithMetadata + 10, // 9: cheqd.did.v2.MsgUpdateDidDocPayload.verification_method:type_name -> cheqd.did.v2.VerificationMethod + 11, // 10: cheqd.did.v2.MsgUpdateDidDocPayload.service:type_name -> cheqd.did.v2.Service + 12, // 11: cheqd.did.v2.MsgUpdateDidDocResponse.value:type_name -> cheqd.did.v2.DidDocWithMetadata + 12, // 12: cheqd.did.v2.MsgDeactivateDidDocResponse.value:type_name -> cheqd.did.v2.DidDocWithMetadata + 0, // 13: cheqd.did.v2.Msg.CreateDidDoc:input_type -> cheqd.did.v2.MsgCreateDidDoc + 1, // 14: cheqd.did.v2.Msg.UpdateDidDoc:input_type -> cheqd.did.v2.MsgUpdateDidDoc + 2, // 15: cheqd.did.v2.Msg.DeactivateDidDoc:input_type -> cheqd.did.v2.MsgDeactivateDidDoc + 5, // 16: cheqd.did.v2.Msg.CreateDidDoc:output_type -> cheqd.did.v2.MsgCreateDidDocResponse + 7, // 17: cheqd.did.v2.Msg.UpdateDidDoc:output_type -> cheqd.did.v2.MsgUpdateDidDocResponse + 9, // 18: cheqd.did.v2.Msg.DeactivateDidDoc:output_type -> cheqd.did.v2.MsgDeactivateDidDocResponse + 16, // [16:19] is the sub-list for method output_type + 13, // [13:16] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_cheqd_did_v2_tx_proto_init() } +func file_cheqd_did_v2_tx_proto_init() { + if File_cheqd_did_v2_tx_proto != nil { + return + } + file_cheqd_did_v2_diddoc_proto_init() + if !protoimpl.UnsafeEnabled { + file_cheqd_did_v2_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateDidDoc); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateDidDoc); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgDeactivateDidDoc); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateDidDocPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateDidDocResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateDidDocPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateDidDocResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgDeactivateDidDocPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_did_v2_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgDeactivateDidDocResponse); 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_cheqd_did_v2_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cheqd_did_v2_tx_proto_goTypes, + DependencyIndexes: file_cheqd_did_v2_tx_proto_depIdxs, + MessageInfos: file_cheqd_did_v2_tx_proto_msgTypes, + }.Build() + File_cheqd_did_v2_tx_proto = out.File + file_cheqd_did_v2_tx_proto_rawDesc = nil + file_cheqd_did_v2_tx_proto_goTypes = nil + file_cheqd_did_v2_tx_proto_depIdxs = nil +} diff --git a/api/cheqd/did/v2/tx_grpc.pb.go b/api/cheqd/did/v2/tx_grpc.pb.go new file mode 100644 index 000000000..ca50aabc9 --- /dev/null +++ b/api/cheqd/did/v2/tx_grpc.pb.go @@ -0,0 +1,183 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: cheqd/did/v2/tx.proto + +package didv2 + +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 + +// 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 { + // CreateDidDoc defines a method for creating a new DID document + CreateDidDoc(ctx context.Context, in *MsgCreateDidDoc, opts ...grpc.CallOption) (*MsgCreateDidDocResponse, error) + // UpdateDidDoc defines a method for updating an existing DID document + UpdateDidDoc(ctx context.Context, in *MsgUpdateDidDoc, opts ...grpc.CallOption) (*MsgUpdateDidDocResponse, error) + // DeactivateDidDoc defines a method for deactivating an existing DID document + DeactivateDidDoc(ctx context.Context, in *MsgDeactivateDidDoc, opts ...grpc.CallOption) (*MsgDeactivateDidDocResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateDidDoc(ctx context.Context, in *MsgCreateDidDoc, opts ...grpc.CallOption) (*MsgCreateDidDocResponse, error) { + out := new(MsgCreateDidDocResponse) + err := c.cc.Invoke(ctx, "/cheqd.did.v2.Msg/CreateDidDoc", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateDidDoc(ctx context.Context, in *MsgUpdateDidDoc, opts ...grpc.CallOption) (*MsgUpdateDidDocResponse, error) { + out := new(MsgUpdateDidDocResponse) + err := c.cc.Invoke(ctx, "/cheqd.did.v2.Msg/UpdateDidDoc", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DeactivateDidDoc(ctx context.Context, in *MsgDeactivateDidDoc, opts ...grpc.CallOption) (*MsgDeactivateDidDocResponse, error) { + out := new(MsgDeactivateDidDocResponse) + err := c.cc.Invoke(ctx, "/cheqd.did.v2.Msg/DeactivateDidDoc", 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 { + // CreateDidDoc defines a method for creating a new DID document + CreateDidDoc(context.Context, *MsgCreateDidDoc) (*MsgCreateDidDocResponse, error) + // UpdateDidDoc defines a method for updating an existing DID document + UpdateDidDoc(context.Context, *MsgUpdateDidDoc) (*MsgUpdateDidDocResponse, error) + // DeactivateDidDoc defines a method for deactivating an existing DID document + DeactivateDidDoc(context.Context, *MsgDeactivateDidDoc) (*MsgDeactivateDidDocResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) CreateDidDoc(context.Context, *MsgCreateDidDoc) (*MsgCreateDidDocResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDidDoc not implemented") +} +func (UnimplementedMsgServer) UpdateDidDoc(context.Context, *MsgUpdateDidDoc) (*MsgUpdateDidDocResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDidDoc not implemented") +} +func (UnimplementedMsgServer) DeactivateDidDoc(context.Context, *MsgDeactivateDidDoc) (*MsgDeactivateDidDocResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeactivateDidDoc 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_CreateDidDoc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateDidDoc) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateDidDoc(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.did.v2.Msg/CreateDidDoc", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateDidDoc(ctx, req.(*MsgCreateDidDoc)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateDidDoc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateDidDoc) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateDidDoc(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.did.v2.Msg/UpdateDidDoc", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateDidDoc(ctx, req.(*MsgUpdateDidDoc)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DeactivateDidDoc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeactivateDidDoc) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DeactivateDidDoc(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.did.v2.Msg/DeactivateDidDoc", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DeactivateDidDoc(ctx, req.(*MsgDeactivateDidDoc)) + } + 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: "cheqd.did.v2.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateDidDoc", + Handler: _Msg_CreateDidDoc_Handler, + }, + { + MethodName: "UpdateDidDoc", + Handler: _Msg_UpdateDidDoc_Handler, + }, + { + MethodName: "DeactivateDidDoc", + Handler: _Msg_DeactivateDidDoc_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cheqd/did/v2/tx.proto", +} diff --git a/api/cheqd/resource/v2/fee.pulsar.go b/api/cheqd/resource/v2/fee.pulsar.go new file mode 100644 index 000000000..8d3febb13 --- /dev/null +++ b/api/cheqd/resource/v2/fee.pulsar.go @@ -0,0 +1,870 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package resourcev2 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/v1beta1" + _ "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_FeeParams protoreflect.MessageDescriptor + fd_FeeParams_image protoreflect.FieldDescriptor + fd_FeeParams_json protoreflect.FieldDescriptor + fd_FeeParams_default protoreflect.FieldDescriptor + fd_FeeParams_burn_factor protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_fee_proto_init() + md_FeeParams = File_cheqd_resource_v2_fee_proto.Messages().ByName("FeeParams") + fd_FeeParams_image = md_FeeParams.Fields().ByName("image") + fd_FeeParams_json = md_FeeParams.Fields().ByName("json") + fd_FeeParams_default = md_FeeParams.Fields().ByName("default") + fd_FeeParams_burn_factor = md_FeeParams.Fields().ByName("burn_factor") +} + +var _ protoreflect.Message = (*fastReflection_FeeParams)(nil) + +type fastReflection_FeeParams FeeParams + +func (x *FeeParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_FeeParams)(x) +} + +func (x *FeeParams) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_fee_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_FeeParams_messageType fastReflection_FeeParams_messageType +var _ protoreflect.MessageType = fastReflection_FeeParams_messageType{} + +type fastReflection_FeeParams_messageType struct{} + +func (x fastReflection_FeeParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_FeeParams)(nil) +} +func (x fastReflection_FeeParams_messageType) New() protoreflect.Message { + return new(fastReflection_FeeParams) +} +func (x fastReflection_FeeParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_FeeParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_FeeParams) Descriptor() protoreflect.MessageDescriptor { + return md_FeeParams +} + +// 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_FeeParams) Type() protoreflect.MessageType { + return _fastReflection_FeeParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_FeeParams) New() protoreflect.Message { + return new(fastReflection_FeeParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_FeeParams) Interface() protoreflect.ProtoMessage { + return (*FeeParams)(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_FeeParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Image != nil { + value := protoreflect.ValueOfMessage(x.Image.ProtoReflect()) + if !f(fd_FeeParams_image, value) { + return + } + } + if x.Json != nil { + value := protoreflect.ValueOfMessage(x.Json.ProtoReflect()) + if !f(fd_FeeParams_json, value) { + return + } + } + if x.Default != nil { + value := protoreflect.ValueOfMessage(x.Default.ProtoReflect()) + if !f(fd_FeeParams_default, value) { + return + } + } + if x.BurnFactor != "" { + value := protoreflect.ValueOfString(x.BurnFactor) + if !f(fd_FeeParams_burn_factor, 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_FeeParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.FeeParams.image": + return x.Image != nil + case "cheqd.resource.v2.FeeParams.json": + return x.Json != nil + case "cheqd.resource.v2.FeeParams.default": + return x.Default != nil + case "cheqd.resource.v2.FeeParams.burn_factor": + return x.BurnFactor != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.resource.v2.FeeParams 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_FeeParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.FeeParams.image": + x.Image = nil + case "cheqd.resource.v2.FeeParams.json": + x.Json = nil + case "cheqd.resource.v2.FeeParams.default": + x.Default = nil + case "cheqd.resource.v2.FeeParams.burn_factor": + x.BurnFactor = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.resource.v2.FeeParams 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_FeeParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.FeeParams.image": + value := x.Image + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.json": + value := x.Json + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.default": + value := x.Default + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.burn_factor": + value := x.BurnFactor + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.resource.v2.FeeParams 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_FeeParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.FeeParams.image": + x.Image = value.Message().Interface().(*v1beta1.Coin) + case "cheqd.resource.v2.FeeParams.json": + x.Json = value.Message().Interface().(*v1beta1.Coin) + case "cheqd.resource.v2.FeeParams.default": + x.Default = value.Message().Interface().(*v1beta1.Coin) + case "cheqd.resource.v2.FeeParams.burn_factor": + x.BurnFactor = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.resource.v2.FeeParams 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_FeeParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.FeeParams.image": + if x.Image == nil { + x.Image = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Image.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.json": + if x.Json == nil { + x.Json = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Json.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.default": + if x.Default == nil { + x.Default = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Default.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.burn_factor": + panic(fmt.Errorf("field burn_factor of message cheqd.resource.v2.FeeParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.resource.v2.FeeParams 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_FeeParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.FeeParams.image": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.json": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.default": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.resource.v2.FeeParams.burn_factor": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.FeeParams")) + } + panic(fmt.Errorf("message cheqd.resource.v2.FeeParams 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_FeeParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.FeeParams", 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_FeeParams) 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_FeeParams) 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_FeeParams) 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_FeeParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*FeeParams) + 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.Image != nil { + l = options.Size(x.Image) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Json != nil { + l = options.Size(x.Json) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Default != nil { + l = options.Size(x.Default) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.BurnFactor) + 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().(*FeeParams) + 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.BurnFactor) > 0 { + i -= len(x.BurnFactor) + copy(dAtA[i:], x.BurnFactor) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BurnFactor))) + i-- + dAtA[i] = 0x22 + } + if x.Default != nil { + encoded, err := options.Marshal(x.Default) + 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.Json != nil { + encoded, err := options.Marshal(x.Json) + 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 x.Image != nil { + encoded, err := options.Marshal(x.Image) + 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().(*FeeParams) + 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: FeeParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FeeParams: 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 Image", 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.Image == nil { + x.Image = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Image); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Json", 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.Json == nil { + x.Json = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Json); 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 Default", 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.Default == nil { + x.Default = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Default); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BurnFactor", 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.BurnFactor = 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: cheqd/resource/v2/fee.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) +) + +// FeeParams defines the parameters for the cheqd Resource module fixed fee. +// Creation requests for different IANA media types are charged different fees. +type FeeParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Fixed fee for creating a resource with media type 'image/*' + // + // Default: 10 CHEQ or 10000000000ncheq + Image *v1beta1.Coin `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + // Fixed fee for creating a resource with media type 'application/json' + // + // Default: 2.5 CHEQ or 2500000000ncheq + Json *v1beta1.Coin `protobuf:"bytes,2,opt,name=json,proto3" json:"json,omitempty"` + // Fixed fee for creating a resource with all other media types + // + // Default: 5 CHEQ or 5000000000ncheq + Default *v1beta1.Coin `protobuf:"bytes,3,opt,name=default,proto3" json:"default,omitempty"` + // Percentage of the fixed fee that will be burned + // + // Default: 0.5 (50%) + BurnFactor string `protobuf:"bytes,4,opt,name=burn_factor,json=burnFactor,proto3" json:"burn_factor,omitempty"` +} + +func (x *FeeParams) Reset() { + *x = FeeParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_fee_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeeParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeeParams) ProtoMessage() {} + +// Deprecated: Use FeeParams.ProtoReflect.Descriptor instead. +func (*FeeParams) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_fee_proto_rawDescGZIP(), []int{0} +} + +func (x *FeeParams) GetImage() *v1beta1.Coin { + if x != nil { + return x.Image + } + return nil +} + +func (x *FeeParams) GetJson() *v1beta1.Coin { + if x != nil { + return x.Json + } + return nil +} + +func (x *FeeParams) GetDefault() *v1beta1.Coin { + if x != nil { + return x.Default + } + return nil +} + +func (x *FeeParams) GetBurnFactor() string { + if x != nil { + return x.BurnFactor + } + return "" +} + +var File_cheqd_resource_v2_fee_proto protoreflect.FileDescriptor + +var file_cheqd_resource_v2_fee_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, + 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 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, 0x22, 0x91, 0x02, 0x0a, 0x09, 0x46, 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x35, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x07, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x5d, 0x0a, 0x0b, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x66, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x62, 0x75, 0x72, 0x6e, 0x46, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x42, 0xc9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, + 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x42, + 0x08, 0x46, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, + 0x65, 0x71, 0x64, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x52, 0x58, 0xaa, + 0x02, 0x11, 0x43, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x56, 0x32, 0xca, 0x02, 0x11, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x1d, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x68, 0x65, 0x71, 0x64, 0x3a, + 0x3a, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0xa8, 0xe2, 0x1e, + 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_resource_v2_fee_proto_rawDescOnce sync.Once + file_cheqd_resource_v2_fee_proto_rawDescData = file_cheqd_resource_v2_fee_proto_rawDesc +) + +func file_cheqd_resource_v2_fee_proto_rawDescGZIP() []byte { + file_cheqd_resource_v2_fee_proto_rawDescOnce.Do(func() { + file_cheqd_resource_v2_fee_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_resource_v2_fee_proto_rawDescData) + }) + return file_cheqd_resource_v2_fee_proto_rawDescData +} + +var file_cheqd_resource_v2_fee_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cheqd_resource_v2_fee_proto_goTypes = []interface{}{ + (*FeeParams)(nil), // 0: cheqd.resource.v2.FeeParams + (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin +} +var file_cheqd_resource_v2_fee_proto_depIdxs = []int32{ + 1, // 0: cheqd.resource.v2.FeeParams.image:type_name -> cosmos.base.v1beta1.Coin + 1, // 1: cheqd.resource.v2.FeeParams.json:type_name -> cosmos.base.v1beta1.Coin + 1, // 2: cheqd.resource.v2.FeeParams.default:type_name -> cosmos.base.v1beta1.Coin + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_cheqd_resource_v2_fee_proto_init() } +func file_cheqd_resource_v2_fee_proto_init() { + if File_cheqd_resource_v2_fee_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cheqd_resource_v2_fee_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeeParams); 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_cheqd_resource_v2_fee_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cheqd_resource_v2_fee_proto_goTypes, + DependencyIndexes: file_cheqd_resource_v2_fee_proto_depIdxs, + MessageInfos: file_cheqd_resource_v2_fee_proto_msgTypes, + }.Build() + File_cheqd_resource_v2_fee_proto = out.File + file_cheqd_resource_v2_fee_proto_rawDesc = nil + file_cheqd_resource_v2_fee_proto_goTypes = nil + file_cheqd_resource_v2_fee_proto_depIdxs = nil +} diff --git a/api/cheqd/resource/v2/genesis.pulsar.go b/api/cheqd/resource/v2/genesis.pulsar.go new file mode 100644 index 000000000..f48214c26 --- /dev/null +++ b/api/cheqd/resource/v2/genesis.pulsar.go @@ -0,0 +1,750 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package resourcev2 + +import ( + 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 _ protoreflect.List = (*_GenesisState_1_list)(nil) + +type _GenesisState_1_list struct { + list *[]*ResourceWithMetadata +} + +func (x *_GenesisState_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ResourceWithMetadata) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ResourceWithMetadata) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_1_list) AppendMutable() protoreflect.Value { + v := new(ResourceWithMetadata) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_1_list) NewElement() protoreflect.Value { + v := new(ResourceWithMetadata) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_resources protoreflect.FieldDescriptor + fd_GenesisState_fee_params protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_genesis_proto_init() + md_GenesisState = File_cheqd_resource_v2_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_resources = md_GenesisState.Fields().ByName("resources") + fd_GenesisState_fee_params = md_GenesisState.Fields().ByName("fee_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_cheqd_resource_v2_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 len(x.Resources) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_1_list{list: &x.Resources}) + if !f(fd_GenesisState_resources, value) { + return + } + } + if x.FeeParams != nil { + value := protoreflect.ValueOfMessage(x.FeeParams.ProtoReflect()) + if !f(fd_GenesisState_fee_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 "cheqd.resource.v2.GenesisState.resources": + return len(x.Resources) != 0 + case "cheqd.resource.v2.GenesisState.fee_params": + return x.FeeParams != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.resource.v2.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 "cheqd.resource.v2.GenesisState.resources": + x.Resources = nil + case "cheqd.resource.v2.GenesisState.fee_params": + x.FeeParams = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.resource.v2.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 "cheqd.resource.v2.GenesisState.resources": + if len(x.Resources) == 0 { + return protoreflect.ValueOfList(&_GenesisState_1_list{}) + } + listValue := &_GenesisState_1_list{list: &x.Resources} + return protoreflect.ValueOfList(listValue) + case "cheqd.resource.v2.GenesisState.fee_params": + value := x.FeeParams + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.resource.v2.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 "cheqd.resource.v2.GenesisState.resources": + lv := value.List() + clv := lv.(*_GenesisState_1_list) + x.Resources = *clv.list + case "cheqd.resource.v2.GenesisState.fee_params": + x.FeeParams = value.Message().Interface().(*FeeParams) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.resource.v2.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 "cheqd.resource.v2.GenesisState.resources": + if x.Resources == nil { + x.Resources = []*ResourceWithMetadata{} + } + value := &_GenesisState_1_list{list: &x.Resources} + return protoreflect.ValueOfList(value) + case "cheqd.resource.v2.GenesisState.fee_params": + if x.FeeParams == nil { + x.FeeParams = new(FeeParams) + } + return protoreflect.ValueOfMessage(x.FeeParams.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.resource.v2.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 "cheqd.resource.v2.GenesisState.resources": + list := []*ResourceWithMetadata{} + return protoreflect.ValueOfList(&_GenesisState_1_list{list: &list}) + case "cheqd.resource.v2.GenesisState.fee_params": + m := new(FeeParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.GenesisState")) + } + panic(fmt.Errorf("message cheqd.resource.v2.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 cheqd.resource.v2.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 len(x.Resources) > 0 { + for _, e := range x.Resources { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.FeeParams != nil { + l = options.Size(x.FeeParams) + 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.FeeParams != nil { + encoded, err := options.Marshal(x.FeeParams) + 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.Resources) > 0 { + for iNdEx := len(x.Resources) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Resources[iNdEx]) + 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 Resources", 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 + } + x.Resources = append(x.Resources, &ResourceWithMetadata{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Resources[len(x.Resources)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeParams", 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.FeeParams == nil { + x.FeeParams = &FeeParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.FeeParams); 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cheqd/resource/v2/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 chqed Resource module's genesis state +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // All Resources with metadata + Resources []*ResourceWithMetadata `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` + // Fee parameters for the Resource module + // Defines fixed fees and burn percentage for resources + FeeParams *FeeParams `protobuf:"bytes,2,opt,name=fee_params,json=feeParams,proto3" json:"fee_params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_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_cheqd_resource_v2_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetResources() []*ResourceWithMetadata { + if x != nil { + return x.Resources + } + return nil +} + +func (x *GenesisState) GetFeeParams() *FeeParams { + if x != nil { + return x.FeeParams + } + return nil +} + +var File_cheqd_resource_v2_genesis_proto protoreflect.FileDescriptor + +var file_cheqd_resource_v2_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x11, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2e, 0x76, 0x32, 0x1a, 0x1b, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x20, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x0a, 0x66, + 0x65, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x46, 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x09, 0x66, + 0x65, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x76, 0x32, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x76, 0x32, + 0xa2, 0x02, 0x03, 0x43, 0x52, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x11, 0x43, 0x68, 0x65, + 0x71, 0x64, 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, 0x56, 0x32, 0xe2, 0x02, + 0x1d, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, + 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x13, 0x43, 0x68, 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_resource_v2_genesis_proto_rawDescOnce sync.Once + file_cheqd_resource_v2_genesis_proto_rawDescData = file_cheqd_resource_v2_genesis_proto_rawDesc +) + +func file_cheqd_resource_v2_genesis_proto_rawDescGZIP() []byte { + file_cheqd_resource_v2_genesis_proto_rawDescOnce.Do(func() { + file_cheqd_resource_v2_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_resource_v2_genesis_proto_rawDescData) + }) + return file_cheqd_resource_v2_genesis_proto_rawDescData +} + +var file_cheqd_resource_v2_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cheqd_resource_v2_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: cheqd.resource.v2.GenesisState + (*ResourceWithMetadata)(nil), // 1: cheqd.resource.v2.ResourceWithMetadata + (*FeeParams)(nil), // 2: cheqd.resource.v2.FeeParams +} +var file_cheqd_resource_v2_genesis_proto_depIdxs = []int32{ + 1, // 0: cheqd.resource.v2.GenesisState.resources:type_name -> cheqd.resource.v2.ResourceWithMetadata + 2, // 1: cheqd.resource.v2.GenesisState.fee_params:type_name -> cheqd.resource.v2.FeeParams + 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_cheqd_resource_v2_genesis_proto_init() } +func file_cheqd_resource_v2_genesis_proto_init() { + if File_cheqd_resource_v2_genesis_proto != nil { + return + } + file_cheqd_resource_v2_fee_proto_init() + file_cheqd_resource_v2_resource_proto_init() + if !protoimpl.UnsafeEnabled { + file_cheqd_resource_v2_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 + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cheqd_resource_v2_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cheqd_resource_v2_genesis_proto_goTypes, + DependencyIndexes: file_cheqd_resource_v2_genesis_proto_depIdxs, + MessageInfos: file_cheqd_resource_v2_genesis_proto_msgTypes, + }.Build() + File_cheqd_resource_v2_genesis_proto = out.File + file_cheqd_resource_v2_genesis_proto_rawDesc = nil + file_cheqd_resource_v2_genesis_proto_goTypes = nil + file_cheqd_resource_v2_genesis_proto_depIdxs = nil +} diff --git a/api/cheqd/resource/v2/query.pulsar.go b/api/cheqd/resource/v2/query.pulsar.go new file mode 100644 index 000000000..ef911c495 --- /dev/null +++ b/api/cheqd/resource/v2/query.pulsar.go @@ -0,0 +1,3241 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package resourcev2 + +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_QueryResourceRequest protoreflect.MessageDescriptor + fd_QueryResourceRequest_collection_id protoreflect.FieldDescriptor + fd_QueryResourceRequest_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_query_proto_init() + md_QueryResourceRequest = File_cheqd_resource_v2_query_proto.Messages().ByName("QueryResourceRequest") + fd_QueryResourceRequest_collection_id = md_QueryResourceRequest.Fields().ByName("collection_id") + fd_QueryResourceRequest_id = md_QueryResourceRequest.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_QueryResourceRequest)(nil) + +type fastReflection_QueryResourceRequest QueryResourceRequest + +func (x *QueryResourceRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryResourceRequest)(x) +} + +func (x *QueryResourceRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_QueryResourceRequest_messageType fastReflection_QueryResourceRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryResourceRequest_messageType{} + +type fastReflection_QueryResourceRequest_messageType struct{} + +func (x fastReflection_QueryResourceRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryResourceRequest)(nil) +} +func (x fastReflection_QueryResourceRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryResourceRequest) +} +func (x fastReflection_QueryResourceRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResourceRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryResourceRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResourceRequest +} + +// 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_QueryResourceRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryResourceRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryResourceRequest) New() protoreflect.Message { + return new(fastReflection_QueryResourceRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryResourceRequest) Interface() protoreflect.ProtoMessage { + return (*QueryResourceRequest)(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_QueryResourceRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CollectionId != "" { + value := protoreflect.ValueOfString(x.CollectionId) + if !f(fd_QueryResourceRequest_collection_id, value) { + return + } + } + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_QueryResourceRequest_id, 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_QueryResourceRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceRequest.collection_id": + return x.CollectionId != "" + case "cheqd.resource.v2.QueryResourceRequest.id": + return x.Id != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceRequest 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_QueryResourceRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceRequest.collection_id": + x.CollectionId = "" + case "cheqd.resource.v2.QueryResourceRequest.id": + x.Id = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceRequest 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_QueryResourceRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.QueryResourceRequest.collection_id": + value := x.CollectionId + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.QueryResourceRequest.id": + value := x.Id + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceRequest 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_QueryResourceRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceRequest.collection_id": + x.CollectionId = value.Interface().(string) + case "cheqd.resource.v2.QueryResourceRequest.id": + x.Id = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceRequest 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_QueryResourceRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceRequest.collection_id": + panic(fmt.Errorf("field collection_id of message cheqd.resource.v2.QueryResourceRequest is not mutable")) + case "cheqd.resource.v2.QueryResourceRequest.id": + panic(fmt.Errorf("field id of message cheqd.resource.v2.QueryResourceRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceRequest 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_QueryResourceRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceRequest.collection_id": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.QueryResourceRequest.id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceRequest 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_QueryResourceRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.QueryResourceRequest", 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_QueryResourceRequest) 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_QueryResourceRequest) 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_QueryResourceRequest) 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_QueryResourceRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryResourceRequest) + 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.CollectionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Id) + 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().(*QueryResourceRequest) + 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.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0x12 + } + if len(x.CollectionId) > 0 { + i -= len(x.CollectionId) + copy(dAtA[i:], x.CollectionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CollectionId))) + 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().(*QueryResourceRequest) + 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: QueryResourceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResourceRequest: 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 CollectionId", 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.CollectionId = 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 Id", 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.Id = 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_QueryResourceResponse protoreflect.MessageDescriptor + fd_QueryResourceResponse_resource protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_query_proto_init() + md_QueryResourceResponse = File_cheqd_resource_v2_query_proto.Messages().ByName("QueryResourceResponse") + fd_QueryResourceResponse_resource = md_QueryResourceResponse.Fields().ByName("resource") +} + +var _ protoreflect.Message = (*fastReflection_QueryResourceResponse)(nil) + +type fastReflection_QueryResourceResponse QueryResourceResponse + +func (x *QueryResourceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryResourceResponse)(x) +} + +func (x *QueryResourceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_QueryResourceResponse_messageType fastReflection_QueryResourceResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryResourceResponse_messageType{} + +type fastReflection_QueryResourceResponse_messageType struct{} + +func (x fastReflection_QueryResourceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryResourceResponse)(nil) +} +func (x fastReflection_QueryResourceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryResourceResponse) +} +func (x fastReflection_QueryResourceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResourceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryResourceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResourceResponse +} + +// 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_QueryResourceResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryResourceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryResourceResponse) New() protoreflect.Message { + return new(fastReflection_QueryResourceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryResourceResponse) Interface() protoreflect.ProtoMessage { + return (*QueryResourceResponse)(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_QueryResourceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Resource != nil { + value := protoreflect.ValueOfMessage(x.Resource.ProtoReflect()) + if !f(fd_QueryResourceResponse_resource, 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_QueryResourceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceResponse.resource": + return x.Resource != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceResponse 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_QueryResourceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceResponse.resource": + x.Resource = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceResponse 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_QueryResourceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.QueryResourceResponse.resource": + value := x.Resource + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceResponse 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_QueryResourceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceResponse.resource": + x.Resource = value.Message().Interface().(*ResourceWithMetadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceResponse 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_QueryResourceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceResponse.resource": + if x.Resource == nil { + x.Resource = new(ResourceWithMetadata) + } + return protoreflect.ValueOfMessage(x.Resource.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceResponse 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_QueryResourceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceResponse.resource": + m := new(ResourceWithMetadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceResponse 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_QueryResourceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.QueryResourceResponse", 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_QueryResourceResponse) 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_QueryResourceResponse) 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_QueryResourceResponse) 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_QueryResourceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryResourceResponse) + 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.Resource != nil { + l = options.Size(x.Resource) + 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().(*QueryResourceResponse) + 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.Resource != nil { + encoded, err := options.Marshal(x.Resource) + 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().(*QueryResourceResponse) + 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: QueryResourceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResourceResponse: 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 Resource", 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.Resource == nil { + x.Resource = &ResourceWithMetadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Resource); 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_QueryResourceMetadataRequest protoreflect.MessageDescriptor + fd_QueryResourceMetadataRequest_collection_id protoreflect.FieldDescriptor + fd_QueryResourceMetadataRequest_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_query_proto_init() + md_QueryResourceMetadataRequest = File_cheqd_resource_v2_query_proto.Messages().ByName("QueryResourceMetadataRequest") + fd_QueryResourceMetadataRequest_collection_id = md_QueryResourceMetadataRequest.Fields().ByName("collection_id") + fd_QueryResourceMetadataRequest_id = md_QueryResourceMetadataRequest.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_QueryResourceMetadataRequest)(nil) + +type fastReflection_QueryResourceMetadataRequest QueryResourceMetadataRequest + +func (x *QueryResourceMetadataRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryResourceMetadataRequest)(x) +} + +func (x *QueryResourceMetadataRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_QueryResourceMetadataRequest_messageType fastReflection_QueryResourceMetadataRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryResourceMetadataRequest_messageType{} + +type fastReflection_QueryResourceMetadataRequest_messageType struct{} + +func (x fastReflection_QueryResourceMetadataRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryResourceMetadataRequest)(nil) +} +func (x fastReflection_QueryResourceMetadataRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryResourceMetadataRequest) +} +func (x fastReflection_QueryResourceMetadataRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResourceMetadataRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryResourceMetadataRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResourceMetadataRequest +} + +// 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_QueryResourceMetadataRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryResourceMetadataRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryResourceMetadataRequest) New() protoreflect.Message { + return new(fastReflection_QueryResourceMetadataRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryResourceMetadataRequest) Interface() protoreflect.ProtoMessage { + return (*QueryResourceMetadataRequest)(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_QueryResourceMetadataRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CollectionId != "" { + value := protoreflect.ValueOfString(x.CollectionId) + if !f(fd_QueryResourceMetadataRequest_collection_id, value) { + return + } + } + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_QueryResourceMetadataRequest_id, 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_QueryResourceMetadataRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataRequest.collection_id": + return x.CollectionId != "" + case "cheqd.resource.v2.QueryResourceMetadataRequest.id": + return x.Id != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataRequest 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_QueryResourceMetadataRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataRequest.collection_id": + x.CollectionId = "" + case "cheqd.resource.v2.QueryResourceMetadataRequest.id": + x.Id = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataRequest 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_QueryResourceMetadataRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataRequest.collection_id": + value := x.CollectionId + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.QueryResourceMetadataRequest.id": + value := x.Id + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataRequest 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_QueryResourceMetadataRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataRequest.collection_id": + x.CollectionId = value.Interface().(string) + case "cheqd.resource.v2.QueryResourceMetadataRequest.id": + x.Id = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataRequest 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_QueryResourceMetadataRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataRequest.collection_id": + panic(fmt.Errorf("field collection_id of message cheqd.resource.v2.QueryResourceMetadataRequest is not mutable")) + case "cheqd.resource.v2.QueryResourceMetadataRequest.id": + panic(fmt.Errorf("field id of message cheqd.resource.v2.QueryResourceMetadataRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataRequest 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_QueryResourceMetadataRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataRequest.collection_id": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.QueryResourceMetadataRequest.id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataRequest 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_QueryResourceMetadataRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.QueryResourceMetadataRequest", 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_QueryResourceMetadataRequest) 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_QueryResourceMetadataRequest) 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_QueryResourceMetadataRequest) 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_QueryResourceMetadataRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryResourceMetadataRequest) + 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.CollectionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Id) + 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().(*QueryResourceMetadataRequest) + 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.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0x12 + } + if len(x.CollectionId) > 0 { + i -= len(x.CollectionId) + copy(dAtA[i:], x.CollectionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CollectionId))) + 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().(*QueryResourceMetadataRequest) + 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: QueryResourceMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResourceMetadataRequest: 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 CollectionId", 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.CollectionId = 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 Id", 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.Id = 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_QueryResourceMetadataResponse protoreflect.MessageDescriptor + fd_QueryResourceMetadataResponse_resource protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_query_proto_init() + md_QueryResourceMetadataResponse = File_cheqd_resource_v2_query_proto.Messages().ByName("QueryResourceMetadataResponse") + fd_QueryResourceMetadataResponse_resource = md_QueryResourceMetadataResponse.Fields().ByName("resource") +} + +var _ protoreflect.Message = (*fastReflection_QueryResourceMetadataResponse)(nil) + +type fastReflection_QueryResourceMetadataResponse QueryResourceMetadataResponse + +func (x *QueryResourceMetadataResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryResourceMetadataResponse)(x) +} + +func (x *QueryResourceMetadataResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_QueryResourceMetadataResponse_messageType fastReflection_QueryResourceMetadataResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryResourceMetadataResponse_messageType{} + +type fastReflection_QueryResourceMetadataResponse_messageType struct{} + +func (x fastReflection_QueryResourceMetadataResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryResourceMetadataResponse)(nil) +} +func (x fastReflection_QueryResourceMetadataResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryResourceMetadataResponse) +} +func (x fastReflection_QueryResourceMetadataResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResourceMetadataResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryResourceMetadataResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResourceMetadataResponse +} + +// 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_QueryResourceMetadataResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryResourceMetadataResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryResourceMetadataResponse) New() protoreflect.Message { + return new(fastReflection_QueryResourceMetadataResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryResourceMetadataResponse) Interface() protoreflect.ProtoMessage { + return (*QueryResourceMetadataResponse)(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_QueryResourceMetadataResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Resource != nil { + value := protoreflect.ValueOfMessage(x.Resource.ProtoReflect()) + if !f(fd_QueryResourceMetadataResponse_resource, 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_QueryResourceMetadataResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataResponse.resource": + return x.Resource != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataResponse 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_QueryResourceMetadataResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataResponse.resource": + x.Resource = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataResponse 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_QueryResourceMetadataResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataResponse.resource": + value := x.Resource + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataResponse 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_QueryResourceMetadataResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataResponse.resource": + x.Resource = value.Message().Interface().(*Metadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataResponse 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_QueryResourceMetadataResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataResponse.resource": + if x.Resource == nil { + x.Resource = new(Metadata) + } + return protoreflect.ValueOfMessage(x.Resource.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataResponse 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_QueryResourceMetadataResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryResourceMetadataResponse.resource": + m := new(Metadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryResourceMetadataResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryResourceMetadataResponse 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_QueryResourceMetadataResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.QueryResourceMetadataResponse", 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_QueryResourceMetadataResponse) 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_QueryResourceMetadataResponse) 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_QueryResourceMetadataResponse) 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_QueryResourceMetadataResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryResourceMetadataResponse) + 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.Resource != nil { + l = options.Size(x.Resource) + 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().(*QueryResourceMetadataResponse) + 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.Resource != nil { + encoded, err := options.Marshal(x.Resource) + 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().(*QueryResourceMetadataResponse) + 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: QueryResourceMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResourceMetadataResponse: 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 Resource", 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.Resource == nil { + x.Resource = &Metadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Resource); 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_QueryCollectionResourcesRequest protoreflect.MessageDescriptor + fd_QueryCollectionResourcesRequest_collection_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_query_proto_init() + md_QueryCollectionResourcesRequest = File_cheqd_resource_v2_query_proto.Messages().ByName("QueryCollectionResourcesRequest") + fd_QueryCollectionResourcesRequest_collection_id = md_QueryCollectionResourcesRequest.Fields().ByName("collection_id") +} + +var _ protoreflect.Message = (*fastReflection_QueryCollectionResourcesRequest)(nil) + +type fastReflection_QueryCollectionResourcesRequest QueryCollectionResourcesRequest + +func (x *QueryCollectionResourcesRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCollectionResourcesRequest)(x) +} + +func (x *QueryCollectionResourcesRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_QueryCollectionResourcesRequest_messageType fastReflection_QueryCollectionResourcesRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryCollectionResourcesRequest_messageType{} + +type fastReflection_QueryCollectionResourcesRequest_messageType struct{} + +func (x fastReflection_QueryCollectionResourcesRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCollectionResourcesRequest)(nil) +} +func (x fastReflection_QueryCollectionResourcesRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCollectionResourcesRequest) +} +func (x fastReflection_QueryCollectionResourcesRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCollectionResourcesRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCollectionResourcesRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCollectionResourcesRequest +} + +// 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_QueryCollectionResourcesRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryCollectionResourcesRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCollectionResourcesRequest) New() protoreflect.Message { + return new(fastReflection_QueryCollectionResourcesRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCollectionResourcesRequest) Interface() protoreflect.ProtoMessage { + return (*QueryCollectionResourcesRequest)(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_QueryCollectionResourcesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CollectionId != "" { + value := protoreflect.ValueOfString(x.CollectionId) + if !f(fd_QueryCollectionResourcesRequest_collection_id, 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_QueryCollectionResourcesRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesRequest.collection_id": + return x.CollectionId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesRequest 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_QueryCollectionResourcesRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesRequest.collection_id": + x.CollectionId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesRequest 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_QueryCollectionResourcesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesRequest.collection_id": + value := x.CollectionId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesRequest 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_QueryCollectionResourcesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesRequest.collection_id": + x.CollectionId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesRequest 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_QueryCollectionResourcesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesRequest.collection_id": + panic(fmt.Errorf("field collection_id of message cheqd.resource.v2.QueryCollectionResourcesRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesRequest 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_QueryCollectionResourcesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesRequest.collection_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesRequest")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesRequest 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_QueryCollectionResourcesRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.QueryCollectionResourcesRequest", 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_QueryCollectionResourcesRequest) 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_QueryCollectionResourcesRequest) 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_QueryCollectionResourcesRequest) 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_QueryCollectionResourcesRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCollectionResourcesRequest) + 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.CollectionId) + 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().(*QueryCollectionResourcesRequest) + 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.CollectionId) > 0 { + i -= len(x.CollectionId) + copy(dAtA[i:], x.CollectionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CollectionId))) + 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().(*QueryCollectionResourcesRequest) + 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: QueryCollectionResourcesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCollectionResourcesRequest: 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 CollectionId", 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.CollectionId = 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.List = (*_QueryCollectionResourcesResponse_1_list)(nil) + +type _QueryCollectionResourcesResponse_1_list struct { + list *[]*Metadata +} + +func (x *_QueryCollectionResourcesResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryCollectionResourcesResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryCollectionResourcesResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Metadata) + (*x.list)[i] = concreteValue +} + +func (x *_QueryCollectionResourcesResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Metadata) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryCollectionResourcesResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Metadata) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryCollectionResourcesResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryCollectionResourcesResponse_1_list) NewElement() protoreflect.Value { + v := new(Metadata) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryCollectionResourcesResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryCollectionResourcesResponse protoreflect.MessageDescriptor + fd_QueryCollectionResourcesResponse_resources protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_query_proto_init() + md_QueryCollectionResourcesResponse = File_cheqd_resource_v2_query_proto.Messages().ByName("QueryCollectionResourcesResponse") + fd_QueryCollectionResourcesResponse_resources = md_QueryCollectionResourcesResponse.Fields().ByName("resources") +} + +var _ protoreflect.Message = (*fastReflection_QueryCollectionResourcesResponse)(nil) + +type fastReflection_QueryCollectionResourcesResponse QueryCollectionResourcesResponse + +func (x *QueryCollectionResourcesResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCollectionResourcesResponse)(x) +} + +func (x *QueryCollectionResourcesResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_QueryCollectionResourcesResponse_messageType fastReflection_QueryCollectionResourcesResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryCollectionResourcesResponse_messageType{} + +type fastReflection_QueryCollectionResourcesResponse_messageType struct{} + +func (x fastReflection_QueryCollectionResourcesResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCollectionResourcesResponse)(nil) +} +func (x fastReflection_QueryCollectionResourcesResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCollectionResourcesResponse) +} +func (x fastReflection_QueryCollectionResourcesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCollectionResourcesResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCollectionResourcesResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCollectionResourcesResponse +} + +// 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_QueryCollectionResourcesResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryCollectionResourcesResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCollectionResourcesResponse) New() protoreflect.Message { + return new(fastReflection_QueryCollectionResourcesResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCollectionResourcesResponse) Interface() protoreflect.ProtoMessage { + return (*QueryCollectionResourcesResponse)(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_QueryCollectionResourcesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Resources) != 0 { + value := protoreflect.ValueOfList(&_QueryCollectionResourcesResponse_1_list{list: &x.Resources}) + if !f(fd_QueryCollectionResourcesResponse_resources, 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_QueryCollectionResourcesResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesResponse.resources": + return len(x.Resources) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesResponse 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_QueryCollectionResourcesResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesResponse.resources": + x.Resources = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesResponse 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_QueryCollectionResourcesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesResponse.resources": + if len(x.Resources) == 0 { + return protoreflect.ValueOfList(&_QueryCollectionResourcesResponse_1_list{}) + } + listValue := &_QueryCollectionResourcesResponse_1_list{list: &x.Resources} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesResponse 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_QueryCollectionResourcesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesResponse.resources": + lv := value.List() + clv := lv.(*_QueryCollectionResourcesResponse_1_list) + x.Resources = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesResponse 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_QueryCollectionResourcesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesResponse.resources": + if x.Resources == nil { + x.Resources = []*Metadata{} + } + value := &_QueryCollectionResourcesResponse_1_list{list: &x.Resources} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesResponse 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_QueryCollectionResourcesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.QueryCollectionResourcesResponse.resources": + list := []*Metadata{} + return protoreflect.ValueOfList(&_QueryCollectionResourcesResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.QueryCollectionResourcesResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.QueryCollectionResourcesResponse 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_QueryCollectionResourcesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.QueryCollectionResourcesResponse", 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_QueryCollectionResourcesResponse) 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_QueryCollectionResourcesResponse) 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_QueryCollectionResourcesResponse) 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_QueryCollectionResourcesResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCollectionResourcesResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Resources) > 0 { + for _, e := range x.Resources { + l = options.Size(e) + 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().(*QueryCollectionResourcesResponse) + 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.Resources) > 0 { + for iNdEx := len(x.Resources) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Resources[iNdEx]) + 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().(*QueryCollectionResourcesResponse) + 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: QueryCollectionResourcesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCollectionResourcesResponse: 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 Resources", 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 + } + x.Resources = append(x.Resources, &Metadata{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Resources[len(x.Resources)-1]); 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cheqd/resource/v2/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) +) + +type QueryResourceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // is unique identifier a for collection + CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + // is unique identifier for a resource + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryResourceRequest) Reset() { + *x = QueryResourceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResourceRequest) ProtoMessage() {} + +// Deprecated: Use QueryResourceRequest.ProtoReflect.Descriptor instead. +func (*QueryResourceRequest) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_query_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryResourceRequest) GetCollectionId() string { + if x != nil { + return x.CollectionId + } + return "" +} + +func (x *QueryResourceRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type QueryResourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resource *ResourceWithMetadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` +} + +func (x *QueryResourceResponse) Reset() { + *x = QueryResourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResourceResponse) ProtoMessage() {} + +// Deprecated: Use QueryResourceResponse.ProtoReflect.Descriptor instead. +func (*QueryResourceResponse) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryResourceResponse) GetResource() *ResourceWithMetadata { + if x != nil { + return x.Resource + } + return nil +} + +type QueryResourceMetadataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // is unique identifier a for collection + CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + // is unique identifier for a resource + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryResourceMetadataRequest) Reset() { + *x = QueryResourceMetadataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResourceMetadataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResourceMetadataRequest) ProtoMessage() {} + +// Deprecated: Use QueryResourceMetadataRequest.ProtoReflect.Descriptor instead. +func (*QueryResourceMetadataRequest) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryResourceMetadataRequest) GetCollectionId() string { + if x != nil { + return x.CollectionId + } + return "" +} + +func (x *QueryResourceMetadataRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type QueryResourceMetadataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resource *Metadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` +} + +func (x *QueryResourceMetadataResponse) Reset() { + *x = QueryResourceMetadataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResourceMetadataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResourceMetadataResponse) ProtoMessage() {} + +// Deprecated: Use QueryResourceMetadataResponse.ProtoReflect.Descriptor instead. +func (*QueryResourceMetadataResponse) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryResourceMetadataResponse) GetResource() *Metadata { + if x != nil { + return x.Resource + } + return nil +} + +type QueryCollectionResourcesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // is unique identifier a for collection + CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` +} + +func (x *QueryCollectionResourcesRequest) Reset() { + *x = QueryCollectionResourcesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCollectionResourcesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCollectionResourcesRequest) ProtoMessage() {} + +// Deprecated: Use QueryCollectionResourcesRequest.ProtoReflect.Descriptor instead. +func (*QueryCollectionResourcesRequest) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryCollectionResourcesRequest) GetCollectionId() string { + if x != nil { + return x.CollectionId + } + return "" +} + +type QueryCollectionResourcesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resources []*Metadata `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *QueryCollectionResourcesResponse) Reset() { + *x = QueryCollectionResourcesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCollectionResourcesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCollectionResourcesResponse) ProtoMessage() {} + +// Deprecated: Use QueryCollectionResourcesResponse.ProtoReflect.Descriptor instead. +func (*QueryCollectionResourcesResponse) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryCollectionResourcesResponse) GetResources() []*Metadata { + if x != nil { + return x.Resources + } + return nil +} + +var File_cheqd_resource_v2_query_proto protoreflect.FileDescriptor + +var file_cheqd_resource_v2_query_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2f, 0x76, 0x32, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x76, 0x32, 0x1a, 0x20, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 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, 0x22, 0x4b, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x5c, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x53, 0x0a, + 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x58, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x46, 0x0a, 0x1f, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x5d, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x68, + 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x32, 0x94, 0x04, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x98, 0x01, + 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x27, 0x2e, 0x63, 0x68, 0x65, + 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xb9, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x2e, + 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, + 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x12, 0x3a, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, + 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0xb3, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x32, 0x2e, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x33, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, + 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, + 0x32, 0x2f, 0x7b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0xc7, 0x01, 0x0a, 0x15, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x76, 0x32, + 0xa2, 0x02, 0x03, 0x43, 0x52, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x11, 0x43, 0x68, 0x65, + 0x71, 0x64, 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, 0x56, 0x32, 0xe2, 0x02, + 0x1d, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, + 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x13, 0x43, 0x68, 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_resource_v2_query_proto_rawDescOnce sync.Once + file_cheqd_resource_v2_query_proto_rawDescData = file_cheqd_resource_v2_query_proto_rawDesc +) + +func file_cheqd_resource_v2_query_proto_rawDescGZIP() []byte { + file_cheqd_resource_v2_query_proto_rawDescOnce.Do(func() { + file_cheqd_resource_v2_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_resource_v2_query_proto_rawDescData) + }) + return file_cheqd_resource_v2_query_proto_rawDescData +} + +var file_cheqd_resource_v2_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cheqd_resource_v2_query_proto_goTypes = []interface{}{ + (*QueryResourceRequest)(nil), // 0: cheqd.resource.v2.QueryResourceRequest + (*QueryResourceResponse)(nil), // 1: cheqd.resource.v2.QueryResourceResponse + (*QueryResourceMetadataRequest)(nil), // 2: cheqd.resource.v2.QueryResourceMetadataRequest + (*QueryResourceMetadataResponse)(nil), // 3: cheqd.resource.v2.QueryResourceMetadataResponse + (*QueryCollectionResourcesRequest)(nil), // 4: cheqd.resource.v2.QueryCollectionResourcesRequest + (*QueryCollectionResourcesResponse)(nil), // 5: cheqd.resource.v2.QueryCollectionResourcesResponse + (*ResourceWithMetadata)(nil), // 6: cheqd.resource.v2.ResourceWithMetadata + (*Metadata)(nil), // 7: cheqd.resource.v2.Metadata +} +var file_cheqd_resource_v2_query_proto_depIdxs = []int32{ + 6, // 0: cheqd.resource.v2.QueryResourceResponse.resource:type_name -> cheqd.resource.v2.ResourceWithMetadata + 7, // 1: cheqd.resource.v2.QueryResourceMetadataResponse.resource:type_name -> cheqd.resource.v2.Metadata + 7, // 2: cheqd.resource.v2.QueryCollectionResourcesResponse.resources:type_name -> cheqd.resource.v2.Metadata + 0, // 3: cheqd.resource.v2.Query.Resource:input_type -> cheqd.resource.v2.QueryResourceRequest + 2, // 4: cheqd.resource.v2.Query.ResourceMetadata:input_type -> cheqd.resource.v2.QueryResourceMetadataRequest + 4, // 5: cheqd.resource.v2.Query.CollectionResources:input_type -> cheqd.resource.v2.QueryCollectionResourcesRequest + 1, // 6: cheqd.resource.v2.Query.Resource:output_type -> cheqd.resource.v2.QueryResourceResponse + 3, // 7: cheqd.resource.v2.Query.ResourceMetadata:output_type -> cheqd.resource.v2.QueryResourceMetadataResponse + 5, // 8: cheqd.resource.v2.Query.CollectionResources:output_type -> cheqd.resource.v2.QueryCollectionResourcesResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_cheqd_resource_v2_query_proto_init() } +func file_cheqd_resource_v2_query_proto_init() { + if File_cheqd_resource_v2_query_proto != nil { + return + } + file_cheqd_resource_v2_resource_proto_init() + if !protoimpl.UnsafeEnabled { + file_cheqd_resource_v2_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResourceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResourceMetadataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResourceMetadataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCollectionResourcesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCollectionResourcesResponse); 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_cheqd_resource_v2_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cheqd_resource_v2_query_proto_goTypes, + DependencyIndexes: file_cheqd_resource_v2_query_proto_depIdxs, + MessageInfos: file_cheqd_resource_v2_query_proto_msgTypes, + }.Build() + File_cheqd_resource_v2_query_proto = out.File + file_cheqd_resource_v2_query_proto_rawDesc = nil + file_cheqd_resource_v2_query_proto_goTypes = nil + file_cheqd_resource_v2_query_proto_depIdxs = nil +} diff --git a/api/cheqd/resource/v2/query_grpc.pb.go b/api/cheqd/resource/v2/query_grpc.pb.go new file mode 100644 index 000000000..b7372b28b --- /dev/null +++ b/api/cheqd/resource/v2/query_grpc.pb.go @@ -0,0 +1,177 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: cheqd/resource/v2/query.proto + +package resourcev2 + +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 + +// 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 { + Resource(ctx context.Context, in *QueryResourceRequest, opts ...grpc.CallOption) (*QueryResourceResponse, error) + ResourceMetadata(ctx context.Context, in *QueryResourceMetadataRequest, opts ...grpc.CallOption) (*QueryResourceMetadataResponse, error) + CollectionResources(ctx context.Context, in *QueryCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryCollectionResourcesResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Resource(ctx context.Context, in *QueryResourceRequest, opts ...grpc.CallOption) (*QueryResourceResponse, error) { + out := new(QueryResourceResponse) + err := c.cc.Invoke(ctx, "/cheqd.resource.v2.Query/Resource", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ResourceMetadata(ctx context.Context, in *QueryResourceMetadataRequest, opts ...grpc.CallOption) (*QueryResourceMetadataResponse, error) { + out := new(QueryResourceMetadataResponse) + err := c.cc.Invoke(ctx, "/cheqd.resource.v2.Query/ResourceMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CollectionResources(ctx context.Context, in *QueryCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryCollectionResourcesResponse, error) { + out := new(QueryCollectionResourcesResponse) + err := c.cc.Invoke(ctx, "/cheqd.resource.v2.Query/CollectionResources", 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 { + Resource(context.Context, *QueryResourceRequest) (*QueryResourceResponse, error) + ResourceMetadata(context.Context, *QueryResourceMetadataRequest) (*QueryResourceMetadataResponse, error) + CollectionResources(context.Context, *QueryCollectionResourcesRequest) (*QueryCollectionResourcesResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Resource(context.Context, *QueryResourceRequest) (*QueryResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Resource not implemented") +} +func (UnimplementedQueryServer) ResourceMetadata(context.Context, *QueryResourceMetadataRequest) (*QueryResourceMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResourceMetadata not implemented") +} +func (UnimplementedQueryServer) CollectionResources(context.Context, *QueryCollectionResourcesRequest) (*QueryCollectionResourcesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CollectionResources 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_Resource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryResourceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Resource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.resource.v2.Query/Resource", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Resource(ctx, req.(*QueryResourceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ResourceMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryResourceMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ResourceMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.resource.v2.Query/ResourceMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ResourceMetadata(ctx, req.(*QueryResourceMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CollectionResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCollectionResourcesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CollectionResources(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.resource.v2.Query/CollectionResources", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CollectionResources(ctx, req.(*QueryCollectionResourcesRequest)) + } + 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: "cheqd.resource.v2.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Resource", + Handler: _Query_Resource_Handler, + }, + { + MethodName: "ResourceMetadata", + Handler: _Query_ResourceMetadata_Handler, + }, + { + MethodName: "CollectionResources", + Handler: _Query_CollectionResources_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cheqd/resource/v2/query.proto", +} diff --git a/api/cheqd/resource/v2/resource.pulsar.go b/api/cheqd/resource/v2/resource.pulsar.go new file mode 100644 index 000000000..771880c6e --- /dev/null +++ b/api/cheqd/resource/v2/resource.pulsar.go @@ -0,0 +1,3055 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package resourcev2 + +import ( + 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" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_ResourceWithMetadata protoreflect.MessageDescriptor + fd_ResourceWithMetadata_resource protoreflect.FieldDescriptor + fd_ResourceWithMetadata_metadata protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_resource_proto_init() + md_ResourceWithMetadata = File_cheqd_resource_v2_resource_proto.Messages().ByName("ResourceWithMetadata") + fd_ResourceWithMetadata_resource = md_ResourceWithMetadata.Fields().ByName("resource") + fd_ResourceWithMetadata_metadata = md_ResourceWithMetadata.Fields().ByName("metadata") +} + +var _ protoreflect.Message = (*fastReflection_ResourceWithMetadata)(nil) + +type fastReflection_ResourceWithMetadata ResourceWithMetadata + +func (x *ResourceWithMetadata) ProtoReflect() protoreflect.Message { + return (*fastReflection_ResourceWithMetadata)(x) +} + +func (x *ResourceWithMetadata) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_resource_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_ResourceWithMetadata_messageType fastReflection_ResourceWithMetadata_messageType +var _ protoreflect.MessageType = fastReflection_ResourceWithMetadata_messageType{} + +type fastReflection_ResourceWithMetadata_messageType struct{} + +func (x fastReflection_ResourceWithMetadata_messageType) Zero() protoreflect.Message { + return (*fastReflection_ResourceWithMetadata)(nil) +} +func (x fastReflection_ResourceWithMetadata_messageType) New() protoreflect.Message { + return new(fastReflection_ResourceWithMetadata) +} +func (x fastReflection_ResourceWithMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ResourceWithMetadata +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ResourceWithMetadata) Descriptor() protoreflect.MessageDescriptor { + return md_ResourceWithMetadata +} + +// 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_ResourceWithMetadata) Type() protoreflect.MessageType { + return _fastReflection_ResourceWithMetadata_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ResourceWithMetadata) New() protoreflect.Message { + return new(fastReflection_ResourceWithMetadata) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ResourceWithMetadata) Interface() protoreflect.ProtoMessage { + return (*ResourceWithMetadata)(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_ResourceWithMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Resource != nil { + value := protoreflect.ValueOfMessage(x.Resource.ProtoReflect()) + if !f(fd_ResourceWithMetadata_resource, value) { + return + } + } + if x.Metadata != nil { + value := protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) + if !f(fd_ResourceWithMetadata_metadata, 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_ResourceWithMetadata) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.ResourceWithMetadata.resource": + return x.Resource != nil + case "cheqd.resource.v2.ResourceWithMetadata.metadata": + return x.Metadata != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.ResourceWithMetadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.ResourceWithMetadata 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_ResourceWithMetadata) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.ResourceWithMetadata.resource": + x.Resource = nil + case "cheqd.resource.v2.ResourceWithMetadata.metadata": + x.Metadata = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.ResourceWithMetadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.ResourceWithMetadata 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_ResourceWithMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.ResourceWithMetadata.resource": + value := x.Resource + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.resource.v2.ResourceWithMetadata.metadata": + value := x.Metadata + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.ResourceWithMetadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.ResourceWithMetadata 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_ResourceWithMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.ResourceWithMetadata.resource": + x.Resource = value.Message().Interface().(*Resource) + case "cheqd.resource.v2.ResourceWithMetadata.metadata": + x.Metadata = value.Message().Interface().(*Metadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.ResourceWithMetadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.ResourceWithMetadata 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_ResourceWithMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.ResourceWithMetadata.resource": + if x.Resource == nil { + x.Resource = new(Resource) + } + return protoreflect.ValueOfMessage(x.Resource.ProtoReflect()) + case "cheqd.resource.v2.ResourceWithMetadata.metadata": + if x.Metadata == nil { + x.Metadata = new(Metadata) + } + return protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.ResourceWithMetadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.ResourceWithMetadata 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_ResourceWithMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.ResourceWithMetadata.resource": + m := new(Resource) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.resource.v2.ResourceWithMetadata.metadata": + m := new(Metadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.ResourceWithMetadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.ResourceWithMetadata 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_ResourceWithMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.ResourceWithMetadata", 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_ResourceWithMetadata) 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_ResourceWithMetadata) 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_ResourceWithMetadata) 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_ResourceWithMetadata) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ResourceWithMetadata) + 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.Resource != nil { + l = options.Size(x.Resource) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Metadata != nil { + l = options.Size(x.Metadata) + 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().(*ResourceWithMetadata) + 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.Metadata != nil { + encoded, err := options.Marshal(x.Metadata) + 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 x.Resource != nil { + encoded, err := options.Marshal(x.Resource) + 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().(*ResourceWithMetadata) + 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: ResourceWithMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ResourceWithMetadata: 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 Resource", 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.Resource == nil { + x.Resource = &Resource{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Resource); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata == nil { + x.Metadata = &Metadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Metadata); 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_Resource protoreflect.MessageDescriptor + fd_Resource_data protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_resource_proto_init() + md_Resource = File_cheqd_resource_v2_resource_proto.Messages().ByName("Resource") + fd_Resource_data = md_Resource.Fields().ByName("data") +} + +var _ protoreflect.Message = (*fastReflection_Resource)(nil) + +type fastReflection_Resource Resource + +func (x *Resource) ProtoReflect() protoreflect.Message { + return (*fastReflection_Resource)(x) +} + +func (x *Resource) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_resource_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_Resource_messageType fastReflection_Resource_messageType +var _ protoreflect.MessageType = fastReflection_Resource_messageType{} + +type fastReflection_Resource_messageType struct{} + +func (x fastReflection_Resource_messageType) Zero() protoreflect.Message { + return (*fastReflection_Resource)(nil) +} +func (x fastReflection_Resource_messageType) New() protoreflect.Message { + return new(fastReflection_Resource) +} +func (x fastReflection_Resource_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Resource +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Resource) Descriptor() protoreflect.MessageDescriptor { + return md_Resource +} + +// 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_Resource) Type() protoreflect.MessageType { + return _fastReflection_Resource_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Resource) New() protoreflect.Message { + return new(fastReflection_Resource) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Resource) Interface() protoreflect.ProtoMessage { + return (*Resource)(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_Resource) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_Resource_data, 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_Resource) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.Resource.data": + return len(x.Data) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Resource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Resource 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_Resource) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.Resource.data": + x.Data = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Resource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Resource 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_Resource) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.Resource.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Resource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Resource 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_Resource) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.Resource.data": + x.Data = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Resource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Resource 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_Resource) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.Resource.data": + panic(fmt.Errorf("field data of message cheqd.resource.v2.Resource is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Resource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Resource 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_Resource) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.Resource.data": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Resource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Resource 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_Resource) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.Resource", 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_Resource) 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_Resource) 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_Resource) 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_Resource) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Resource) + 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.Data) + 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().(*Resource) + 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.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + 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().(*Resource) + 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: Resource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Resource: 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 Data", 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.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []byte{} + } + 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.List = (*_Metadata_6_list)(nil) + +type _Metadata_6_list struct { + list *[]*AlternativeUri +} + +func (x *_Metadata_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Metadata_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Metadata_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AlternativeUri) + (*x.list)[i] = concreteValue +} + +func (x *_Metadata_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AlternativeUri) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Metadata_6_list) AppendMutable() protoreflect.Value { + v := new(AlternativeUri) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Metadata_6_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Metadata_6_list) NewElement() protoreflect.Value { + v := new(AlternativeUri) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Metadata_6_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Metadata protoreflect.MessageDescriptor + fd_Metadata_collection_id protoreflect.FieldDescriptor + fd_Metadata_id protoreflect.FieldDescriptor + fd_Metadata_name protoreflect.FieldDescriptor + fd_Metadata_version protoreflect.FieldDescriptor + fd_Metadata_resource_type protoreflect.FieldDescriptor + fd_Metadata_also_known_as protoreflect.FieldDescriptor + fd_Metadata_media_type protoreflect.FieldDescriptor + fd_Metadata_created protoreflect.FieldDescriptor + fd_Metadata_checksum protoreflect.FieldDescriptor + fd_Metadata_previous_version_id protoreflect.FieldDescriptor + fd_Metadata_next_version_id protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_resource_proto_init() + md_Metadata = File_cheqd_resource_v2_resource_proto.Messages().ByName("Metadata") + fd_Metadata_collection_id = md_Metadata.Fields().ByName("collection_id") + fd_Metadata_id = md_Metadata.Fields().ByName("id") + fd_Metadata_name = md_Metadata.Fields().ByName("name") + fd_Metadata_version = md_Metadata.Fields().ByName("version") + fd_Metadata_resource_type = md_Metadata.Fields().ByName("resource_type") + fd_Metadata_also_known_as = md_Metadata.Fields().ByName("also_known_as") + fd_Metadata_media_type = md_Metadata.Fields().ByName("media_type") + fd_Metadata_created = md_Metadata.Fields().ByName("created") + fd_Metadata_checksum = md_Metadata.Fields().ByName("checksum") + fd_Metadata_previous_version_id = md_Metadata.Fields().ByName("previous_version_id") + fd_Metadata_next_version_id = md_Metadata.Fields().ByName("next_version_id") +} + +var _ protoreflect.Message = (*fastReflection_Metadata)(nil) + +type fastReflection_Metadata Metadata + +func (x *Metadata) ProtoReflect() protoreflect.Message { + return (*fastReflection_Metadata)(x) +} + +func (x *Metadata) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_resource_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_Metadata_messageType fastReflection_Metadata_messageType +var _ protoreflect.MessageType = fastReflection_Metadata_messageType{} + +type fastReflection_Metadata_messageType struct{} + +func (x fastReflection_Metadata_messageType) Zero() protoreflect.Message { + return (*fastReflection_Metadata)(nil) +} +func (x fastReflection_Metadata_messageType) New() protoreflect.Message { + return new(fastReflection_Metadata) +} +func (x fastReflection_Metadata_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Metadata +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Metadata) Descriptor() protoreflect.MessageDescriptor { + return md_Metadata +} + +// 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_Metadata) Type() protoreflect.MessageType { + return _fastReflection_Metadata_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Metadata) New() protoreflect.Message { + return new(fastReflection_Metadata) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Metadata) Interface() protoreflect.ProtoMessage { + return (*Metadata)(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_Metadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CollectionId != "" { + value := protoreflect.ValueOfString(x.CollectionId) + if !f(fd_Metadata_collection_id, value) { + return + } + } + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Metadata_id, value) { + return + } + } + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_Metadata_name, value) { + return + } + } + if x.Version != "" { + value := protoreflect.ValueOfString(x.Version) + if !f(fd_Metadata_version, value) { + return + } + } + if x.ResourceType != "" { + value := protoreflect.ValueOfString(x.ResourceType) + if !f(fd_Metadata_resource_type, value) { + return + } + } + if len(x.AlsoKnownAs) != 0 { + value := protoreflect.ValueOfList(&_Metadata_6_list{list: &x.AlsoKnownAs}) + if !f(fd_Metadata_also_known_as, value) { + return + } + } + if x.MediaType != "" { + value := protoreflect.ValueOfString(x.MediaType) + if !f(fd_Metadata_media_type, value) { + return + } + } + if x.Created != nil { + value := protoreflect.ValueOfMessage(x.Created.ProtoReflect()) + if !f(fd_Metadata_created, value) { + return + } + } + if x.Checksum != "" { + value := protoreflect.ValueOfString(x.Checksum) + if !f(fd_Metadata_checksum, value) { + return + } + } + if x.PreviousVersionId != "" { + value := protoreflect.ValueOfString(x.PreviousVersionId) + if !f(fd_Metadata_previous_version_id, value) { + return + } + } + if x.NextVersionId != "" { + value := protoreflect.ValueOfString(x.NextVersionId) + if !f(fd_Metadata_next_version_id, 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_Metadata) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.Metadata.collection_id": + return x.CollectionId != "" + case "cheqd.resource.v2.Metadata.id": + return x.Id != "" + case "cheqd.resource.v2.Metadata.name": + return x.Name != "" + case "cheqd.resource.v2.Metadata.version": + return x.Version != "" + case "cheqd.resource.v2.Metadata.resource_type": + return x.ResourceType != "" + case "cheqd.resource.v2.Metadata.also_known_as": + return len(x.AlsoKnownAs) != 0 + case "cheqd.resource.v2.Metadata.media_type": + return x.MediaType != "" + case "cheqd.resource.v2.Metadata.created": + return x.Created != nil + case "cheqd.resource.v2.Metadata.checksum": + return x.Checksum != "" + case "cheqd.resource.v2.Metadata.previous_version_id": + return x.PreviousVersionId != "" + case "cheqd.resource.v2.Metadata.next_version_id": + return x.NextVersionId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Metadata 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_Metadata) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.Metadata.collection_id": + x.CollectionId = "" + case "cheqd.resource.v2.Metadata.id": + x.Id = "" + case "cheqd.resource.v2.Metadata.name": + x.Name = "" + case "cheqd.resource.v2.Metadata.version": + x.Version = "" + case "cheqd.resource.v2.Metadata.resource_type": + x.ResourceType = "" + case "cheqd.resource.v2.Metadata.also_known_as": + x.AlsoKnownAs = nil + case "cheqd.resource.v2.Metadata.media_type": + x.MediaType = "" + case "cheqd.resource.v2.Metadata.created": + x.Created = nil + case "cheqd.resource.v2.Metadata.checksum": + x.Checksum = "" + case "cheqd.resource.v2.Metadata.previous_version_id": + x.PreviousVersionId = "" + case "cheqd.resource.v2.Metadata.next_version_id": + x.NextVersionId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Metadata 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_Metadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.Metadata.collection_id": + value := x.CollectionId + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.Metadata.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.Metadata.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.Metadata.version": + value := x.Version + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.Metadata.resource_type": + value := x.ResourceType + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.Metadata.also_known_as": + if len(x.AlsoKnownAs) == 0 { + return protoreflect.ValueOfList(&_Metadata_6_list{}) + } + listValue := &_Metadata_6_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(listValue) + case "cheqd.resource.v2.Metadata.media_type": + value := x.MediaType + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.Metadata.created": + value := x.Created + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.resource.v2.Metadata.checksum": + value := x.Checksum + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.Metadata.previous_version_id": + value := x.PreviousVersionId + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.Metadata.next_version_id": + value := x.NextVersionId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Metadata 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_Metadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.Metadata.collection_id": + x.CollectionId = value.Interface().(string) + case "cheqd.resource.v2.Metadata.id": + x.Id = value.Interface().(string) + case "cheqd.resource.v2.Metadata.name": + x.Name = value.Interface().(string) + case "cheqd.resource.v2.Metadata.version": + x.Version = value.Interface().(string) + case "cheqd.resource.v2.Metadata.resource_type": + x.ResourceType = value.Interface().(string) + case "cheqd.resource.v2.Metadata.also_known_as": + lv := value.List() + clv := lv.(*_Metadata_6_list) + x.AlsoKnownAs = *clv.list + case "cheqd.resource.v2.Metadata.media_type": + x.MediaType = value.Interface().(string) + case "cheqd.resource.v2.Metadata.created": + x.Created = value.Message().Interface().(*timestamppb.Timestamp) + case "cheqd.resource.v2.Metadata.checksum": + x.Checksum = value.Interface().(string) + case "cheqd.resource.v2.Metadata.previous_version_id": + x.PreviousVersionId = value.Interface().(string) + case "cheqd.resource.v2.Metadata.next_version_id": + x.NextVersionId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Metadata 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_Metadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.Metadata.also_known_as": + if x.AlsoKnownAs == nil { + x.AlsoKnownAs = []*AlternativeUri{} + } + value := &_Metadata_6_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(value) + case "cheqd.resource.v2.Metadata.created": + if x.Created == nil { + x.Created = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Created.ProtoReflect()) + case "cheqd.resource.v2.Metadata.collection_id": + panic(fmt.Errorf("field collection_id of message cheqd.resource.v2.Metadata is not mutable")) + case "cheqd.resource.v2.Metadata.id": + panic(fmt.Errorf("field id of message cheqd.resource.v2.Metadata is not mutable")) + case "cheqd.resource.v2.Metadata.name": + panic(fmt.Errorf("field name of message cheqd.resource.v2.Metadata is not mutable")) + case "cheqd.resource.v2.Metadata.version": + panic(fmt.Errorf("field version of message cheqd.resource.v2.Metadata is not mutable")) + case "cheqd.resource.v2.Metadata.resource_type": + panic(fmt.Errorf("field resource_type of message cheqd.resource.v2.Metadata is not mutable")) + case "cheqd.resource.v2.Metadata.media_type": + panic(fmt.Errorf("field media_type of message cheqd.resource.v2.Metadata is not mutable")) + case "cheqd.resource.v2.Metadata.checksum": + panic(fmt.Errorf("field checksum of message cheqd.resource.v2.Metadata is not mutable")) + case "cheqd.resource.v2.Metadata.previous_version_id": + panic(fmt.Errorf("field previous_version_id of message cheqd.resource.v2.Metadata is not mutable")) + case "cheqd.resource.v2.Metadata.next_version_id": + panic(fmt.Errorf("field next_version_id of message cheqd.resource.v2.Metadata is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Metadata 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_Metadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.Metadata.collection_id": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.Metadata.id": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.Metadata.name": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.Metadata.version": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.Metadata.resource_type": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.Metadata.also_known_as": + list := []*AlternativeUri{} + return protoreflect.ValueOfList(&_Metadata_6_list{list: &list}) + case "cheqd.resource.v2.Metadata.media_type": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.Metadata.created": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.resource.v2.Metadata.checksum": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.Metadata.previous_version_id": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.Metadata.next_version_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.Metadata")) + } + panic(fmt.Errorf("message cheqd.resource.v2.Metadata 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_Metadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.Metadata", 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_Metadata) 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_Metadata) 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_Metadata) 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_Metadata) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Metadata) + 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.CollectionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Version) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ResourceType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.AlsoKnownAs) > 0 { + for _, e := range x.AlsoKnownAs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.MediaType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Created != nil { + l = options.Size(x.Created) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Checksum) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PreviousVersionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.NextVersionId) + 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().(*Metadata) + 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.NextVersionId) > 0 { + i -= len(x.NextVersionId) + copy(dAtA[i:], x.NextVersionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NextVersionId))) + i-- + dAtA[i] = 0x5a + } + if len(x.PreviousVersionId) > 0 { + i -= len(x.PreviousVersionId) + copy(dAtA[i:], x.PreviousVersionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PreviousVersionId))) + i-- + dAtA[i] = 0x52 + } + if len(x.Checksum) > 0 { + i -= len(x.Checksum) + copy(dAtA[i:], x.Checksum) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Checksum))) + i-- + dAtA[i] = 0x4a + } + if x.Created != nil { + encoded, err := options.Marshal(x.Created) + 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] = 0x42 + } + if len(x.MediaType) > 0 { + i -= len(x.MediaType) + copy(dAtA[i:], x.MediaType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MediaType))) + i-- + dAtA[i] = 0x3a + } + if len(x.AlsoKnownAs) > 0 { + for iNdEx := len(x.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.AlsoKnownAs[iNdEx]) + 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] = 0x32 + } + } + if len(x.ResourceType) > 0 { + i -= len(x.ResourceType) + copy(dAtA[i:], x.ResourceType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ResourceType))) + i-- + dAtA[i] = 0x2a + } + if len(x.Version) > 0 { + i -= len(x.Version) + copy(dAtA[i:], x.Version) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Version))) + i-- + dAtA[i] = 0x22 + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + i-- + dAtA[i] = 0x1a + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0x12 + } + if len(x.CollectionId) > 0 { + i -= len(x.CollectionId) + copy(dAtA[i:], x.CollectionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CollectionId))) + 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().(*Metadata) + 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: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Metadata: 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 CollectionId", 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.CollectionId = 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 Id", 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.Id = 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 Name", 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.Name = 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 Version", 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.Version = 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 ResourceType", 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.ResourceType = 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 AlsoKnownAs", 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 + } + x.AlsoKnownAs = append(x.AlsoKnownAs, &AlternativeUri{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AlsoKnownAs[len(x.AlsoKnownAs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MediaType", 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.MediaType = 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 Created", 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.Created == nil { + x.Created = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Created); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Checksum", 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.Checksum = 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 PreviousVersionId", 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.PreviousVersionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NextVersionId", 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.NextVersionId = 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_AlternativeUri protoreflect.MessageDescriptor + fd_AlternativeUri_uri protoreflect.FieldDescriptor + fd_AlternativeUri_description protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_resource_proto_init() + md_AlternativeUri = File_cheqd_resource_v2_resource_proto.Messages().ByName("AlternativeUri") + fd_AlternativeUri_uri = md_AlternativeUri.Fields().ByName("uri") + fd_AlternativeUri_description = md_AlternativeUri.Fields().ByName("description") +} + +var _ protoreflect.Message = (*fastReflection_AlternativeUri)(nil) + +type fastReflection_AlternativeUri AlternativeUri + +func (x *AlternativeUri) ProtoReflect() protoreflect.Message { + return (*fastReflection_AlternativeUri)(x) +} + +func (x *AlternativeUri) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_resource_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_AlternativeUri_messageType fastReflection_AlternativeUri_messageType +var _ protoreflect.MessageType = fastReflection_AlternativeUri_messageType{} + +type fastReflection_AlternativeUri_messageType struct{} + +func (x fastReflection_AlternativeUri_messageType) Zero() protoreflect.Message { + return (*fastReflection_AlternativeUri)(nil) +} +func (x fastReflection_AlternativeUri_messageType) New() protoreflect.Message { + return new(fastReflection_AlternativeUri) +} +func (x fastReflection_AlternativeUri_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AlternativeUri +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AlternativeUri) Descriptor() protoreflect.MessageDescriptor { + return md_AlternativeUri +} + +// 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_AlternativeUri) Type() protoreflect.MessageType { + return _fastReflection_AlternativeUri_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AlternativeUri) New() protoreflect.Message { + return new(fastReflection_AlternativeUri) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AlternativeUri) Interface() protoreflect.ProtoMessage { + return (*AlternativeUri)(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_AlternativeUri) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Uri != "" { + value := protoreflect.ValueOfString(x.Uri) + if !f(fd_AlternativeUri_uri, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_AlternativeUri_description, 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_AlternativeUri) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.AlternativeUri.uri": + return x.Uri != "" + case "cheqd.resource.v2.AlternativeUri.description": + return x.Description != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.AlternativeUri")) + } + panic(fmt.Errorf("message cheqd.resource.v2.AlternativeUri 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_AlternativeUri) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.AlternativeUri.uri": + x.Uri = "" + case "cheqd.resource.v2.AlternativeUri.description": + x.Description = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.AlternativeUri")) + } + panic(fmt.Errorf("message cheqd.resource.v2.AlternativeUri 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_AlternativeUri) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.AlternativeUri.uri": + value := x.Uri + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.AlternativeUri.description": + value := x.Description + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.AlternativeUri")) + } + panic(fmt.Errorf("message cheqd.resource.v2.AlternativeUri 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_AlternativeUri) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.AlternativeUri.uri": + x.Uri = value.Interface().(string) + case "cheqd.resource.v2.AlternativeUri.description": + x.Description = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.AlternativeUri")) + } + panic(fmt.Errorf("message cheqd.resource.v2.AlternativeUri 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_AlternativeUri) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.AlternativeUri.uri": + panic(fmt.Errorf("field uri of message cheqd.resource.v2.AlternativeUri is not mutable")) + case "cheqd.resource.v2.AlternativeUri.description": + panic(fmt.Errorf("field description of message cheqd.resource.v2.AlternativeUri is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.AlternativeUri")) + } + panic(fmt.Errorf("message cheqd.resource.v2.AlternativeUri 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_AlternativeUri) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.AlternativeUri.uri": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.AlternativeUri.description": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.AlternativeUri")) + } + panic(fmt.Errorf("message cheqd.resource.v2.AlternativeUri 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_AlternativeUri) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.AlternativeUri", 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_AlternativeUri) 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_AlternativeUri) 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_AlternativeUri) 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_AlternativeUri) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AlternativeUri) + 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.Uri) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + 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().(*AlternativeUri) + 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.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if len(x.Uri) > 0 { + i -= len(x.Uri) + copy(dAtA[i:], x.Uri) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Uri))) + 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().(*AlternativeUri) + 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: AlternativeUri: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AlternativeUri: 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 Uri", 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.Uri = 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 Description", 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.Description = 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: cheqd/resource/v2/resource.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) +) + +// ResourceWithMetadata describes the overall structure of a DID-Linked Resource +type ResourceWithMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *ResourceWithMetadata) Reset() { + *x = ResourceWithMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_resource_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceWithMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceWithMetadata) ProtoMessage() {} + +// Deprecated: Use ResourceWithMetadata.ProtoReflect.Descriptor instead. +func (*ResourceWithMetadata) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_resource_proto_rawDescGZIP(), []int{0} +} + +func (x *ResourceWithMetadata) GetResource() *Resource { + if x != nil { + return x.Resource + } + return nil +} + +func (x *ResourceWithMetadata) GetMetadata() *Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +// Resource stores the contents of a DID-Linked Resource +type Resource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bytes is the raw data of the Resource + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *Resource) Reset() { + *x = Resource{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_resource_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Resource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Resource) ProtoMessage() {} + +// Deprecated: Use Resource.ProtoReflect.Descriptor instead. +func (*Resource) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_resource_proto_rawDescGZIP(), []int{1} +} + +func (x *Resource) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// Metadata stores the metadata of a DID-Linked Resource +type Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // collection_id is the ID of the collection that the Resource belongs to. Defined client-side. + // This field is the unique identifier of the DID linked to this Resource + CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + // id is the ID of the Resource. Defined client-side. + // This field is a unique identifier for this specific version of the Resource. + // Format: + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // name is a human-readable name for the Resource. Defined client-side. + // Does not change between different versions. + // Example: PassportSchema, EducationTrustRegistry + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // version is a human-readable semantic version for the Resource. Defined client-side. + // Stored as a string. OPTIONAL. + // Example: 1.0.0, v2.1.0 + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + // resource_type is a Resource type that identifies what the Resource is. Defined client-side. + // This is NOT the same as the resource's media type. + // Example: AnonCredsSchema, StatusList2021 + ResourceType string `protobuf:"bytes,5,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + // List of alternative URIs for the SAME Resource. + AlsoKnownAs []*AlternativeUri `protobuf:"bytes,6,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` + // media_type is IANA media type of the Resource. Defined ledger-side. + // Example: application/json, image/png + MediaType string `protobuf:"bytes,7,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` + // created is the time at which the Resource was created. Defined ledger-side. + // Format: RFC3339 + // Example: 2021-01-01T00:00:00Z + Created *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created,proto3" json:"created,omitempty"` + // checksum is a SHA-256 checksum hash of the Resource. Defined ledger-side. + // Example: d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f + Checksum string `protobuf:"bytes,9,opt,name=checksum,proto3" json:"checksum,omitempty"` + // previous_version_id is the ID of the previous version of the Resource. Defined ledger-side. + // This is based on the Resource's name and Resource type to determine whether it's the same Resource. + // Format: + PreviousVersionId string `protobuf:"bytes,10,opt,name=previous_version_id,json=previousVersionId,proto3" json:"previous_version_id,omitempty"` + // next_version_id is the ID of the next version of the Resource. Defined ledger-side. + // This is based on the Resource's name and Resource type to determine whether it's the same Resource. + // Format: + NextVersionId string `protobuf:"bytes,11,opt,name=next_version_id,json=nextVersionId,proto3" json:"next_version_id,omitempty"` +} + +func (x *Metadata) Reset() { + *x = Metadata{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_resource_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metadata) ProtoMessage() {} + +// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_resource_proto_rawDescGZIP(), []int{2} +} + +func (x *Metadata) GetCollectionId() string { + if x != nil { + return x.CollectionId + } + return "" +} + +func (x *Metadata) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Metadata) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Metadata) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Metadata) GetResourceType() string { + if x != nil { + return x.ResourceType + } + return "" +} + +func (x *Metadata) GetAlsoKnownAs() []*AlternativeUri { + if x != nil { + return x.AlsoKnownAs + } + return nil +} + +func (x *Metadata) GetMediaType() string { + if x != nil { + return x.MediaType + } + return "" +} + +func (x *Metadata) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *Metadata) GetChecksum() string { + if x != nil { + return x.Checksum + } + return "" +} + +func (x *Metadata) GetPreviousVersionId() string { + if x != nil { + return x.PreviousVersionId + } + return "" +} + +func (x *Metadata) GetNextVersionId() string { + if x != nil { + return x.NextVersionId + } + return "" +} + +// AlternativeUri are alternative URIs that can be used to access the Resource. +// By default, at least the DID URI equivalent of the Resource is populated. +type AlternativeUri struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uri is the URI of the Resource. + // Examples: + // - did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + // - https://resolver..cheqd.net/1.0/identifiers/did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + // - https://example.com/example.json + // - https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + // - ipfs://bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // description is a human-readable description of the URI. Defined client-side. + // Examples: + // - did-uri + // - http-uri + // - ipfs-uri + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *AlternativeUri) Reset() { + *x = AlternativeUri{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_resource_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AlternativeUri) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AlternativeUri) ProtoMessage() {} + +// Deprecated: Use AlternativeUri.ProtoReflect.Descriptor instead. +func (*AlternativeUri) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_resource_proto_rawDescGZIP(), []int{3} +} + +func (x *AlternativeUri) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *AlternativeUri) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +var File_cheqd_resource_v2_resource_proto protoreflect.FileDescriptor + +var file_cheqd_resource_v2_resource_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x11, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2e, 0x76, 0x32, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, 0x01, 0x0a, + 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x1e, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xbe, 0x03, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4b, 0x0a, 0x0d, + 0x61, 0x6c, 0x73, 0x6f, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x61, 0x73, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x55, 0x72, 0x69, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x01, 0x52, 0x0b, 0x61, 0x6c, + 0x73, 0x6f, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x41, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x64, + 0x69, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, + 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x34, 0x0a, 0x13, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x01, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, + 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x0f, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x0e, 0x41, 0x6c, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x55, 0x72, 0x69, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, + 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xca, + 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, 0x65, 0x71, + 0x64, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, + 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x52, 0x58, 0xaa, 0x02, 0x11, + 0x43, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x56, + 0x32, 0xca, 0x02, 0x11, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x1d, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x68, 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_resource_v2_resource_proto_rawDescOnce sync.Once + file_cheqd_resource_v2_resource_proto_rawDescData = file_cheqd_resource_v2_resource_proto_rawDesc +) + +func file_cheqd_resource_v2_resource_proto_rawDescGZIP() []byte { + file_cheqd_resource_v2_resource_proto_rawDescOnce.Do(func() { + file_cheqd_resource_v2_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_resource_v2_resource_proto_rawDescData) + }) + return file_cheqd_resource_v2_resource_proto_rawDescData +} + +var file_cheqd_resource_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cheqd_resource_v2_resource_proto_goTypes = []interface{}{ + (*ResourceWithMetadata)(nil), // 0: cheqd.resource.v2.ResourceWithMetadata + (*Resource)(nil), // 1: cheqd.resource.v2.Resource + (*Metadata)(nil), // 2: cheqd.resource.v2.Metadata + (*AlternativeUri)(nil), // 3: cheqd.resource.v2.AlternativeUri + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp +} +var file_cheqd_resource_v2_resource_proto_depIdxs = []int32{ + 1, // 0: cheqd.resource.v2.ResourceWithMetadata.resource:type_name -> cheqd.resource.v2.Resource + 2, // 1: cheqd.resource.v2.ResourceWithMetadata.metadata:type_name -> cheqd.resource.v2.Metadata + 3, // 2: cheqd.resource.v2.Metadata.also_known_as:type_name -> cheqd.resource.v2.AlternativeUri + 4, // 3: cheqd.resource.v2.Metadata.created:type_name -> google.protobuf.Timestamp + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] 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 +} + +func init() { file_cheqd_resource_v2_resource_proto_init() } +func file_cheqd_resource_v2_resource_proto_init() { + if File_cheqd_resource_v2_resource_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cheqd_resource_v2_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceWithMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Resource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_resource_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_resource_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AlternativeUri); 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_cheqd_resource_v2_resource_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cheqd_resource_v2_resource_proto_goTypes, + DependencyIndexes: file_cheqd_resource_v2_resource_proto_depIdxs, + MessageInfos: file_cheqd_resource_v2_resource_proto_msgTypes, + }.Build() + File_cheqd_resource_v2_resource_proto = out.File + file_cheqd_resource_v2_resource_proto_rawDesc = nil + file_cheqd_resource_v2_resource_proto_goTypes = nil + file_cheqd_resource_v2_resource_proto_depIdxs = nil +} diff --git a/api/cheqd/resource/v2/tx.pulsar.go b/api/cheqd/resource/v2/tx.pulsar.go new file mode 100644 index 000000000..65736a30e --- /dev/null +++ b/api/cheqd/resource/v2/tx.pulsar.go @@ -0,0 +1,2247 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package resourcev2 + +import ( + fmt "fmt" + v2 "github.com/cheqd/cheqd-node/api/cheqd/did/v2" + 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 _ protoreflect.List = (*_MsgCreateResource_2_list)(nil) + +type _MsgCreateResource_2_list struct { + list *[]*v2.SignInfo +} + +func (x *_MsgCreateResource_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateResource_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateResource_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v2.SignInfo) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateResource_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v2.SignInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateResource_2_list) AppendMutable() protoreflect.Value { + v := new(v2.SignInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateResource_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateResource_2_list) NewElement() protoreflect.Value { + v := new(v2.SignInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateResource_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgCreateResource protoreflect.MessageDescriptor + fd_MsgCreateResource_payload protoreflect.FieldDescriptor + fd_MsgCreateResource_signatures protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_tx_proto_init() + md_MsgCreateResource = File_cheqd_resource_v2_tx_proto.Messages().ByName("MsgCreateResource") + fd_MsgCreateResource_payload = md_MsgCreateResource.Fields().ByName("payload") + fd_MsgCreateResource_signatures = md_MsgCreateResource.Fields().ByName("signatures") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateResource)(nil) + +type fastReflection_MsgCreateResource MsgCreateResource + +func (x *MsgCreateResource) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateResource)(x) +} + +func (x *MsgCreateResource) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_MsgCreateResource_messageType fastReflection_MsgCreateResource_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateResource_messageType{} + +type fastReflection_MsgCreateResource_messageType struct{} + +func (x fastReflection_MsgCreateResource_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateResource)(nil) +} +func (x fastReflection_MsgCreateResource_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateResource) +} +func (x fastReflection_MsgCreateResource_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateResource +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateResource) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateResource +} + +// 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_MsgCreateResource) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateResource_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateResource) New() protoreflect.Message { + return new(fastReflection_MsgCreateResource) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateResource) Interface() protoreflect.ProtoMessage { + return (*MsgCreateResource)(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_MsgCreateResource) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Payload != nil { + value := protoreflect.ValueOfMessage(x.Payload.ProtoReflect()) + if !f(fd_MsgCreateResource_payload, value) { + return + } + } + if len(x.Signatures) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateResource_2_list{list: &x.Signatures}) + if !f(fd_MsgCreateResource_signatures, 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_MsgCreateResource) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResource.payload": + return x.Payload != nil + case "cheqd.resource.v2.MsgCreateResource.signatures": + return len(x.Signatures) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResource 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_MsgCreateResource) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResource.payload": + x.Payload = nil + case "cheqd.resource.v2.MsgCreateResource.signatures": + x.Signatures = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResource 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_MsgCreateResource) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.MsgCreateResource.payload": + value := x.Payload + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cheqd.resource.v2.MsgCreateResource.signatures": + if len(x.Signatures) == 0 { + return protoreflect.ValueOfList(&_MsgCreateResource_2_list{}) + } + listValue := &_MsgCreateResource_2_list{list: &x.Signatures} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResource 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_MsgCreateResource) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResource.payload": + x.Payload = value.Message().Interface().(*MsgCreateResourcePayload) + case "cheqd.resource.v2.MsgCreateResource.signatures": + lv := value.List() + clv := lv.(*_MsgCreateResource_2_list) + x.Signatures = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResource 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_MsgCreateResource) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResource.payload": + if x.Payload == nil { + x.Payload = new(MsgCreateResourcePayload) + } + return protoreflect.ValueOfMessage(x.Payload.ProtoReflect()) + case "cheqd.resource.v2.MsgCreateResource.signatures": + if x.Signatures == nil { + x.Signatures = []*v2.SignInfo{} + } + value := &_MsgCreateResource_2_list{list: &x.Signatures} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResource 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_MsgCreateResource) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResource.payload": + m := new(MsgCreateResourcePayload) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cheqd.resource.v2.MsgCreateResource.signatures": + list := []*v2.SignInfo{} + return protoreflect.ValueOfList(&_MsgCreateResource_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResource")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResource 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_MsgCreateResource) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.MsgCreateResource", 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_MsgCreateResource) 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_MsgCreateResource) 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_MsgCreateResource) 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_MsgCreateResource) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateResource) + 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.Payload != nil { + l = options.Size(x.Payload) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Signatures) > 0 { + for _, e := range x.Signatures { + l = options.Size(e) + 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().(*MsgCreateResource) + 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.Signatures) > 0 { + for iNdEx := len(x.Signatures) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Signatures[iNdEx]) + 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 x.Payload != nil { + encoded, err := options.Marshal(x.Payload) + 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().(*MsgCreateResource) + 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: MsgCreateResource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateResource: 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 Payload", 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.Payload == nil { + x.Payload = &MsgCreateResourcePayload{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Payload); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signatures", 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 + } + x.Signatures = append(x.Signatures, &v2.SignInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Signatures[len(x.Signatures)-1]); 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 _ protoreflect.List = (*_MsgCreateResourcePayload_7_list)(nil) + +type _MsgCreateResourcePayload_7_list struct { + list *[]*AlternativeUri +} + +func (x *_MsgCreateResourcePayload_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateResourcePayload_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateResourcePayload_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AlternativeUri) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateResourcePayload_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AlternativeUri) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateResourcePayload_7_list) AppendMutable() protoreflect.Value { + v := new(AlternativeUri) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateResourcePayload_7_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateResourcePayload_7_list) NewElement() protoreflect.Value { + v := new(AlternativeUri) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateResourcePayload_7_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgCreateResourcePayload protoreflect.MessageDescriptor + fd_MsgCreateResourcePayload_data protoreflect.FieldDescriptor + fd_MsgCreateResourcePayload_collection_id protoreflect.FieldDescriptor + fd_MsgCreateResourcePayload_id protoreflect.FieldDescriptor + fd_MsgCreateResourcePayload_name protoreflect.FieldDescriptor + fd_MsgCreateResourcePayload_version protoreflect.FieldDescriptor + fd_MsgCreateResourcePayload_resource_type protoreflect.FieldDescriptor + fd_MsgCreateResourcePayload_also_known_as protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_tx_proto_init() + md_MsgCreateResourcePayload = File_cheqd_resource_v2_tx_proto.Messages().ByName("MsgCreateResourcePayload") + fd_MsgCreateResourcePayload_data = md_MsgCreateResourcePayload.Fields().ByName("data") + fd_MsgCreateResourcePayload_collection_id = md_MsgCreateResourcePayload.Fields().ByName("collection_id") + fd_MsgCreateResourcePayload_id = md_MsgCreateResourcePayload.Fields().ByName("id") + fd_MsgCreateResourcePayload_name = md_MsgCreateResourcePayload.Fields().ByName("name") + fd_MsgCreateResourcePayload_version = md_MsgCreateResourcePayload.Fields().ByName("version") + fd_MsgCreateResourcePayload_resource_type = md_MsgCreateResourcePayload.Fields().ByName("resource_type") + fd_MsgCreateResourcePayload_also_known_as = md_MsgCreateResourcePayload.Fields().ByName("also_known_as") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateResourcePayload)(nil) + +type fastReflection_MsgCreateResourcePayload MsgCreateResourcePayload + +func (x *MsgCreateResourcePayload) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateResourcePayload)(x) +} + +func (x *MsgCreateResourcePayload) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_MsgCreateResourcePayload_messageType fastReflection_MsgCreateResourcePayload_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateResourcePayload_messageType{} + +type fastReflection_MsgCreateResourcePayload_messageType struct{} + +func (x fastReflection_MsgCreateResourcePayload_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateResourcePayload)(nil) +} +func (x fastReflection_MsgCreateResourcePayload_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateResourcePayload) +} +func (x fastReflection_MsgCreateResourcePayload_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateResourcePayload +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateResourcePayload) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateResourcePayload +} + +// 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_MsgCreateResourcePayload) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateResourcePayload_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateResourcePayload) New() protoreflect.Message { + return new(fastReflection_MsgCreateResourcePayload) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateResourcePayload) Interface() protoreflect.ProtoMessage { + return (*MsgCreateResourcePayload)(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_MsgCreateResourcePayload) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_MsgCreateResourcePayload_data, value) { + return + } + } + if x.CollectionId != "" { + value := protoreflect.ValueOfString(x.CollectionId) + if !f(fd_MsgCreateResourcePayload_collection_id, value) { + return + } + } + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_MsgCreateResourcePayload_id, value) { + return + } + } + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_MsgCreateResourcePayload_name, value) { + return + } + } + if x.Version != "" { + value := protoreflect.ValueOfString(x.Version) + if !f(fd_MsgCreateResourcePayload_version, value) { + return + } + } + if x.ResourceType != "" { + value := protoreflect.ValueOfString(x.ResourceType) + if !f(fd_MsgCreateResourcePayload_resource_type, value) { + return + } + } + if len(x.AlsoKnownAs) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateResourcePayload_7_list{list: &x.AlsoKnownAs}) + if !f(fd_MsgCreateResourcePayload_also_known_as, 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_MsgCreateResourcePayload) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourcePayload.data": + return len(x.Data) != 0 + case "cheqd.resource.v2.MsgCreateResourcePayload.collection_id": + return x.CollectionId != "" + case "cheqd.resource.v2.MsgCreateResourcePayload.id": + return x.Id != "" + case "cheqd.resource.v2.MsgCreateResourcePayload.name": + return x.Name != "" + case "cheqd.resource.v2.MsgCreateResourcePayload.version": + return x.Version != "" + case "cheqd.resource.v2.MsgCreateResourcePayload.resource_type": + return x.ResourceType != "" + case "cheqd.resource.v2.MsgCreateResourcePayload.also_known_as": + return len(x.AlsoKnownAs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourcePayload")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourcePayload 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_MsgCreateResourcePayload) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourcePayload.data": + x.Data = nil + case "cheqd.resource.v2.MsgCreateResourcePayload.collection_id": + x.CollectionId = "" + case "cheqd.resource.v2.MsgCreateResourcePayload.id": + x.Id = "" + case "cheqd.resource.v2.MsgCreateResourcePayload.name": + x.Name = "" + case "cheqd.resource.v2.MsgCreateResourcePayload.version": + x.Version = "" + case "cheqd.resource.v2.MsgCreateResourcePayload.resource_type": + x.ResourceType = "" + case "cheqd.resource.v2.MsgCreateResourcePayload.also_known_as": + x.AlsoKnownAs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourcePayload")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourcePayload 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_MsgCreateResourcePayload) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.MsgCreateResourcePayload.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + case "cheqd.resource.v2.MsgCreateResourcePayload.collection_id": + value := x.CollectionId + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.MsgCreateResourcePayload.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.MsgCreateResourcePayload.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.MsgCreateResourcePayload.version": + value := x.Version + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.MsgCreateResourcePayload.resource_type": + value := x.ResourceType + return protoreflect.ValueOfString(value) + case "cheqd.resource.v2.MsgCreateResourcePayload.also_known_as": + if len(x.AlsoKnownAs) == 0 { + return protoreflect.ValueOfList(&_MsgCreateResourcePayload_7_list{}) + } + listValue := &_MsgCreateResourcePayload_7_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourcePayload")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourcePayload 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_MsgCreateResourcePayload) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourcePayload.data": + x.Data = value.Bytes() + case "cheqd.resource.v2.MsgCreateResourcePayload.collection_id": + x.CollectionId = value.Interface().(string) + case "cheqd.resource.v2.MsgCreateResourcePayload.id": + x.Id = value.Interface().(string) + case "cheqd.resource.v2.MsgCreateResourcePayload.name": + x.Name = value.Interface().(string) + case "cheqd.resource.v2.MsgCreateResourcePayload.version": + x.Version = value.Interface().(string) + case "cheqd.resource.v2.MsgCreateResourcePayload.resource_type": + x.ResourceType = value.Interface().(string) + case "cheqd.resource.v2.MsgCreateResourcePayload.also_known_as": + lv := value.List() + clv := lv.(*_MsgCreateResourcePayload_7_list) + x.AlsoKnownAs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourcePayload")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourcePayload 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_MsgCreateResourcePayload) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourcePayload.also_known_as": + if x.AlsoKnownAs == nil { + x.AlsoKnownAs = []*AlternativeUri{} + } + value := &_MsgCreateResourcePayload_7_list{list: &x.AlsoKnownAs} + return protoreflect.ValueOfList(value) + case "cheqd.resource.v2.MsgCreateResourcePayload.data": + panic(fmt.Errorf("field data of message cheqd.resource.v2.MsgCreateResourcePayload is not mutable")) + case "cheqd.resource.v2.MsgCreateResourcePayload.collection_id": + panic(fmt.Errorf("field collection_id of message cheqd.resource.v2.MsgCreateResourcePayload is not mutable")) + case "cheqd.resource.v2.MsgCreateResourcePayload.id": + panic(fmt.Errorf("field id of message cheqd.resource.v2.MsgCreateResourcePayload is not mutable")) + case "cheqd.resource.v2.MsgCreateResourcePayload.name": + panic(fmt.Errorf("field name of message cheqd.resource.v2.MsgCreateResourcePayload is not mutable")) + case "cheqd.resource.v2.MsgCreateResourcePayload.version": + panic(fmt.Errorf("field version of message cheqd.resource.v2.MsgCreateResourcePayload is not mutable")) + case "cheqd.resource.v2.MsgCreateResourcePayload.resource_type": + panic(fmt.Errorf("field resource_type of message cheqd.resource.v2.MsgCreateResourcePayload is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourcePayload")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourcePayload 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_MsgCreateResourcePayload) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourcePayload.data": + return protoreflect.ValueOfBytes(nil) + case "cheqd.resource.v2.MsgCreateResourcePayload.collection_id": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.MsgCreateResourcePayload.id": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.MsgCreateResourcePayload.name": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.MsgCreateResourcePayload.version": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.MsgCreateResourcePayload.resource_type": + return protoreflect.ValueOfString("") + case "cheqd.resource.v2.MsgCreateResourcePayload.also_known_as": + list := []*AlternativeUri{} + return protoreflect.ValueOfList(&_MsgCreateResourcePayload_7_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourcePayload")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourcePayload 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_MsgCreateResourcePayload) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.MsgCreateResourcePayload", 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_MsgCreateResourcePayload) 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_MsgCreateResourcePayload) 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_MsgCreateResourcePayload) 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_MsgCreateResourcePayload) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateResourcePayload) + 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.Data) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CollectionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Version) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ResourceType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.AlsoKnownAs) > 0 { + for _, e := range x.AlsoKnownAs { + l = options.Size(e) + 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().(*MsgCreateResourcePayload) + 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.AlsoKnownAs) > 0 { + for iNdEx := len(x.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.AlsoKnownAs[iNdEx]) + 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] = 0x3a + } + } + if len(x.ResourceType) > 0 { + i -= len(x.ResourceType) + copy(dAtA[i:], x.ResourceType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ResourceType))) + i-- + dAtA[i] = 0x32 + } + if len(x.Version) > 0 { + i -= len(x.Version) + copy(dAtA[i:], x.Version) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Version))) + i-- + dAtA[i] = 0x2a + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + i-- + dAtA[i] = 0x22 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0x1a + } + if len(x.CollectionId) > 0 { + i -= len(x.CollectionId) + copy(dAtA[i:], x.CollectionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CollectionId))) + i-- + dAtA[i] = 0x12 + } + if len(x.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + 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().(*MsgCreateResourcePayload) + 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: MsgCreateResourcePayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateResourcePayload: 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 Data", 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.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CollectionId", 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.CollectionId = 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 Id", 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.Id = 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 Name", 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.Name = 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 Version", 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.Version = 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 ResourceType", 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.ResourceType = 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 AlsoKnownAs", 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 + } + x.AlsoKnownAs = append(x.AlsoKnownAs, &AlternativeUri{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AlsoKnownAs[len(x.AlsoKnownAs)-1]); 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_MsgCreateResourceResponse protoreflect.MessageDescriptor + fd_MsgCreateResourceResponse_resource protoreflect.FieldDescriptor +) + +func init() { + file_cheqd_resource_v2_tx_proto_init() + md_MsgCreateResourceResponse = File_cheqd_resource_v2_tx_proto.Messages().ByName("MsgCreateResourceResponse") + fd_MsgCreateResourceResponse_resource = md_MsgCreateResourceResponse.Fields().ByName("resource") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateResourceResponse)(nil) + +type fastReflection_MsgCreateResourceResponse MsgCreateResourceResponse + +func (x *MsgCreateResourceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateResourceResponse)(x) +} + +func (x *MsgCreateResourceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cheqd_resource_v2_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_MsgCreateResourceResponse_messageType fastReflection_MsgCreateResourceResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateResourceResponse_messageType{} + +type fastReflection_MsgCreateResourceResponse_messageType struct{} + +func (x fastReflection_MsgCreateResourceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateResourceResponse)(nil) +} +func (x fastReflection_MsgCreateResourceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateResourceResponse) +} +func (x fastReflection_MsgCreateResourceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateResourceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateResourceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateResourceResponse +} + +// 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_MsgCreateResourceResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateResourceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateResourceResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateResourceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateResourceResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateResourceResponse)(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_MsgCreateResourceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Resource != nil { + value := protoreflect.ValueOfMessage(x.Resource.ProtoReflect()) + if !f(fd_MsgCreateResourceResponse_resource, 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_MsgCreateResourceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourceResponse.resource": + return x.Resource != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourceResponse 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_MsgCreateResourceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourceResponse.resource": + x.Resource = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourceResponse 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_MsgCreateResourceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cheqd.resource.v2.MsgCreateResourceResponse.resource": + value := x.Resource + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourceResponse 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_MsgCreateResourceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourceResponse.resource": + x.Resource = value.Message().Interface().(*Metadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourceResponse 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_MsgCreateResourceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourceResponse.resource": + if x.Resource == nil { + x.Resource = new(Metadata) + } + return protoreflect.ValueOfMessage(x.Resource.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourceResponse 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_MsgCreateResourceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cheqd.resource.v2.MsgCreateResourceResponse.resource": + m := new(Metadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cheqd.resource.v2.MsgCreateResourceResponse")) + } + panic(fmt.Errorf("message cheqd.resource.v2.MsgCreateResourceResponse 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_MsgCreateResourceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cheqd.resource.v2.MsgCreateResourceResponse", 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_MsgCreateResourceResponse) 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_MsgCreateResourceResponse) 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_MsgCreateResourceResponse) 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_MsgCreateResourceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateResourceResponse) + 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.Resource != nil { + l = options.Size(x.Resource) + 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().(*MsgCreateResourceResponse) + 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.Resource != nil { + encoded, err := options.Marshal(x.Resource) + 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().(*MsgCreateResourceResponse) + 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: MsgCreateResourceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateResourceResponse: 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 Resource", 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.Resource == nil { + x.Resource = &Metadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Resource); 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cheqd/resource/v2/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) +) + +type MsgCreateResource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Payload of the resource to be created + Payload *MsgCreateResourcePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Signatures of the corresponding DID Document's controller(s) + Signatures []*v2.SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (x *MsgCreateResource) Reset() { + *x = MsgCreateResource{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateResource) ProtoMessage() {} + +// Deprecated: Use MsgCreateResource.ProtoReflect.Descriptor instead. +func (*MsgCreateResource) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgCreateResource) GetPayload() *MsgCreateResourcePayload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *MsgCreateResource) GetSignatures() []*v2.SignInfo { + if x != nil { + return x.Signatures + } + return nil +} + +type MsgCreateResourcePayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // data is a byte-representation of the actual Data the user wants to store + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + // collection_id is an identifier of the DidDocument the resource belongs to + CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + // id is an UUID of the resource + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + // name is a human-readable name of the resource + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // version is a version of the resource + Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` + // resource_type is a type of the resource + ResourceType string `protobuf:"bytes,6,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + // also_known_as is a list of URIs that can be used to get the resource + AlsoKnownAs []*AlternativeUri `protobuf:"bytes,7,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` +} + +func (x *MsgCreateResourcePayload) Reset() { + *x = MsgCreateResourcePayload{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateResourcePayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateResourcePayload) ProtoMessage() {} + +// Deprecated: Use MsgCreateResourcePayload.ProtoReflect.Descriptor instead. +func (*MsgCreateResourcePayload) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgCreateResourcePayload) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *MsgCreateResourcePayload) GetCollectionId() string { + if x != nil { + return x.CollectionId + } + return "" +} + +func (x *MsgCreateResourcePayload) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MsgCreateResourcePayload) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MsgCreateResourcePayload) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *MsgCreateResourcePayload) GetResourceType() string { + if x != nil { + return x.ResourceType + } + return "" +} + +func (x *MsgCreateResourcePayload) GetAlsoKnownAs() []*AlternativeUri { + if x != nil { + return x.AlsoKnownAs + } + return nil +} + +type MsgCreateResourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Metadata which was creted after applying to the ledger + Resource *Metadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` +} + +func (x *MsgCreateResourceResponse) Reset() { + *x = MsgCreateResourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cheqd_resource_v2_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateResourceResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateResourceResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateResourceResponse) Descriptor() ([]byte, []int) { + return file_cheqd_resource_v2_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgCreateResourceResponse) GetResource() *Metadata { + if x != nil { + return x.Resource + } + return nil +} + +var File_cheqd_resource_v2_tx_proto protoreflect.FileDescriptor + +var file_cheqd_resource_v2_tx_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x68, + 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x1a, + 0x15, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x78, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x45, + 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x68, 0x65, 0x71, + 0x64, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xfd, 0x01, + 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, + 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, 0x0d, 0x61, 0x6c, 0x73, 0x6f, 0x5f, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x61, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x55, 0x72, 0x69, + 0x52, 0x0b, 0x61, 0x6c, 0x73, 0x6f, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x41, 0x73, 0x22, 0x54, 0x0a, + 0x19, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x63, + 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x1a, 0x2c, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0xc4, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2e, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2d, 0x6e, 0x6f, + 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, 0x71, 0x64, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x52, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x65, 0x71, + 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x11, + 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, 0x56, + 0x32, 0xe2, 0x02, 0x1d, 0x43, 0x68, 0x65, 0x71, 0x64, 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x13, 0x43, 0x68, 0x65, 0x71, 0x64, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cheqd_resource_v2_tx_proto_rawDescOnce sync.Once + file_cheqd_resource_v2_tx_proto_rawDescData = file_cheqd_resource_v2_tx_proto_rawDesc +) + +func file_cheqd_resource_v2_tx_proto_rawDescGZIP() []byte { + file_cheqd_resource_v2_tx_proto_rawDescOnce.Do(func() { + file_cheqd_resource_v2_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cheqd_resource_v2_tx_proto_rawDescData) + }) + return file_cheqd_resource_v2_tx_proto_rawDescData +} + +var file_cheqd_resource_v2_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_cheqd_resource_v2_tx_proto_goTypes = []interface{}{ + (*MsgCreateResource)(nil), // 0: cheqd.resource.v2.MsgCreateResource + (*MsgCreateResourcePayload)(nil), // 1: cheqd.resource.v2.MsgCreateResourcePayload + (*MsgCreateResourceResponse)(nil), // 2: cheqd.resource.v2.MsgCreateResourceResponse + (*v2.SignInfo)(nil), // 3: cheqd.did.v2.SignInfo + (*AlternativeUri)(nil), // 4: cheqd.resource.v2.AlternativeUri + (*Metadata)(nil), // 5: cheqd.resource.v2.Metadata +} +var file_cheqd_resource_v2_tx_proto_depIdxs = []int32{ + 1, // 0: cheqd.resource.v2.MsgCreateResource.payload:type_name -> cheqd.resource.v2.MsgCreateResourcePayload + 3, // 1: cheqd.resource.v2.MsgCreateResource.signatures:type_name -> cheqd.did.v2.SignInfo + 4, // 2: cheqd.resource.v2.MsgCreateResourcePayload.also_known_as:type_name -> cheqd.resource.v2.AlternativeUri + 5, // 3: cheqd.resource.v2.MsgCreateResourceResponse.resource:type_name -> cheqd.resource.v2.Metadata + 0, // 4: cheqd.resource.v2.Msg.CreateResource:input_type -> cheqd.resource.v2.MsgCreateResource + 2, // 5: cheqd.resource.v2.Msg.CreateResource:output_type -> cheqd.resource.v2.MsgCreateResourceResponse + 5, // [5:6] is the sub-list for method output_type + 4, // [4:5] 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 +} + +func init() { file_cheqd_resource_v2_tx_proto_init() } +func file_cheqd_resource_v2_tx_proto_init() { + if File_cheqd_resource_v2_tx_proto != nil { + return + } + file_cheqd_resource_v2_resource_proto_init() + if !protoimpl.UnsafeEnabled { + file_cheqd_resource_v2_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateResource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateResourcePayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cheqd_resource_v2_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateResourceResponse); 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_cheqd_resource_v2_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cheqd_resource_v2_tx_proto_goTypes, + DependencyIndexes: file_cheqd_resource_v2_tx_proto_depIdxs, + MessageInfos: file_cheqd_resource_v2_tx_proto_msgTypes, + }.Build() + File_cheqd_resource_v2_tx_proto = out.File + file_cheqd_resource_v2_tx_proto_rawDesc = nil + file_cheqd_resource_v2_tx_proto_goTypes = nil + file_cheqd_resource_v2_tx_proto_depIdxs = nil +} diff --git a/api/cheqd/resource/v2/tx_grpc.pb.go b/api/cheqd/resource/v2/tx_grpc.pb.go new file mode 100644 index 000000000..0bec8b46e --- /dev/null +++ b/api/cheqd/resource/v2/tx_grpc.pb.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: cheqd/resource/v2/tx.proto + +package resourcev2 + +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 + +// 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 { + // CreateResource defines a method for creating a resource. + CreateResource(ctx context.Context, in *MsgCreateResource, opts ...grpc.CallOption) (*MsgCreateResourceResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateResource(ctx context.Context, in *MsgCreateResource, opts ...grpc.CallOption) (*MsgCreateResourceResponse, error) { + out := new(MsgCreateResourceResponse) + err := c.cc.Invoke(ctx, "/cheqd.resource.v2.Msg/CreateResource", 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 { + // CreateResource defines a method for creating a resource. + CreateResource(context.Context, *MsgCreateResource) (*MsgCreateResourceResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) CreateResource(context.Context, *MsgCreateResource) (*MsgCreateResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateResource 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_CreateResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateResource) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateResource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cheqd.resource.v2.Msg/CreateResource", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateResource(ctx, req.(*MsgCreateResource)) + } + 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: "cheqd.resource.v2.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateResource", + Handler: _Msg_CreateResource_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cheqd/resource/v2/tx.proto", +} diff --git a/api/docs/config.json b/api/docs/config.json new file mode 100644 index 000000000..849239a9b --- /dev/null +++ b/api/docs/config.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "cheqd Network - REST and gRPC Gateway Documentation", + "description": "Documentation describing REST and gRPC Gateway endpoints for cheqd network.", + "version": "v1.x", + "contact": { + "name": "Cheqd Foundation Limited", + "url": "https://cheqd.io" + }, + "license": { + "name": "Apache 2.0", + "url": "https://github.com/cheqd/cheqd-node/blob/main/LICENSE" + } + }, + "paths": {}, + "apis": [ + { + "url": "./api/docs/cheqd/did/v2/query.swagger.json" + }, + { + "url": "./api/docs/cheqd/resource/v2/query.swagger.json" + } + ], + "basePath": "/swagger/", + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json", + "application/json+ld", + "*/*" + ], + "produces": [ + "application/json", + "application/json+ld", + "*/*" + ], + "externalDocs": { + "description": "cheqd Network Documentation", + "url": "https://docs.cheqd.io/node" + } +} \ No newline at end of file diff --git a/api/docs/statik/statik.go b/api/docs/statik/statik.go new file mode 100644 index 000000000..2e2984bb8 --- /dev/null +++ b/api/docs/statik/statik.go @@ -0,0 +1,14 @@ +// Code generated by statik. DO NOT EDIT. + +package statik + +import ( + "github.com/rakyll/statik/fs" +) + + +func init() { + data := "PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16\x00 \x00swagger-initializer.jsUT\x05\x00\x01\x80Cm8|\x91A\xab\xdaP\x10\x85\xf7\xf9\x15\x87t\xf1\xde\x03M\xf6y\xeaB\xbb)\xb8(\x88\xabR\xca5w\x12\x07\xc7\x99ps/A\x8a\xff\xbd\x98\x84V\\t9s\xbesf\xe0\x0c\xac\xde\x86\xc2T\xccy\xac\xd1$\xad#\x9b\xbe\x7f\xe0w\x06\x94\xe5\x8a\x14\xd8[\xbf;o\xc6`\x80l\xd3\xd9\xc9N\xdb\xe9M\xda\xdd\xbb\xfb%\xa0\xa5c\x9b\x8d,\xaa$e\xc7w\xee\xfe\xf7\x0b\x92\xa2,\xd9\x92H\xd9J\x9a\xa2\"\x06\x13\xd7\xa2\x0e\xc9\x87\x87\x87\x87\xe79\x92\xf9\x1a\xcf\xe7\xc0&\xe8\xd5\xb0\xdb\x7fuB\xc2\x19\x9d\x9c $\x88\x08`\x82\xbc\x05|\xf5\xd1\x07\x10k\xca\x1eP\x07\xdd\xbe\xbd\xfb\x84p\xe8\xa3\xf9\xed\xc77\xe8oX\xc0\x1ao\xd05\xf5\xe2%\x84\x02\x0bB\xc3\x13\x84|\xe0\x1e#\x91\xfc\xd7$\x7f1\xb94%\xe1\xbcD\x16\x84~DI(8\x9aQ\x96\xb4\x1f\xea\xf6\xbb'\x08\xad\x80q%v5\xe8>\x9e \xe4\xd1P`O\xc8.#\x14\xe2%L\xd0\x1bu\xcf\xaf4\x0e}\xdd\xe6;\xb2$\x02|U%f\xc1\x04-\x84\x88\xf8\xa4\xd7S\xd2\xbb\x84\x9e \x14\x10\x0fB\x0eY9W\x11\xf6\x16\x80\x86\xdd\xfe\xfe\x9ds\"\x16\xf1\xb4\xeb\xd1\xa5\x16\xa2\xff\xdf \xa9\x0f\xbdi@\xa7\xbd%&a\xef\xdd\xcd\x9b\xb7\x1f\xee\xde\x9eL1\x87\x8fX,&\xa8\x97\xc0\xdd;\xe1\xde\x02\x96\xc0e\x83\x1d%6\xfd\xc0O<\x1a\xf28\xbd\x88\xa3( \x9e\x1aJ\xef\x0bW\x00\xef\x7f\xf9_\x81\xaf\xbe\x7f\xf5\x97\xde_^\x9dD\x8c\xfa\xb1w\x84\x00x\x14\xc0B\x1c\\SO \xc9\xcdh^)v'?\x87\x93O=\xde50\xf7$<'\x11\x16\x0b%3A\xce'~o5\xec\xfdI\xfc\xffh\xf4\xe7\x90L'B<^.1\xdbL\xd0\xaf \xbc\x05\n\xb0\x00.\x8c\x0e :C\x18]\xdf\\\xa7]P*\x83\xd1\x9c\xac \x94\x17\x12)4\x02\xa6zw\xe3O\xd05\xf1\xaf\xa9\x97\\a\xc0#\x1ar\x0d\x94.\xaf\x86\xfd\xfe\xab\xed?w\x86~\x85x\xecy\xc0\xf9,\x0e\xd2\xbb\xbb\x99\xdajZq\xf6~\x84\xc4&\x82 \xa2\xd3/\xe0\x89\xdc\x85\x88\xc9\xae \x92m_\x97\x15\x0eb\xd8\xfd2]\x95\xbft\xf6\xae t\x97\xeb\x18\x0db\x91`$\x16\x90G\x89\x81\x88Y\xc8\xe5\x85\x0293\x1a\x04tM\xc2\xf9\xe4\xa4\xe0j\x07\xf9\xc4\xbf\xf7\xa9\x87\x88\x12P0'\xbb\xed\x15\x8bY\x82\xc0>\x16X\xcaID\xe5:\x99^\xc7\x9cS\x8f`\x01>Z\x13\xb1(\xe9\xb5C7vo)\x9d\x16T95\xb2$\x18\x14]\xdaQ\x18_\xa9\x9b\x1eR\xc10\xbb\x85\x12*{\x86\xac\xbd\x93E\xdaEx\x14e\x97M\x1b\x981\xbc)\xadC\x04,K[@\xa9\x10.\x18 \xe7\xe5-U(\xad)Iw%D\x18\x05\x84\x0b9\x83\x9foo8\x8a9\xf8HPD|\x08\x05\x99m\x14\x84I\xf5\n\x81\x19\x05\xf0S\xac+\xea_\xc3\x0c\xc7\x81\xd8Z\xae\xf5z\xdd]\x8f\xba\x94\xcd{!\xd7FjPr?\xf1m0\xbb!\xf4\x7fU\x08\x11?\xab?\x85\xc3+\xbf\xf9W\xca\x96X(m\x9c(\xab;\xf9Y\xeeq<\xc2\x1e\xfc2\xf99\x0e\xc9\xd7\x18: \xc4\x04\xd8/\x15Z\xc5h\x10\x00\xb3\x8d\xf89\x14+\xb7\xd0\xac\xea\xa5\xfb\x9d\xd7\xb0\xeb\x9bk\x89)\x16\x083@X\x1a>\xa5mvQ\xce\xf0\xaf\x80\x91Y\xb2\xd1\xde/A,\xa8U[\x1a\xc1\xae\xc2z\xe8b\xb7!\xbaTi\xb7.N\x93\x95Tu\xb0\x05\xbal\xf5]k'\xdaj\xa7\xd1\xfe,\xb4Vy\x1a\xfaJ\x1b\xa0K\xb2V\xac\xf5\x9c\xd7\xd2O??\xc0\xa6C\xfc\xb2E\xa5K\x81\x9e\xdc+`m\x88\xd6\x06\xbf\xd2\xcc$57\x11\x18\xf8\xd5\xe7\x02\xc4SDm\xc2\xde>\xe2e$\x1b~\xeb\x0fOO\x07\x97\xff\xc8\x08\xf9\x1d6\xc3\xfe\xb0_)\xc3\xc5\xe8\xe8R\x1f\x0b\x07E\xcc\xdb\x8e\x1d\x03\x9c\xb9\xa8\xbf\xb1\x8a+\x84\xd0zW\xe3JYC\x17\xb1\x00Fp`k\xfcI\xc0/\xec\x89\x99\x87(\x9e\x06\xc4C\x0f\xb0yZ\xf0\xdf\xd0\xe5\x92\x86\xc1F\xfb\"y\x19\xa6Kr\xf4\x16C*\x8b\xee\xf2\xdf\xd7\x0f\xaf\x93\x8f\xbf\xc3\xe6\xaf\x98\xc3\xe9E\xe6\x8b\xf7q \x88<3V\x19y'\x08\xb3K\xed\xbd\x1a.\xf2aFB\x90\x9b`\x01\x18\xaf\x11\xe6\x95\x02\xf5\xdd>\"a\xba\x12\xdeP\x06\x88G\xe0\xa5\xc2,\x90\xe6\x0e\x8c\xd5\x90\x158c\x9fn\xa53\xd6\xf1(\x83\xdeO\xd9!t\xf4\x10\xca\xfb\xef\xee.\xac\xf6a\xcb\xb9\x0d\x05\xc8U\xc1\xa6\x1c\x0c\x0f\x87h\n\xc6\x9d\xadBHI\xdf \x8c|2'\x02\x07\x88\x93y\x88E\xcc\x00Q\x86<\xb6\x89\x04\x9d3\x1c-\x88'7q:+3\xc18\x16\x0b\xb9\xe0=\x0b\xd2\x0dz\x1d\x8dyl\xf9\xbe\xdb\xe1W W\xc8s\x87?\xd32 \xbc\xb5\xf8f\xa5\x19\x03V{]\x92\xfd\xaa\x8b\xf5\xee-\xba\xd3\x8d0\x06(\xc2\x0c/A\x00\xcb\xf4\xb9\x93$z\x13\xbfL\xf7vbIr\x01\x95F1s\xabKP4\x03\xe1-\xf2\xabK\xda\xf1\x0e\x17\x9b\x00\xf4\x19;\xb36oB\x7f\xb3\xbd\xa4\x0e\xde<\x8e\"\xca\xf6\x9d\xbf\xfa\xc9|\xb9\xdb\x93\xcdbg\xee:\x19qKL\xc2\x10\xc4\xc4\xbb\x18\xce\x86\xd3\xfe\xb03\xf5\xf1\xb43\xf6\xfd\xf3\xce\xf4b4\xea\x8c`0\x1e\x9d\x8fO\xfd\xb3\xc1\xb0T\x88\x00.\xa4\x90\xf5\xdf~{\xfb?\xec\xdf\xab\xbf?\xde^\xac\xd6\xa7\x1fG\x9f\xff\xf9\xdb\xe0K\xe66\x12NP\x84\xc5\"\xf3\x15\x83\xaf1a\xe0O\x90`qv\x0b)\x98{\x81\xe7\xb9)U\x86\xa70\xbb\xbc\x97l\xc3\xbd?\x93\x0f\xd6|scx\x9b\xc88\xff\x87\x16qbF\xd8&\x9e\xef\x96\x9a\x89\xe7RI\x80\x0b\x9d\x91sx\xeey\xe1\xa6\xe8\x98t\xee\xd6\x85\xdd\xbb*\xadk\x9bw\xdeX$\xd4\xe6\xd3\xa26\xef\xdc\x811i\xf3\xce\xf7\x8a\xfd\\`J\x9bw\xbe_\xec6D\x97\x97\xcbW\xb7y\xe7\x07\x81\xef@\xcc\x8a6\xef<-m\xdey\x9bw\xde\xe6\x9d'\xe5\xf0\xd0\xd8\xb68\x05\x11u\xb1\x85\x12\xdb\xbc\xf36\xef\xfc\x90\xa4\xc46\xef|\xa7\xb4y\xe7\xa6<7\xf2m\xde\xf9N\xf9v\x13\xd0\xe6\x9d?3\xf4m\xde\xb9\x1d\xec\x1f\xe0\x1c\xdf\xe6\x9d\x1fs&\xaf\x9f\x1d\xdd\xe6\x9d\xb7y\xe7\xdf\xf2\xd4\xd6\xe6\x9d\x17\x16\xeb\x8apZ\x0b\xee\xd8\xb5y\xe7{\xa5\xcd;/*Nz\xd7lFt\x9bw^\\\x9aE\xb9\xcd;o\xf3\xce\xb3\xc5I\x05]@\xa9\x91\xb7\xeb\x88\x87\x93F=}~n\x9bw\xfe<(\xb7y\xe7\xe8Y\x11\xb7\xa1\xd3\xe6\x9d\xb7y\xe7\x9b\\\x02\xa5S\xfay\x91\x94^NL\x9b\x85\xdef\xa1[\xacw\x9b\x85\xdef\xa1\xbbf\xa1o\xa7q\x95\xcb\xf3F\x96\xb9\xfc\xac\xe7\xb1\xd2K\xb5\xcd\xe7\xed6\xab\xda\x98\xec\xea\x8c\xe4\x92\x99\xfc9\x8e\x89_\x0e\x0e\xb6s \xa2~\x18\xc2\x12\xedyVT\x1b\x8e\xf2|[`\x1d\xa2;.\xb1\x1d;j\x8d\xc6u\xeaGu\x1cb:\xf6\xa3\xb1\x83\x9a\xd9\x81\xa8q\x16v\xc2\xc0Ao\xaa\xcf\xbb\xc7\x9fv\x1dc8\x8d\xc0\xd7l\xf4\xc6\xdd\x9b\xc8\x96\xe7\xc2\xb5F\xd4\xa6\x11l\x1b\x8d\xd7\x1c\x19\xady\x1e\x8c\xab1i6JS#\xfe\xe0\x14\xa1i<>S\x05F\xeaZ&\xfaP\xe6v\x8a\xdc\x13\x8c\xc5\xf6\xab\xe4 \xc2\x08\xcfIX2\xde\x9cc\xb9\xad\x98N\x8cl6\xf3u\x12\xf1)r:u\xa9t\xf2\xaa]\xb9\xb6\x12\xb99\xea\xe7MZ\xc1<\xc4`\x82\x03/\x96\xf41 \xbc\x10\x8f9\x07\xf1\x11\x8e\xaf\xed\xb4\xba\xd3\x92\xd9@\xb2/PHu\xc0\x98\xbbRQf\xb2\xd1\x14\x02\x1a\xce\xe5~\xd3E\xd7\xc9!\xd4\x0b\xe4\xf6\xdc\xe1\xc4\xafz\x90\xe8\xd3\x82p4#\x10\xd8\x9fJ\x92Np\xa0\x9e\x94\xa9zl@H\x81\x95\x8f\xd2<1\xbeE\xa0\x9a\xfe\x1c\x87\x0e.\xc0F\xe7\xf5H\xdb\x97\xc4\x04Ke\xedDQ\xd3.\xd9#\xa8 \xff]TE\xd9\xee\xa7DS6\xa0\xc7\xbe\x88\x978\xec0\xc0\xbe\xda \xd5\x05\xf3R\xcd=|\xcb\xb5\xdf \xf7k\n\x1c\x85T o\x81\xc3\xb9\xd4o\xb1\x06\x08\x91Of3`\xd2\xeb4!\xcb\n!ih\xf9#\xe6\\\x1e\xdb\xee\x94\xe5z\x8d\xde\xfa\xb1\x0e\xdd~b1\x17\xb70'\\\xb0\xe2\xc7P\x92f\x9e\x14\xe242_\x802\x87%\x0eE\xe6E\x7f\xc5yd\xdbr\xa8\xa6\xdf \xe9\x85\xc8c/N\xc6\xd3E\x7f|\xfct\xf3\xc7\x87\xabw.\x18\x0f\xba\xfdn\xff5Z\x0d\xbb\x83n1\x17b\x0c~\xe5\x03\x83\x8d\x00\x9akI\xc3\x9aZJ\xf5\x95&-\xcd\"\xe6h]\xf5\x1cmV\xbf\x11\xe1u\x81U&\x84p\xf4\xe1\x8fOJ\x94z\x1a\x08\xa7\xb1<%\xf6\x15GK\xf0 V\xbdsA\xfb*\xa4\xe1\x1b\x06>7*}'\xb0\x88\xf9;\xc2\xc5\xb0?,~-\x9b\xd3\x83YU[\xaf.\x96\x87\xb2,\xdb\xb0.\xb6\xcdX\x97\x98\x91\xaa\xcbN\xca\x92T\xb4\xaa\x8c.1#f\xef\xf8|{S\xc3R\xeb\xb2\x0d\xe3X*\xda\xfa\xb1\x1f\xb2y\xff\xe5_\x8f\x1f\xfe\xf7_\xbf\x9b\xbf\xa9/\xca{\xe3\xb3~\x1f\xf0\xe8\xb4sq98\xeb\x8c\xb17\xeeL\xc7\x83a\xe7\xf4tz1\x1b_\xfa\xfe\xe5\x18\x8e\xed\x90a\xaa\xd4k4W\xc0\xba]\xd5\xbdn\x08\xa27\xe8\xf6{\xdb\x0dQ\xbd\x19\xf0\x99;_\xfc\x94i\xf2\xf9\x0b\xa7\xa1U\x82\xe3\xf0\xe7X\xc0\x1ao\xba$\x9a\xf1.\xa1=\xf9\xb77\xc5\xb3\xcd\x14\xc8\x02\xc4\x97a8\x1f\xf9\xe7\xe3\x87sq~:\xc6b5\xe4\xa7\xfe\xc3\xf9Y\xe4}\x15\xab\xc7\x80\x9f\xf9\xa1\x80\xd9\xe8\x11\x9f1\xfc8<}\xb4\x8f\xccr]\xb6?\xe9\x1d\xd5\x83r\xe1\xd9S\xc1\xf3.\xc3L\xcb\x85\x9bb\xf6\xba\xf5\x99\x03Y>\xdf\xde\xd45\xdb\xba\xb8\xafh\xb9f;1#\xf6\x8aR\x99\xdcj\xca\xe9U5\xcb\xaa\xd8\xf3\xf1M\xb9\n\x040y\xbc_\xc1gF\x92\x97;\xa6_\xe9\x17\x8b\xee\x06\x05+\xc4 \x8a\xb0:$\xba\x1b\xc8\xbfnL\xec\xea5\xc2\x02\x05\x80\xb9H\x8f\x15\xd2\xda\xca\x93\xfa\n\x07\x90\xc6h*\x84e\xf6c\x14\xd1(\x0et\xf2Pq\xe5\x1cJ\xefR\xda{g\xf4\xc6\x95\xbd\xbbz\xff63\xa2\"\x81j\xaf~z7f\xdb\x8c\x1c\xe6\xcd\xd5\x87\xab\x8c\x97Pz\xb2)\x15\x17\x80?\x07f\xd3\xfb\xd4\xc5\xc0Q\x14$\x19\x0e=iC_#\xb2\xc4s\xe8E%#z\xe1i\x93R\xe7\xd6\x0b\xe2-\xf2\xfe\xdc\x1asS\xbb\xfc\xad\x06\xc6r\xb8!xh\xae\x9f\xfc\xefS\xbf?Q\xff\x15\xe7\xfay\x0b\xf0\x1ex\xbc<\x02d\x07\xf0\x92F\xb4\xe9\xbd\xfb\xed\xaa3<=\xdb~\xbb\xc0|\xb1\xef\x19\x95 \xab\x07\x9dA\xa4\xdc\xe0\x0d\xc6\xb8?\xbc\xf0\x86x\x84\x87S\xefr|~6\xe8\x0f\xa7\xd3\xe1\xc5\xc5p4\xf6\xc6\x83S<\x9c\xf6\x07\xb3\x8b\xe1\x05\xe0\xb3!\xf6N\xa7#\x18\x0f\x8bi\xff\x17\x94\x9c\xb5\x8dT\x14$]\x95\n,\x8el\xb8Am\x8e%S\xcc\xc1G4\xcc {\xc5\xf5\xf1\x1e\x87~\xfe\xe4T\xde\x15\x8a|\x10\xc0\x96$\x844 \x94\x88W|{\xe6q\xd8%\\\x02\x1e\xdf>Sq;Y\x8aV\xcc\xc7uJ\x85\xfdX\x13\x95\x80\x9bf\x9cpAY\x92\xe5\x95\x06\xbd\xcdo\x16t\xf4\xebw\xca\x83\x86\x89\xb0\xf4\xd4\xb0M\x851ij\x99\xa0\xa9f\xdf4\x12\xcb\xfc\x03\x109i\xc5i8\x05\x81tk\x02N\xc1\xb4\xeb\x04\x9c\x02a\xe8\xf6\xe3\x9b6\xfd\xa6M\xbfyY\xe97E\xfc\x12\xb2r\xb6;4\x06.\xcc\x7f\xcf\xfc\xdaC6\xe2\x95\x13\x95a/\xf2&gkf\n\x12hr5K\x0ej\x1d\xe4\x940\xb3s\xcfS\xe7\xc7\x1cA3n#'\x7f\x12\xdf\xfa31xk\n\xeb0\x8cj;)&\x1awl\xf4\x8bg\x17\x0b\xecA\xc5\xb6_\xf9\x831)\x94\x99\x1f\x8b\xb1\xfe4\x0c\xcb\x1cT\xf3[V\xba\x12\n\xef[\xee\xbc\x00i\x9f2\xae\xfbC0\x85+\x0f\xd9l]\xb5\xa5+G\x19\xd9\x04#\xabpY\xca\xdf\x1c\x85\xdc\x0c\xa1C\xba6\xda*\x85\xac\xb3\xf5.\xf0\x1a\x19?%\xebs\x15\x8fU\x0bH}\xb0\x8c\xbf\xa3~\x9a%\x14\xdc\xdd\xdf\xb1\xbd5\xab\x01`\x9d\xe8nG\x84\xed\x8et\xa3\xa4w#\xb4\xf7\x81\xc4w\x85<\xf5\xb27\x1b\xf5\xdd\xdcO\xe3T\xa2\xdd$\x05\xde, ~\x08\x0d\xeep\xdc@\x16*\xbcAlk\x12\xe2\x15\x92\xea\xceC#\xa4x3\xb4\xb8\x95\x18o\x10\xf0F\xe9\xf1\xc3 \xf2\x83)\xf2Z$\xb9#M\xde \xbc\xcd\x92\xe5G\xd3\xe5\xcd\x12\xe6GR\xe6\x8e\xa4\xb9\x0bmn%\xce\x1d\xb6u]\xec\x9b\xbb.V\xfa\xdcQ\x89\x92\xaa\x0e\xaa\xa4\xcb\x91$z\x0d\xd2\xcdN\x90~\x03*\xdd\xa5S/\x9aNo\x82P\xaf\x03\xc2s\x93\xea.}{Rb\xbd\x06\xb5\xfeDK\xb4\x1e\xc1n\x15\x97,\xf5\xfa\xa6^\x97:\xeb\xdd\x95f\xafC\xb4;Q\xedu\xc8\xf6\xc6\xe9\xf6\x83\x08\xf7\x86)\xf7\x9a\xa4\xfb\x13\xd0\xee.\xc4\xbb\xe3\x82qY*\x0d\xd3\xef\xae\x04\xfc\x11\x14\xbc\x95\x84wD\xc7\x95\x88w\xc3\xb1a2\xbe.\xa7\\\x83\x90?\x84\x92\xb7\x93\xf2\x8e\xa0;A\xd9$5_\x1fH+=\xdf0A_\x8b\xa2o\x10\xe6\x83\x88\xfa\ny\xa5\x11\x18W\xe0\x1b\xe6\x80\x9bb\x81]\x033n\x94}\x83\x13\xd8(q\x7f8u\xff}O\\c\x14~%\xe1n\xeepb\xd9\x13^\xbd$\xc4\xdaR\xeb\xba\xb4\xd4zK\xad\x9b\xf2\xa3Q\xeb\x07\xbcR\x84\xec\xd2\x1a\xbb\x84o\xb7\x04\xb8\x1d\xcbyd\xcf\x1bK\npx\x149\xa3o\xbb\x89\x02*\xb2z\xf8S\xc9\xc8!w\xe0{y-mE\x0e\xc1\xe1\x94\xb9\x03\xf1j5B6\x17\xa81\xb2\xf5h\xa2\xf5 \x92\xb5\xfc\xe9b\x1b\xc1\xfad\x886G\xa86G\xa6\xd6%R\xad._9\x81z4~5ISK0\xc5\x05\xe7\x06\xc8\xd2\xe3\x89\xd2J\x92\xf4hP\x1b$F\x0f\xd3\xe5\x83\x08Qg2\xd4\x81\x08=\x1a\xc2\x83\xc8O\x07\x1ck\x13\x9f\xcd\x91\x9eG\x10\x9e\x0edg\x95\xcb\x8fl$\xa7\xc5\xf5G\xd6\xcdS\x17\x0b\xb1iU\x8a\xa4\x9aC\x1c\xe1H2\xd3\x91\xd8\xa8\xee\xc13\xf3\x7f\xd5\x9dy\xc1\xc4\xe5\xb1\xa4\xa5\xdb\xc0\x9f\x97\xac\xac\xee\xd3\x13\x92\x94\x8e\x04e\xa3K\xad\x1e)i \xd9\x1d\xfc\xcc\xaf\xeb\x9au#\"]IH+\x01\xe9J>\x1eB]Z\x82\xaf%\xf8Li >U\xbe[\x82\xef\xff\x03\x00\x00\xff\xffPK\x07\x08\xdd\xb1\xdfo\x88\x14\x00\x00\xe6\xd2\x00\x00PK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x00\x00!(\x04\x1b\xae\x9a(\x01\x00\x00\xfc\x01\x00\x00\x16\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xb6\x81\x00\x00\x00\x00swagger-initializer.jsUT\x05\x00\x01\x80Cm8PK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x00\x00!(\x17\xa0K@,\x01\x00\x00\x10\x02\x00\x00\x1a\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xb6\x81u\x01\x00\x00swagger-initializer.js.bakUT\x05\x00\x01\x80Cm8PK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x00\x00!(\xdd\xb1\xdfo\x88\x14\x00\x00\xe6\xd2\x00\x00\x0c\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xb6\x81\xf2\x02\x00\x00swagger.yamlUT\x05\x00\x01\x80Cm8PK\x05\x06\x00\x00\x00\x00\x03\x00\x03\x00\xe1\x00\x00\x00\xbd\x17\x00\x00\x00\x00" + fs.Register(data) + } + \ No newline at end of file diff --git a/api/docs/swagger-ui/swagger-initializer.js b/api/docs/swagger-ui/swagger-initializer.js new file mode 100644 index 000000000..f48f13f55 --- /dev/null +++ b/api/docs/swagger-ui/swagger-initializer.js @@ -0,0 +1,20 @@ +window.onload = function() { + // + + // the following lines will be replaced by docker/configurator, when it runs in a docker-container + window.ui = SwaggerUIBundle({ + url: "swagger.yaml", + dom_id: '#swagger-ui', + deepLinking: true, + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + layout: "StandaloneLayout" + }); + + // +}; diff --git a/api/docs/swagger.yaml b/api/docs/swagger.yaml new file mode 100644 index 000000000..96e9bd5c1 --- /dev/null +++ b/api/docs/swagger.yaml @@ -0,0 +1,1427 @@ +swagger: '2.0' +info: + title: cheqd Network - REST and gRPC Gateway Documentation + description: Documentation describing REST and gRPC Gateway endpoints for cheqd network. + version: v1.x + contact: + name: Cheqd Foundation Limited + url: https://cheqd.io + license: + name: Apache 2.0 + url: https://github.com/cheqd/cheqd-node/blob/main/LICENSE +basePath: /swagger/ +schemes: + - http + - https +consumes: + - application/json + - application/json+ld + - '*/*' +produces: + - application/json + - application/json+ld + - '*/*' +externalDocs: + description: cheqd Network Documentation + url: https://docs.cheqd.io/node +paths: + /cheqd/did/v2/{id}: + get: + summary: Fetch latest version of a DID Document for a given DID + operationId: DidDoc + responses: + '200': + description: A successful response. + schema: + type: object + properties: + value: + title: >- + Successful resolution of the DID Document returns the + following: + + - did_doc is the latest version of the DID Document + + - metadata is is the DID Document metadata associated with the + latest version of the DID Document + type: object + properties: + did_doc: + description: didDocument is the DID Document. + type: object + properties: + context: + type: array + items: + type: string + title: >- + context is a list of URIs used to identify the context + of the DID document. + + Default: https://www.w3.org/ns/did/v1 + id: + type: string + title: |- + id is the DID of the DID document. + Format: did:cheqd:: + controller: + type: array + items: + type: string + description: >- + controller is a list of DIDs that are allowed to + control the DID document. + verification_method: + type: array + items: + type: object + properties: + id: + type: string + title: >- + id is the unique identifier of the verification + method. + + Format: + did:cheqd::# + verification_method_type: + type: string + title: |- + type is the type of the verification method. + Example: Ed25519VerificationKey2020 + controller: + type: string + title: >- + controller is the DID of the controller of the + verification method. + + Format: + did:cheqd:: + verification_material: + type: string + title: >- + verification_material is the public key of the + verification method. + + Commonly used verification material types: + publicJwk, publicKeyBase58, publicKeyMultibase + title: >- + VerificationMethod defines a verification method, as + defined in the DID Core specification. + + Documentation: + https://www.w3.org/TR/did-core/#verification-methods + description: >- + verificationMethod is a list of verification methods + that can be used to + + verify a digital signature or cryptographic proof. + authentication: + type: array + items: + type: string + description: >- + authentication is a list of verification methods that + can be used to + + authenticate as the DID subject. + assertion_method: + type: array + items: + type: string + description: >- + assertionMethod is a list of verification methods that + can be used to + + assert statements as the DID subject. + capability_invocation: + type: array + items: + type: string + description: >- + capabilityInvocation is a list of verification methods + that can be used to + + invoke capabilities as the DID subject. + capability_delegation: + type: array + items: + type: string + description: >- + capabilityDelegation is a list of verification methods + that can be used to + + delegate capabilities as the DID subject. + key_agreement: + type: array + items: + type: string + description: >- + keyAgreement is a list of verification methods that + can be used to perform + + key agreement as the DID subject. + service: + type: array + items: + type: object + properties: + id: + type: string + title: >- + id is the unique identifier of the service. + + Format: + did:cheqd::# + service_type: + type: string + title: |- + type is the type of the service. + Example: LinkedResource + service_endpoint: + type: array + items: + type: string + title: |- + serviceEndpoint is the endpoint of the service. + Example: https://example.com/endpoint + title: >- + Service defines a service, as defined in the DID + Core specification. + + Documentation: + https://www.w3.org/TR/did-core/#services + description: >- + service is a list of services that can be used to + interact with the DID subject. + also_known_as: + type: array + items: + type: string + description: >- + alsoKnownAs is a list of DIDs that are known to refer + to the same DID subject. + title: >- + DidDoc defines a DID Document, as defined in the DID Core + specification. + + Documentation: https://www.w3.org/TR/did-core/ + metadata: + description: didDocumentMetadata is the DID Document metadata. + type: object + properties: + created: + type: string + format: date-time + title: >- + created is the timestamp of the creation of the DID + Document. + + Format: RFC3339 + + Example: 2021-03-10T15:16:17Z + updated: + type: string + format: date-time + title: >- + updated is the timestamp of the last update of the DID + Document. + + Format: RFC3339 + + Example: 2021-03-10T15:16:17Z + deactivated: + type: boolean + title: >- + deactivated is a flag that indicates whether the DID + Document is deactivated. + + Default: false + version_id: + type: string + title: >- + version_id is the version identifier of the DID + Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + next_version_id: + type: string + title: >- + next_version_id is the version identifier of the next + version of the DID Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + previous_version_id: + type: string + title: >- + previous_version_id is the version identifier of the + previous version of the DID Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + title: >- + Metadata defines DID Document metadata, as defined in the + DID Core specification. + + Documentation: + https://www.w3.org/TR/did-core/#did-document-metadata-properties + description: >- + DidDocWithMetadata defines a DID Document with metadata, as + defined in the DID Core specification. + + Contains the DID Document, as well as DID Document metadata. + title: >- + QueryDidDocResponse is the response type for the Query/DidDoc + method + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: id + description: |- + DID unique identifier of the DID Document to fetch. + UUID-style DIDs as well as Indy-style DID are supported. + + Format: did:cheqd:: + + Examples: + - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j + in: path + required: true + type: string + tags: + - Query + /cheqd/did/v2/{id}/version/{version}: + get: + summary: Fetch specific version of a DID Document for a given DID + operationId: DidDocVersion + responses: + '200': + description: A successful response. + schema: + type: object + properties: + value: + title: >- + Successful resolution of the DID Document returns the + following: + + - did_doc is the requested version of the DID Document + + - metadata is DID Document metadata associated with the + requested version of the DID Document + type: object + properties: + did_doc: + description: didDocument is the DID Document. + type: object + properties: + context: + type: array + items: + type: string + title: >- + context is a list of URIs used to identify the context + of the DID document. + + Default: https://www.w3.org/ns/did/v1 + id: + type: string + title: |- + id is the DID of the DID document. + Format: did:cheqd:: + controller: + type: array + items: + type: string + description: >- + controller is a list of DIDs that are allowed to + control the DID document. + verification_method: + type: array + items: + type: object + properties: + id: + type: string + title: >- + id is the unique identifier of the verification + method. + + Format: + did:cheqd::# + verification_method_type: + type: string + title: |- + type is the type of the verification method. + Example: Ed25519VerificationKey2020 + controller: + type: string + title: >- + controller is the DID of the controller of the + verification method. + + Format: + did:cheqd:: + verification_material: + type: string + title: >- + verification_material is the public key of the + verification method. + + Commonly used verification material types: + publicJwk, publicKeyBase58, publicKeyMultibase + title: >- + VerificationMethod defines a verification method, as + defined in the DID Core specification. + + Documentation: + https://www.w3.org/TR/did-core/#verification-methods + description: >- + verificationMethod is a list of verification methods + that can be used to + + verify a digital signature or cryptographic proof. + authentication: + type: array + items: + type: string + description: >- + authentication is a list of verification methods that + can be used to + + authenticate as the DID subject. + assertion_method: + type: array + items: + type: string + description: >- + assertionMethod is a list of verification methods that + can be used to + + assert statements as the DID subject. + capability_invocation: + type: array + items: + type: string + description: >- + capabilityInvocation is a list of verification methods + that can be used to + + invoke capabilities as the DID subject. + capability_delegation: + type: array + items: + type: string + description: >- + capabilityDelegation is a list of verification methods + that can be used to + + delegate capabilities as the DID subject. + key_agreement: + type: array + items: + type: string + description: >- + keyAgreement is a list of verification methods that + can be used to perform + + key agreement as the DID subject. + service: + type: array + items: + type: object + properties: + id: + type: string + title: >- + id is the unique identifier of the service. + + Format: + did:cheqd::# + service_type: + type: string + title: |- + type is the type of the service. + Example: LinkedResource + service_endpoint: + type: array + items: + type: string + title: |- + serviceEndpoint is the endpoint of the service. + Example: https://example.com/endpoint + title: >- + Service defines a service, as defined in the DID + Core specification. + + Documentation: + https://www.w3.org/TR/did-core/#services + description: >- + service is a list of services that can be used to + interact with the DID subject. + also_known_as: + type: array + items: + type: string + description: >- + alsoKnownAs is a list of DIDs that are known to refer + to the same DID subject. + title: >- + DidDoc defines a DID Document, as defined in the DID Core + specification. + + Documentation: https://www.w3.org/TR/did-core/ + metadata: + description: didDocumentMetadata is the DID Document metadata. + type: object + properties: + created: + type: string + format: date-time + title: >- + created is the timestamp of the creation of the DID + Document. + + Format: RFC3339 + + Example: 2021-03-10T15:16:17Z + updated: + type: string + format: date-time + title: >- + updated is the timestamp of the last update of the DID + Document. + + Format: RFC3339 + + Example: 2021-03-10T15:16:17Z + deactivated: + type: boolean + title: >- + deactivated is a flag that indicates whether the DID + Document is deactivated. + + Default: false + version_id: + type: string + title: >- + version_id is the version identifier of the DID + Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + next_version_id: + type: string + title: >- + next_version_id is the version identifier of the next + version of the DID Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + previous_version_id: + type: string + title: >- + previous_version_id is the version identifier of the + previous version of the DID Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + title: >- + Metadata defines DID Document metadata, as defined in the + DID Core specification. + + Documentation: + https://www.w3.org/TR/did-core/#did-document-metadata-properties + description: >- + DidDocWithMetadata defines a DID Document with metadata, as + defined in the DID Core specification. + + Contains the DID Document, as well as DID Document metadata. + title: >- + QueryDidDocVersionResponse is the response type for the + Query/DidDocVersion method + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: id + description: |- + DID unique identifier of the DID Document to fetch. + UUID-style DIDs as well as Indy-style DID are supported. + + Format: did:cheqd:: + + Examples: + - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j + in: path + required: true + type: string + - name: version + description: |- + Unique version identifier of the DID Document to fetch. + Returns the specified version of the DID Document. + + Format: + + Example: 93f2573c-eca9-4098-96cb-a1ec676a29ed + in: path + required: true + type: string + tags: + - Query + /cheqd/did/v2/{id}/versions: + get: + summary: Fetch list of all versions of DID Documents for a given DID + operationId: AllDidDocVersionsMetadata + responses: + '200': + description: A successful response. + schema: + type: object + properties: + versions: + type: array + items: + type: object + properties: + created: + type: string + format: date-time + title: >- + created is the timestamp of the creation of the DID + Document. + + Format: RFC3339 + + Example: 2021-03-10T15:16:17Z + updated: + type: string + format: date-time + title: >- + updated is the timestamp of the last update of the DID + Document. + + Format: RFC3339 + + Example: 2021-03-10T15:16:17Z + deactivated: + type: boolean + title: >- + deactivated is a flag that indicates whether the DID + Document is deactivated. + + Default: false + version_id: + type: string + title: >- + version_id is the version identifier of the DID + Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + next_version_id: + type: string + title: >- + next_version_id is the version identifier of the next + version of the DID Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + previous_version_id: + type: string + title: >- + previous_version_id is the version identifier of the + previous version of the DID Document. + + Format: UUID + + Example: 123e4567-e89b-12d3-a456-426655440000 + title: >- + Metadata defines DID Document metadata, as defined in the + DID Core specification. + + Documentation: + https://www.w3.org/TR/did-core/#did-document-metadata-properties + title: >- + versions is the list of all versions of the requested DID + Document + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryAllDidDocVersionsMetadataResponse is the response type for + the Query/AllDidDocVersionsMetadata method + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: id + description: |- + DID unique identifier of the DID Document to fetch version metadata. + UUID-style DIDs as well as Indy-style DID are supported. + + Format: did:cheqd:: + + Examples: + - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cheqd/resource/v2/{collection_id}/metadata: + get: + summary: Fetch all resource metadata from a collection with a given collection_id + operationId: CollectionResources + responses: + '200': + description: A successful response. + schema: + type: object + properties: + resources: + type: array + items: + type: object + properties: + collection_id: + type: string + title: >- + collection_id is the ID of the collection that the + Resource belongs to. Defined client-side. + + This field is the unique identifier of the DID linked to + this Resource + id: + type: string + title: >- + id is the ID of the Resource. Defined client-side. + + This field is a unique identifier for this specific + version of the Resource. + + Format: + name: + type: string + title: >- + name is a human-readable name for the Resource. Defined + client-side. + + Does not change between different versions. + + Example: PassportSchema, EducationTrustRegistry + version: + type: string + title: >- + version is a human-readable semantic version for the + Resource. Defined client-side. + + Stored as a string. OPTIONAL. + + Example: 1.0.0, v2.1.0 + resource_type: + type: string + title: >- + resource_type is a Resource type that identifies what + the Resource is. Defined client-side. + + This is NOT the same as the resource's media type. + + Example: AnonCredsSchema, StatusList2021 + also_known_as: + type: array + items: + type: object + properties: + uri: + type: string + title: >- + uri is the URI of the Resource. + + Examples: + + - + did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + + - + https://resolver..cheqd.net/1.0/identifiers/did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + + - https://example.com/example.json + + - + https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + + - + ipfs://bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + description: + type: string + title: >- + description is a human-readable description of the + URI. Defined client-side. + + Examples: + + - did-uri + + - http-uri + + - ipfs-uri + description: >- + AlternativeUri are alternative URIs that can be used + to access the Resource. + + By default, at least the DID URI equivalent of the + Resource is populated. + description: List of alternative URIs for the SAME Resource. + media_type: + type: string + title: >- + media_type is IANA media type of the Resource. Defined + ledger-side. + + Example: application/json, image/png + created: + type: string + format: date-time + title: >- + created is the time at which the Resource was created. + Defined ledger-side. + + Format: RFC3339 + + Example: 2021-01-01T00:00:00Z + checksum: + type: string + title: >- + checksum is a SHA-256 checksum hash of the Resource. + Defined ledger-side. + + Example: + d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f + previous_version_id: + type: string + title: >- + previous_version_id is the ID of the previous version of + the Resource. Defined ledger-side. + + This is based on the Resource's name and Resource type + to determine whether it's the same Resource. + + Format: + next_version_id: + type: string + title: >- + next_version_id is the ID of the next version of the + Resource. Defined ledger-side. + + This is based on the Resource's name and Resource type + to determine whether it's the same Resource. + + Format: + title: Metadata stores the metadata of a DID-Linked Resource + title: resources is the requested collection of resource metadata + title: >- + QueryCollectionResourcesResponse is the response type for the + Query/CollectionResources RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: collection_id + description: >- + collection_id is an identifier of the DidDocument the resource + belongs to. + + Format: + + + Examples: + + - c82f2b02-bdab-4dd7-b833-3e143745d612 + + - wGHEXrZvJxR8vw5P3UWH1j + in: path + required: true + type: string + tags: + - Query + /cheqd/resource/v2/{collection_id}/resources/{id}: + get: + summary: Fetch a resource from a collection with a given collection_id and id + operationId: Resource + responses: + '200': + description: A successful response. + schema: + type: object + properties: + resource: + title: >- + Successful resolution of the resource returns the following: + + - resource is the requested resource + + - metadata is the resource metadata associated with the + requested resource + type: object + properties: + resource: + type: object + properties: + data: + type: string + format: byte + title: bytes is the raw data of the Resource + title: Resource stores the contents of a DID-Linked Resource + metadata: + type: object + properties: + collection_id: + type: string + title: >- + collection_id is the ID of the collection that the + Resource belongs to. Defined client-side. + + This field is the unique identifier of the DID linked + to this Resource + id: + type: string + title: >- + id is the ID of the Resource. Defined client-side. + + This field is a unique identifier for this specific + version of the Resource. + + Format: + name: + type: string + title: >- + name is a human-readable name for the Resource. + Defined client-side. + + Does not change between different versions. + + Example: PassportSchema, EducationTrustRegistry + version: + type: string + title: >- + version is a human-readable semantic version for the + Resource. Defined client-side. + + Stored as a string. OPTIONAL. + + Example: 1.0.0, v2.1.0 + resource_type: + type: string + title: >- + resource_type is a Resource type that identifies what + the Resource is. Defined client-side. + + This is NOT the same as the resource's media type. + + Example: AnonCredsSchema, StatusList2021 + also_known_as: + type: array + items: + type: object + properties: + uri: + type: string + title: >- + uri is the URI of the Resource. + + Examples: + + - + did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + + - + https://resolver..cheqd.net/1.0/identifiers/did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + + - https://example.com/example.json + + - + https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + + - + ipfs://bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + description: + type: string + title: >- + description is a human-readable description of + the URI. Defined client-side. + + Examples: + + - did-uri + + - http-uri + + - ipfs-uri + description: >- + AlternativeUri are alternative URIs that can be used + to access the Resource. + + By default, at least the DID URI equivalent of the + Resource is populated. + description: List of alternative URIs for the SAME Resource. + media_type: + type: string + title: >- + media_type is IANA media type of the Resource. Defined + ledger-side. + + Example: application/json, image/png + created: + type: string + format: date-time + title: >- + created is the time at which the Resource was created. + Defined ledger-side. + + Format: RFC3339 + + Example: 2021-01-01T00:00:00Z + checksum: + type: string + title: >- + checksum is a SHA-256 checksum hash of the Resource. + Defined ledger-side. + + Example: + d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f + previous_version_id: + type: string + title: >- + previous_version_id is the ID of the previous version + of the Resource. Defined ledger-side. + + This is based on the Resource's name and Resource type + to determine whether it's the same Resource. + + Format: + next_version_id: + type: string + title: >- + next_version_id is the ID of the next version of the + Resource. Defined ledger-side. + + This is based on the Resource's name and Resource type + to determine whether it's the same Resource. + + Format: + title: Metadata stores the metadata of a DID-Linked Resource + title: >- + QueryResourceResponse is the response type for the Query/Resource + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: collection_id + description: >- + collection_id is an identifier of the DidDocument the resource + belongs to. + + Format: + + + Examples: + + - c82f2b02-bdab-4dd7-b833-3e143745d612 + + - wGHEXrZvJxR8vw5P3UWH1j + in: path + required: true + type: string + - name: id + description: |- + id is a unique id of the resource. + Format: + in: path + required: true + type: string + tags: + - Query + /cheqd/resource/v2/{collection_id}/resources/{id}/metadata: + get: + summary: >- + Fetch a resource's metadata from a collection with a given collection_id + and id + operationId: ResourceMetadata + responses: + '200': + description: A successful response. + schema: + type: object + properties: + resource: + type: object + properties: + collection_id: + type: string + title: >- + collection_id is the ID of the collection that the + Resource belongs to. Defined client-side. + + This field is the unique identifier of the DID linked to + this Resource + id: + type: string + title: >- + id is the ID of the Resource. Defined client-side. + + This field is a unique identifier for this specific + version of the Resource. + + Format: + name: + type: string + title: >- + name is a human-readable name for the Resource. Defined + client-side. + + Does not change between different versions. + + Example: PassportSchema, EducationTrustRegistry + version: + type: string + title: >- + version is a human-readable semantic version for the + Resource. Defined client-side. + + Stored as a string. OPTIONAL. + + Example: 1.0.0, v2.1.0 + resource_type: + type: string + title: >- + resource_type is a Resource type that identifies what the + Resource is. Defined client-side. + + This is NOT the same as the resource's media type. + + Example: AnonCredsSchema, StatusList2021 + also_known_as: + type: array + items: + type: object + properties: + uri: + type: string + title: >- + uri is the URI of the Resource. + + Examples: + + - + did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + + - + https://resolver..cheqd.net/1.0/identifiers/did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + + - https://example.com/example.json + + - + https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + + - + ipfs://bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + description: + type: string + title: >- + description is a human-readable description of the + URI. Defined client-side. + + Examples: + + - did-uri + + - http-uri + + - ipfs-uri + description: >- + AlternativeUri are alternative URIs that can be used to + access the Resource. + + By default, at least the DID URI equivalent of the + Resource is populated. + description: List of alternative URIs for the SAME Resource. + media_type: + type: string + title: >- + media_type is IANA media type of the Resource. Defined + ledger-side. + + Example: application/json, image/png + created: + type: string + format: date-time + title: >- + created is the time at which the Resource was created. + Defined ledger-side. + + Format: RFC3339 + + Example: 2021-01-01T00:00:00Z + checksum: + type: string + title: >- + checksum is a SHA-256 checksum hash of the Resource. + Defined ledger-side. + + Example: + d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f + previous_version_id: + type: string + title: >- + previous_version_id is the ID of the previous version of + the Resource. Defined ledger-side. + + This is based on the Resource's name and Resource type to + determine whether it's the same Resource. + + Format: + next_version_id: + type: string + title: >- + next_version_id is the ID of the next version of the + Resource. Defined ledger-side. + + This is based on the Resource's name and Resource type to + determine whether it's the same Resource. + + Format: + title: Metadata stores the metadata of a DID-Linked Resource + title: >- + QueryResourceMetadataResponse is the response type for the + Query/ResourceMetadata RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: collection_id + description: >- + collection_id is an identifier of the DidDocument the resource + belongs to. + + Format: + + + Examples: + + - c82f2b02-bdab-4dd7-b833-3e143745d612 + + - wGHEXrZvJxR8vw5P3UWH1j + in: path + required: true + type: string + - name: id + description: |- + id is a unique id of the resource. + Format: + in: path + required: true + type: string + tags: + - Query diff --git a/api/go.mod b/api/go.mod new file mode 100644 index 000000000..db201e08a --- /dev/null +++ b/api/go.mod @@ -0,0 +1,22 @@ +module github.com/cheqd/cheqd-node/api + +go 1.18 + +require ( + github.com/cosmos/cosmos-proto v1.0.0-alpha7 + github.com/cosmos/cosmos-sdk/api v0.1.0 + github.com/cosmos/gogoproto v1.4.3 + github.com/rakyll/statik v0.1.7 + google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 + google.golang.org/grpc v1.51.0 + google.golang.org/protobuf v1.28.1 +) + +require ( + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.7 // indirect + golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect + golang.org/x/text v0.4.0 // indirect +) diff --git a/api/go.sum b/api/go.sum new file mode 100644 index 000000000..f69f55fb1 --- /dev/null +++ b/api/go.sum @@ -0,0 +1,166 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= +github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= +github.com/cosmos/cosmos-sdk/api v0.1.0 h1:xfSKM0e9p+EJTMQnf5PbWE6VT8ruxTABIJ64Rd064dE= +github.com/cosmos/cosmos-sdk/api v0.1.0/go.mod h1:CupqQBskAOiTXO1XDZ/wrtWzN/wTxUvbQmOqdUhR8wI= +github.com/cosmos/gogoproto v1.4.3 h1:RP3yyVREh9snv/lsOvmsAPQt8f44LgL281X0IOIhhcI= +github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= +github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 h1:ErU+UA6wxadoU8nWrsy5MZUVBs75K17zUCsUCIfrXCE= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= diff --git a/app/ante.go b/app/ante.go index 85fe86ccd..d67f46aff 100644 --- a/app/ante.go +++ b/app/ante.go @@ -8,8 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/auth/types" - ibcante "github.com/cosmos/ibc-go/v5/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper" + ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper" ) // HandlerOptions are the options required for constructing a default SDK AnteHandler. @@ -58,7 +58,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer), ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), ante.NewIncrementSequenceDecorator(options.AccountKeeper), - // v4 -> v5 ibc-go migration + // v4 -> v5 ibc-go migration, v6 does not need migration ibcante.NewRedundantRelayDecorator(options.IBCKeeper), } diff --git a/app/app.go b/app/app.go index 4bd896940..fdaecfe17 100644 --- a/app/app.go +++ b/app/app.go @@ -86,27 +86,27 @@ import ( upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts" - icacontroller "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller" - icacontrollerkeeper "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" - icahost "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" - ibcfee "github.com/cosmos/ibc-go/v5/modules/apps/29-fee" - ibcfeekeeper "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/keeper" - ibcfeetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types" - transfer "github.com/cosmos/ibc-go/v5/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v5/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v5/modules/core" - ibcclient "github.com/cosmos/ibc-go/v5/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v5/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v5/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v5/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper" + ica "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts" + icacontroller "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller" + icacontrollerkeeper "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types" + ibcfee "github.com/cosmos/ibc-go/v6/modules/apps/29-fee" + ibcfeekeeper "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/keeper" + ibcfeetypes "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types" + transfer "github.com/cosmos/ibc-go/v6/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v6/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v6/modules/core" + ibcclient "github.com/cosmos/ibc-go/v6/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v6/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types" + porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" @@ -454,12 +454,9 @@ func New( app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( appCodec, keys[ibcfeetypes.StoreKey], - app.GetSubspace(ibcfeetypes.ModuleName), app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - app.AccountKeeper, - app.BankKeeper, + &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, ) // ICA Controller keeper @@ -527,6 +524,9 @@ func New( AddRoute(icacontrollertypes.SubModuleName, icaControllerStack). AddRoute(icahosttypes.SubModuleName, icaHostStack) + // Seal the IBC Router + app.IBCKeeper.SetRouter(ibcRouter) + // Create ICA module icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper) @@ -676,33 +676,6 @@ func New( paramstypes.ModuleName, ) - // Uncomment if you want to set a custom migration order here. - app.mm.SetOrderMigrations( - upgradetypes.ModuleName, - capabilitytypes.ModuleName, - minttypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - evidencetypes.ModuleName, - stakingtypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - govtypes.ModuleName, - crisistypes.ModuleName, - ibchost.ModuleName, - ibctransfertypes.ModuleName, - icatypes.ModuleName, - ibcfeetypes.ModuleName, - genutiltypes.ModuleName, - authz.ModuleName, - group.ModuleName, - feegrant.ModuleName, - paramstypes.ModuleName, - vestingtypes.ModuleName, - didtypes.ModuleName, - resourcetypes.ModuleName, - ) - app.mm.RegisterInvariants(&app.CrisisKeeper) app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) @@ -743,15 +716,6 @@ func New( app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) - // nolint: errcheck - app.configurator.RegisterMigration( - didtypes.ModuleName, - 3, - func(ctx sdk.Context) error { - return nil - }, - ) - // Upgrade handler for the next release app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { @@ -759,105 +723,99 @@ func New( // Fix lack of version map initialization in InitChainer for new chains if len(fromVM) == 0 { - println("Initializing version map") - - // Add defaults for did subspace - didSubspace := app.GetSubspace(didtypes.ModuleName) - didSubspace.Set(ctx, didtypes.ParamStoreKeyFeeParams, didtypes.DefaultFeeParams()) - - // Add defaults for resource subspace - resourceSubspace := app.GetSubspace(resourcetypes.ModuleName) - resourceSubspace.Set(ctx, resourcetypes.ParamStoreKeyFeeParams, resourcetypes.DefaultFeeParams()) + ctx.Logger().Info("Version map is empty. Initialising to required values.") + + // Set these explicitly to avoid calling InitGenesis on modules that don't need it. + // Explicitly skipping x/auth migrations. + fromVM = map[string]uint64{ + "auth": 2, + "authz": 1, + "bank": 2, + "capability": 1, + "cheqd": 3, + "crisis": 1, + "distribution": 2, + "evidence": 1, + "feegrant": 1, + "genutil": 1, + "gov": 2, + "ibc": 2, + "interchainaccounts": 1, + "mint": 1, + "params": 1, + "resource": 1, + "slashing": 2, + "staking": 2, + "transfer": 1, + "upgrade": 1, + "vesting": 1, + } + } - // Add defaults for staking subspace - stakingSubspace, _ := app.ParamsKeeper.GetSubspace(stakingtypes.ModuleName) - stakingSubspace.Set(ctx, stakingtypes.KeyMinCommissionRate, sdk.NewDec(0)) + ctx.Logger().Info("Version map is populated. Running migrations.") + ctx.Logger().Debug(fmt.Sprintf("fromVm: %v", fromVM)) - // Fix version map - versionMap := app.mm.GetVersionMap() + // Get current version map + newVM := app.mm.GetVersionMap() + ctx.Logger().Debug(fmt.Sprintf("newVM: %v", newVM)) - for moduleName := range versionMap { - fromVM[moduleName] = versionMap[moduleName] - } - } else { - println("Version map already initialized") - - // Add defaults for staking subspace - stakingSubspace, _ := app.ParamsKeeper.GetSubspace(stakingtypes.ModuleName) - stakingSubspace.Set(ctx, stakingtypes.KeyMinCommissionRate, sdk.NewDec(0)) - - // Add defaults for did subspace - didSubspace := app.GetSubspace(didtypes.ModuleName) - didSubspace.Set(ctx, didtypes.ParamStoreKeyFeeParams, didtypes.DefaultFeeParams()) - - // Add defaults for resource subspace - resourceSubspace := app.GetSubspace(resourcetypes.ModuleName) - resourceSubspace.Set(ctx, resourcetypes.ParamStoreKeyFeeParams, resourcetypes.DefaultFeeParams()) - - // Re-register ICA module with correct ICA controller and host params & store keys - // This is required because the ICA module was registered with the wrong params & store keys in the previous release - // What's changed: - // Added: []string{ - // icahosttypes.StoreKey, - // icacontrollertypes.StoreKey, // <-- this is the new store key ehich was missing in the previous release - // }, - - // set the ICS27 consensus version so InitGenesis is not run - fromVM[icatypes.ModuleName] = icaModule.ConsensusVersion() - - // create ICS27 Controller submodule params - controllerParams := icacontrollertypes.Params{ - ControllerEnabled: true, - } + // Set cheqd/DID module to ConsensusVersion + fromVM[didtypes.ModuleName] = newVM[didtypes.ModuleName] - // create ICS27 Host submodule params - hostParams := icahosttypes.Params{ - HostEnabled: true, - AllowMessages: []string{ - authzMsgExec, - authzMsgGrant, - authzMsgRevoke, - bankMsgSend, - bankMsgMultiSend, - distrMsgSetWithdrawAddr, - distrMsgWithdrawValidatorCommission, - distrMsgFundCommunityPool, - distrMsgWithdrawDelegatorReward, - feegrantMsgGrantAllowance, - feegrantMsgRevokeAllowance, - govMsgVoteWeighted, - govMsgSubmitProposal, - govMsgDeposit, - govMsgVote, - stakingMsgEditValidator, - stakingMsgDelegate, - stakingMsgUndelegate, - stakingMsgBeginRedelegate, - stakingMsgCreateValidator, - vestingMsgCreateVestingAccount, - ibcMsgTransfer, - // cheqd namespace - didMsgCreateDidDoc, - didMsgUpdateDidDoc, - didMsgDeactivateDidDoc, - resourceMsgCreateResource, - }, - } + // Set resource module to ConsensusVersion + fromVM[resourcetypes.ModuleName] = newVM[resourcetypes.ModuleName] - // initialize ICS27 module - ctx.Logger().Info("start to init interchainaccount module...") - icaModule.InitModule(ctx, controllerParams, hostParams) + // Add defaults for DID module subspace + didSubspace := app.GetSubspace(didtypes.ModuleName) + didSubspace.Set(ctx, didtypes.ParamStoreKeyFeeParams, didtypes.DefaultFeeParams()) - // Get the current version map - versionMap := app.mm.GetVersionMap() + // Add defaults for resource subspace + resourceSubspace := app.GetSubspace(resourcetypes.ModuleName) + resourceSubspace.Set(ctx, resourcetypes.ParamStoreKeyFeeParams, resourcetypes.DefaultFeeParams()) - fmt.Println("Current version map: ", fromVM) - fmt.Println("Expected version map: ", versionMap) + // create ICS27 Controller submodule params + controllerParams := icacontrollertypes.Params{ + ControllerEnabled: true, + } - // Skip resource module InitGenesis (was not present in v0.6.x) - fromVM[resourcetypes.ModuleName] = versionMap[resourcetypes.ModuleName] + // create ICS27 Host submodule params + hostParams := icahosttypes.Params{ + HostEnabled: true, + AllowMessages: []string{ + authzMsgExec, + authzMsgGrant, + authzMsgRevoke, + bankMsgSend, + bankMsgMultiSend, + distrMsgSetWithdrawAddr, + distrMsgWithdrawValidatorCommission, + distrMsgFundCommunityPool, + distrMsgWithdrawDelegatorReward, + feegrantMsgGrantAllowance, + feegrantMsgRevokeAllowance, + govMsgVoteWeighted, + govMsgSubmitProposal, + govMsgDeposit, + govMsgVote, + stakingMsgEditValidator, + stakingMsgDelegate, + stakingMsgUndelegate, + stakingMsgBeginRedelegate, + stakingMsgCreateValidator, + vestingMsgCreateVestingAccount, + ibcMsgTransfer, + // cheqd namespace + didMsgCreateDidDoc, + didMsgUpdateDidDoc, + didMsgDeactivateDidDoc, + resourceMsgCreateResource, + }, } + // initialize ICS27 module + ctx.Logger().Debug("Initialise interchainaccount module...") + icaModule.InitModule(ctx, controllerParams, hostParams) + // cheqd migrations migrationContext := migrations.NewMigrationContext( app.appCodec, @@ -867,6 +825,7 @@ func New( app.GetSubspace(resourcetypes.ModuleName), ) + ctx.Logger().Debug("Initialise cheqd DID and Resource module migrations...") cheqdMigrator := migrations.NewMigrator( migrationContext, []migrations.Migration{ @@ -883,7 +842,7 @@ func New( migrations.MigrateResourceUUID, // Did version id - migrations.MigrateDidVersionId, + migrations.MigrateDidVersionID, // Resource checksum migrations.MigrateResourceChecksum, @@ -892,7 +851,7 @@ func New( migrations.MigrateResourceVersionLinks, // Resource default alternative url - migrations.MigrateResourceDefaultAlternativeUrl, + migrations.MigrateResourceDefaultAlternativeURL, }) err = cheqdMigrator.Migrate(ctx) @@ -900,9 +859,11 @@ func New( panic(err) } - // ibc v3 -> v4 migration - // transfer module consensus version has been bumped to 2 - return app.mm.RunMigrations(ctx, app.configurator, fromVM) + // Run all default migrations + ctx.Logger().Debug(fmt.Sprintf("fromVM (for default RunMigrations): %v", fromVM)) + toVM, err := app.mm.RunMigrations(ctx, app.configurator, fromVM) + ctx.Logger().Debug(fmt.Sprintf("toVM (version map after RunMigrations): %v", toVM)) + return toVM, err }) if loadLatest { @@ -934,14 +895,11 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo // InitChainer application update at chain initialization func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - // FIXME: This should have been done from the beginning. - // Now this would break consensus with existing networks. - // so ModuleVersionMap is initialized as part of upgrade xxx. var genesisState GenesisState if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - // app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) return app.mm.InitGenesis(ctx, app.appCodec, genesisState) } diff --git a/app/const.go b/app/const.go index 02a16e657..866176da0 100644 --- a/app/const.go +++ b/app/const.go @@ -4,7 +4,7 @@ const ( Name = "cheqd-node" Home = ".cheqdnode" - UpgradeName = "v1.0.0" + UpgradeName = "v1" // allowed msg types of ica host authzMsgExec = "/cosmos.authz.v1beta1.MsgExec" diff --git a/app/migrations/helpers/indy_style.go b/app/migrations/helpers/indy_style.go index 7a4ac9355..e1fb743d5 100644 --- a/app/migrations/helpers/indy_style.go +++ b/app/migrations/helpers/indy_style.go @@ -9,10 +9,10 @@ import ( func MigrateIndyStyleDid(did string) string { method, namespace, id := didutils.MustSplitDID(did) - return didutils.JoinDID(method, namespace, MigrateIndyStyleId(id)) + return didutils.JoinDID(method, namespace, MigrateIndyStyleID(id)) } -func MigrateIndyStyleId(id string) string { +func MigrateIndyStyleID(id string) string { // If id is UUID it should not be changed if didutils.IsValidUUID(id) { return id diff --git a/app/migrations/helpers/indy_style_test.go b/app/migrations/helpers/indy_style_test.go index a22a82ed7..facde5668 100644 --- a/app/migrations/helpers/indy_style_test.go +++ b/app/migrations/helpers/indy_style_test.go @@ -8,7 +8,7 @@ import ( var _ = DescribeTable( "Positive/Negative entries for checking indy style identifier compiling", func(id string, outputStr string) { - Expect(MigrateIndyStyleId(id)).To(Equal(outputStr)) + Expect(MigrateIndyStyleID(id)).To(Equal(outputStr)) }, Entry("Valid: Real case: 16-symbol id", "zGqsJraNJCojDzG4", "QQHVWEaGae5Jts1quynR6M"), diff --git a/app/migrations/helpers/protobuf.go b/app/migrations/helpers/protobuf.go new file mode 100644 index 000000000..dcdc833c6 --- /dev/null +++ b/app/migrations/helpers/protobuf.go @@ -0,0 +1,34 @@ +package helpers + +import ( + "time" + + "github.com/multiformats/go-multibase" +) + +func GenerateEd25519VerificationKey2020VerificationMaterial(publicKey string) (string, error) { + encoding, publicKeyBytes, err := multibase.Decode(publicKey) + if encoding != multibase.Base58BTC { + panic("Only Base58BTC encoding is supported") + } + if err != nil { + return "", err + } + publicKeyMultibaseBytes := []byte{0xed, 0x01} + publicKeyMultibaseBytes = append(publicKeyMultibaseBytes, publicKeyBytes...) + + return multibase.Encode(multibase.Base58BTC, publicKeyMultibaseBytes) +} + +func MustParseFromStringTimeToGoTime(timeString string) time.Time { + // If timeString is empty return default nullable time value (0001-01-01 00:00:00 +0000 UTC) + if timeString == "" { + return time.Time{} + } + + t, err := time.Parse(time.RFC3339, timeString) + if err != nil { + panic(err) + } + return t +} diff --git a/app/migrations/helpers/protobuf_test.go b/app/migrations/helpers/protobuf_test.go new file mode 100644 index 000000000..9309f7c01 --- /dev/null +++ b/app/migrations/helpers/protobuf_test.go @@ -0,0 +1,19 @@ +package helpers + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = DescribeTable( + "Test GenerateEd25519VerificationKey2020VerificationMaterial", + func(v1PubKey string, v2PubKey string) { + key, err := GenerateEd25519VerificationKey2020VerificationMaterial(v1PubKey) + Expect(err).To(BeNil()) + Expect(key).To(Equal(v2PubKey)) + }, + + Entry("Valid: General conversion", "zDw21irq4wBfyTvxAG9L8PQj6b79iyTyzyV6XVj9SfyRR", "z6MksPH4K75WGjASaRnrwiHyEWH6QgRaPMEMfW1TL17TbCCo"), + // Mainnet case + Entry("Valid: Real case", "zF7rhDBfUt9d1gJPjx7s1JXfUY7oVWkYsWCo7fztHtepn", "z6Mkta7joRuvDh7UnoESdgpr9dDUMh5LvdoECDi3WGrJoscA"), +) diff --git a/app/migrations/helpers/uuid.go b/app/migrations/helpers/uuid.go index 053b468cd..f39261d66 100644 --- a/app/migrations/helpers/uuid.go +++ b/app/migrations/helpers/uuid.go @@ -21,6 +21,6 @@ func MigrateUUIDId(id string) string { return id } - newId := uuid.NewSHA1(uuid.Nil, []byte(id)) - return didutils.NormalizeUUID(newId.String()) + newID := uuid.NewSHA1(uuid.Nil, []byte(id)) + return didutils.NormalizeUUID(newID.String()) } diff --git a/app/migrations/migration_did_indy_style.go b/app/migrations/migration_did_indy_style.go index e1fca8aef..2e122641f 100644 --- a/app/migrations/migration_did_indy_style.go +++ b/app/migrations/migration_did_indy_style.go @@ -8,10 +8,13 @@ import ( // This migration should be run after protobuf that's why we use new DidDocWithMetadata func MigrateDidIndyStyle(sctx sdk.Context, mctx MigrationContext) error { - println("Indy style migration for dids") + sctx.Logger().Debug("MigrateDidIndyStyle: Starting migration") + return MigrateDidSimple(sctx, mctx, func(didDocWithMetadata *didtypes.DidDocWithMetadata) { - // Migrate all dids, make them indy style + sctx.Logger().Debug("MigrateDidIndyStyle: OldDID: " + didDocWithMetadata.DidDoc.Id) + // Migrate from old Indy style DIDs to new Indy DIDs newDid := helpers.MigrateIndyStyleDid(didDocWithMetadata.DidDoc.Id) didDocWithMetadata.ReplaceDids(didDocWithMetadata.DidDoc.Id, newDid) + sctx.Logger().Debug("MigrateDidIndyStyle: NewDID: " + didDocWithMetadata.DidDoc.Id) }) } diff --git a/app/migrations/migration_did_protobuf.go b/app/migrations/migration_did_protobuf.go index 42794537f..cc586f6be 100644 --- a/app/migrations/migration_did_protobuf.go +++ b/app/migrations/migration_did_protobuf.go @@ -13,21 +13,27 @@ import ( ) func MigrateDidProtobuf(sctx sdk.Context, mctx MigrationContext) error { - println("Protobuf migration for dids. Start") + sctx.Logger().Debug("MigrateDidProtobuf: Starting migration") + codec := NewLegacyProtoCodec() store := sctx.KVStore(mctx.didStoreKey) + sctx.Logger().Debug("MigrateDidProtobuf: Erasing old count key") // Erase old broken count key store.Delete([]byte(didtypesv1.DidCountKey + didtypesv1.DidCountKey)) - println("Protobuf migration for dids. Read all keys") + sctx.Logger().Debug("MigrateResourceProtobuf: Reading all keys") didKeys := helpers.ReadAllKeys(store, didutils.StrBytes(didtypesv1.DidKey)) for _, didKey := range didKeys { + sctx.Logger().Debug("MigrateDidProtobuf: Starting migration for didKey: " + string(didKey)) + var stateValue didtypesv1.StateValue + sctx.Logger().Debug("MigrateDidProtobuf: Reading StateValue of DID from store") codec.MustUnmarshal(store.Get(didKey), &stateValue) - newDidDocWithMetadata, err := MigrateStateValue(&stateValue) + sctx.Logger().Debug("MigrateDidProtobuf: Migrating StateValue for DidDocWithMetadata") + newDidDocWithMetadata, err := MigrateStateValue(sctx, mctx, &stateValue) if err != nil { return err } @@ -35,18 +41,20 @@ func MigrateDidProtobuf(sctx sdk.Context, mctx MigrationContext) error { // Remove old DID Doc store.Delete(didKey) + sctx.Logger().Debug("MigrateDidProtobuf: Setting DidDocWithMetadata to store") // Set new DID Doc err = mctx.didKeeperNew.AddNewDidDocVersion(&sctx, &newDidDocWithMetadata) if err != nil { return err } + sctx.Logger().Debug("MigrateDidProtobuf: Migration finished for didKey: " + string(didKey)) } // Migrate DID namespace (at least make sure it's not changed) if didtypesv1.DidNamespaceKey != didtypes.DidNamespaceKey { panic("DID namespace key is changed") } - println("Protobuf migration for dids. End") + sctx.Logger().Debug("MigrateDidProtobuf: Migration finished") return nil } @@ -60,7 +68,7 @@ func NewLegacyProtoCodec() *codec.ProtoCodec { return codec.NewProtoCodec(ir) } -func MigrateStateValue(stateValue *didtypesv1.StateValue) (didtypes.DidDocWithMetadata, error) { +func MigrateStateValue(sctx sdk.Context, mctx MigrationContext, stateValue *didtypesv1.StateValue) (didtypes.DidDocWithMetadata, error) { oldDidDoc, err := stateValue.UnpackDataAsDid() if err != nil { return didtypes.DidDocWithMetadata{}, err @@ -68,8 +76,10 @@ func MigrateStateValue(stateValue *didtypesv1.StateValue) (didtypes.DidDocWithMe oldMetadata := stateValue.Metadata + sctx.Logger().Debug("MigrateDidProtobuf: OldMetadata: " + string(mctx.codec.MustMarshalJSON(oldMetadata))) newDidDoc := MigrateDidDoc(oldDidDoc) newMetadata := MigrateMetadata(oldMetadata) + sctx.Logger().Debug("MigrateDidProtobuf: NewMetadata: " + string(mctx.codec.MustMarshalJSON(&newMetadata))) return didtypes.DidDocWithMetadata{ DidDoc: &newDidDoc, @@ -78,9 +88,10 @@ func MigrateStateValue(stateValue *didtypesv1.StateValue) (didtypes.DidDocWithMe } func MigrateMetadata(metadata *didtypesv1.Metadata) didtypes.Metadata { + updated := helpers.MustParseFromStringTimeToGoTime(metadata.Updated) return didtypes.Metadata{ - Created: metadata.Created, - Updated: metadata.Updated, + Created: helpers.MustParseFromStringTimeToGoTime(metadata.Created), + Updated: &updated, Deactivated: metadata.Deactivated, VersionId: metadata.VersionId, NextVersionId: "", @@ -94,10 +105,10 @@ func MigrateDidDoc(oldDid *didtypesv1.Did) didtypes.DidDoc { vms = append( vms, &didtypes.VerificationMethod{ - Id: vm.Id, - Type: MigrateType(vm.Type), - Controller: vm.Controller, - VerificationMaterial: MigrateVerificationMaterial(vm), + Id: vm.Id, + VerificationMethodType: MigrateType(vm.Type), + Controller: vm.Controller, + VerificationMaterial: MigrateVerificationMaterial(vm), }) } @@ -107,7 +118,7 @@ func MigrateDidDoc(oldDid *didtypesv1.Did) didtypes.DidDoc { srvs, &didtypes.Service{ Id: srv.Id, - Type: srv.Type, + ServiceType: srv.Type, ServiceEndpoint: []string{srv.ServiceEndpoint}, }) } @@ -130,9 +141,9 @@ func MigrateDidDoc(oldDid *didtypesv1.Did) didtypes.DidDoc { func MigrateType(t string) string { switch t { case didtypesv1.Ed25519VerificationKey2020: - return didtypes.Ed25519VerificationKey2020{}.Type() - case didtypesv1.JsonWebKey2020: - return didtypes.JsonWebKey2020{}.Type() + return didtypes.Ed25519VerificationKey2020Type + case didtypesv1.JSONWebKey2020: + return didtypes.JSONWebKey2020Type default: panic("Unknown type") } @@ -140,7 +151,7 @@ func MigrateType(t string) string { func MigrateVerificationMaterial(vm *didtypesv1.VerificationMethod) string { switch vm.Type { - case didtypesv1.JsonWebKey2020: + case didtypesv1.JSONWebKey2020: jwk := make(map[string]string) for _, kv := range vm.PublicKeyJwk { jwk[kv.Key] = kv.Value @@ -149,28 +160,15 @@ func MigrateVerificationMaterial(vm *didtypesv1.VerificationMethod) string { if err != nil { panic(err) } - - jwk2020 := didtypes.JsonWebKey2020{ - PublicKeyJwk: res, - } - res, err = json.Marshal(jwk2020) - if err != nil { - panic(err) - } - return string(res) case didtypesv1.Ed25519VerificationKey2020: - pk_multi := didtypes.Ed25519VerificationKey2020{ - PublicKeyMultibase: vm.PublicKeyMultibase, - } - - res, err := json.Marshal(pk_multi) + pkMulti, err := helpers.GenerateEd25519VerificationKey2020VerificationMaterial(vm.PublicKeyMultibase) if err != nil { panic(err) } - return string(res) + return pkMulti default: panic("Unknown type") diff --git a/app/migrations/migration_did_simple.go b/app/migrations/migration_did_simple.go index c2ba6725d..37a946baa 100644 --- a/app/migrations/migration_did_simple.go +++ b/app/migrations/migration_did_simple.go @@ -6,18 +6,18 @@ import ( ) func MigrateDidSimple(sctx sdk.Context, mctx MigrationContext, apply func(didDocWithMetadata *didtypes.DidDocWithMetadata)) error { - println("Migrate did simple. Start") + sctx.Logger().Debug("MigrateDidSimple: Starting migration") store := sctx.KVStore(mctx.didStoreKey) - println("Migrate did simple. Reset counter") + sctx.Logger().Debug("MigrateDidSimple: Resetting counter") // Reset counter mctx.didKeeperNew.SetDidDocCount(&sctx, 0) - // Colect all did doc vsersions + // Collect all DIDDoc versions var allDidDocVersions []didtypes.DidDocWithMetadata - println("Migrate did simple. Iterate all did docs") + sctx.Logger().Debug("MigrateDidSimple: Iterating through all DIDDocs") mctx.didKeeperNew.IterateAllDidDocVersions(&sctx, func(metadata didtypes.DidDocWithMetadata) bool { allDidDocVersions = append(allDidDocVersions, metadata) return true @@ -26,6 +26,10 @@ func MigrateDidSimple(sctx sdk.Context, mctx MigrationContext, apply func(didDoc // Iterate and migrate did docs. We can use single loop for removing old values, migration // and writing new values because there is only one version of each diddoc in the store for _, version := range allDidDocVersions { + // Needs for preventing using variables with the same address + version := version + sctx.Logger().Debug("MigrateDidSimple: Starting migration for DIDDoc: " + version.DidDoc.Id) + // Remove last version pointer latestVersionKey := didtypes.GetLatestDidDocVersionKey(version.DidDoc.Id) store.Delete(latestVersionKey) @@ -42,8 +46,9 @@ func MigrateDidSimple(sctx sdk.Context, mctx MigrationContext, apply func(didDoc if err != nil { return err } + sctx.Logger().Debug("MigrateDidSimple: Migration finished for DIDDoc: " + version.DidDoc.Id) } - println("Migrate did simple. Start") + sctx.Logger().Debug("MigrateDidSimple: Migration finished") return nil } diff --git a/app/migrations/migration_did_uuid.go b/app/migrations/migration_did_uuid.go index 61972dba1..17a9c75d2 100644 --- a/app/migrations/migration_did_uuid.go +++ b/app/migrations/migration_did_uuid.go @@ -8,10 +8,13 @@ import ( // This migration should be run after protobuf that's why we use new DidDocWithMetadata func MigrateDidUUID(sctx sdk.Context, mctx MigrationContext) error { - println("UUID migration for dids") + sctx.Logger().Debug("MigrateDidUUID: Starting migration") + return MigrateDidSimple(sctx, mctx, func(didDocWithMetadata *didtypes.DidDocWithMetadata) { + sctx.Logger().Debug("MigrateDidUUID: OldDID: " + didDocWithMetadata.DidDoc.Id) // Migrate uuid dids, make them normalized newDid := helpers.MigrateUUIDDid(didDocWithMetadata.DidDoc.Id) didDocWithMetadata.ReplaceDids(didDocWithMetadata.DidDoc.Id, newDid) + sctx.Logger().Debug("MigrateDidUUID: NewDID: " + didDocWithMetadata.DidDoc.Id) }) } diff --git a/app/migrations/migration_did_version_id.go b/app/migrations/migration_did_version_id.go index 564c947de..597f34a39 100644 --- a/app/migrations/migration_did_version_id.go +++ b/app/migrations/migration_did_version_id.go @@ -7,10 +7,13 @@ import ( ) // This migration should be run after protobuf that's why we use new DidDocWithMetadata -func MigrateDidVersionId(sctx sdk.Context, mctx MigrationContext) error { - println("Version id migration for dids") +func MigrateDidVersionID(sctx sdk.Context, mctx MigrationContext) error { + sctx.Logger().Debug("MigrateDidVersionID: Starting migration") + return MigrateDidSimple(sctx, mctx, func(didDocWithMetadata *didtypes.DidDocWithMetadata) { - versionId := uuid.NewSHA1(uuid.Nil, []byte(didDocWithMetadata.DidDoc.Id)) - didDocWithMetadata.Metadata.VersionId = versionId.String() + sctx.Logger().Debug("MigrateDidVersionID: DID: " + didDocWithMetadata.DidDoc.Id + " OldVersionId: " + didDocWithMetadata.Metadata.VersionId) + versionID := uuid.NewSHA1(uuid.Nil, []byte(didDocWithMetadata.DidDoc.Id)) + didDocWithMetadata.Metadata.VersionId = versionID.String() + sctx.Logger().Debug("MigrateDidVersionID: DID: " + didDocWithMetadata.DidDoc.Id + " NewVersionId: " + didDocWithMetadata.Metadata.VersionId) }) } diff --git a/app/migrations/migration_resource_checksum.go b/app/migrations/migration_resource_checksum.go index 83fd4999d..1d3a5e625 100644 --- a/app/migrations/migration_resource_checksum.go +++ b/app/migrations/migration_resource_checksum.go @@ -3,6 +3,7 @@ package migrations import ( "crypto/sha256" "encoding/hex" + "fmt" resourcetypes "github.com/cheqd/cheqd-node/x/resource/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -10,9 +11,20 @@ import ( // Migration because we need to fix the algo for checksum calculation func MigrateResourceChecksum(sctx sdk.Context, mctx MigrationContext) error { - println("Checksum migration for resources") + sctx.Logger().Debug("MigrateResourceChecksum: Starting migration") + return MigrateResourceSimple(sctx, mctx, func(resource *resourcetypes.ResourceWithMetadata) { + sctx.Logger().Debug(fmt.Sprintf( + "MigrateResourceChecksum: Id: %s CollectionId: %s OldChecksum: %s", + resource.Metadata.Id, + resource.Metadata.CollectionId, + resource.Metadata.Checksum)) checksum := sha256.Sum256(resource.Resource.Data) resource.Metadata.Checksum = hex.EncodeToString(checksum[:]) + sctx.Logger().Debug(fmt.Sprintf( + "MigrateResourceChecksum: Id: %s CollectionId: %s NewChecksum: %s", + resource.Metadata.Id, + resource.Metadata.CollectionId, + resource.Metadata.Checksum)) }) } diff --git a/app/migrations/migration_resource_default_alternative_url.go b/app/migrations/migration_resource_default_alternative_url.go index ee293b427..222f867fc 100644 --- a/app/migrations/migration_resource_default_alternative_url.go +++ b/app/migrations/migration_resource_default_alternative_url.go @@ -7,13 +7,21 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func MigrateResourceDefaultAlternativeUrl(sctx sdk.Context, mctx MigrationContext) error { +func MigrateResourceDefaultAlternativeURL(sctx sdk.Context, mctx MigrationContext) error { + sctx.Logger().Debug("MigrateResourceDefaultAlternativeUrl: Starting migration") + namespace := mctx.didKeeperNew.GetDidNamespace(&sctx) return MigrateResourceSimple(sctx, mctx, func(resource *resourcetypes.ResourceWithMetadata) { - resource.Metadata.AlsoKnownAs = append(resource.Metadata.AlsoKnownAs, &resourcetypes.AlternativeUri{ + alternativeURI := resourcetypes.AlternativeUri{ Uri: fmt.Sprintf("did:cheqd:%s:%s/resources/%s", namespace, resource.Metadata.CollectionId, resource.Metadata.Id), Description: "did-url", - }) + } + resource.Metadata.AlsoKnownAs = append(resource.Metadata.AlsoKnownAs, &alternativeURI) + sctx.Logger().Debug(fmt.Sprintf( + "MigrateResourceDefaultAlternativeUrl: Id: %s CollectionId: %s AlternativeUri: %s", + resource.Metadata.Id, + resource.Metadata.CollectionId, + string(mctx.codec.MustMarshalJSON(&alternativeURI)))) }) } diff --git a/app/migrations/migration_resource_indy_style.go b/app/migrations/migration_resource_indy_style.go index 9f50eff05..1fefe27cd 100644 --- a/app/migrations/migration_resource_indy_style.go +++ b/app/migrations/migration_resource_indy_style.go @@ -7,8 +7,11 @@ import ( ) func MigrateResourceIndyStyle(sctx sdk.Context, mctx MigrationContext) error { - println("Indy style migration for resources") + sctx.Logger().Debug("MigrateResourceIndyStyle: Starting migration") + return MigrateResourceSimple(sctx, mctx, func(resource *resourcetypes.ResourceWithMetadata) { - resource.Metadata.CollectionId = helpers.MigrateIndyStyleId(resource.Metadata.CollectionId) + sctx.Logger().Debug("MigrateResourceIndyStyle: OldCollectionId: " + resource.Metadata.CollectionId) + resource.Metadata.CollectionId = helpers.MigrateIndyStyleID(resource.Metadata.CollectionId) + sctx.Logger().Debug("MigrateResourceIndyStyle: NewCollectionId: " + resource.Metadata.CollectionId) }) } diff --git a/app/migrations/migration_resource_protobuf.go b/app/migrations/migration_resource_protobuf.go index 1a6254a30..549176bc5 100644 --- a/app/migrations/migration_resource_protobuf.go +++ b/app/migrations/migration_resource_protobuf.go @@ -12,24 +12,26 @@ import ( ) func MigrateResourceProtobuf(sctx sdk.Context, mctx MigrationContext) error { - println("Protobuf migration for resources. Start") + sctx.Logger().Debug("MigrateResourceProtobuf: Starting migration") // Storage for old headers and data store := sctx.KVStore(mctx.resourceStoreKey) - println("Protobuf migration for resources. Reset counter") + sctx.Logger().Debug("MigrateResourceProtobuf: Resetting counter") // Reset counter mctx.resourceKeeperNew.SetResourceCount(&sctx, 0) - println("Protobuf migration for resources. Read all keys") + sctx.Logger().Debug("MigrateResourceProtobuf: Reading all keys") headerKeys := helpers.ReadAllKeys(store, didutils.StrBytes(resourcetypesv1.ResourceHeaderKey)) for _, headerKey := range headerKeys { + sctx.Logger().Debug("MigrateResourceProtobuf: Starting migration for resource with header key: " + string(headerKey)) dataKey := ResourceV1HeaderkeyToDataKey(headerKey) var oldHeader resourcetypesv1.ResourceHeader mctx.codec.MustUnmarshal(store.Get(headerKey), &oldHeader) oldData := store.Get(dataKey) + sctx.Logger().Debug("MigrateResourceProtobuf: Collecting new resource metadata") newMetadata := resourcetypes.Metadata{ CollectionId: oldHeader.CollectionId, Id: oldHeader.Id, @@ -38,7 +40,7 @@ func MigrateResourceProtobuf(sctx sdk.Context, mctx MigrationContext) error { ResourceType: oldHeader.ResourceType, AlsoKnownAs: []*resourcetypes.AlternativeUri{}, MediaType: oldHeader.MediaType, - Created: oldHeader.Created, + Created: helpers.MustParseFromStringTimeToGoTime(oldHeader.Created), Checksum: hex.EncodeToString(oldHeader.Checksum), PreviousVersionId: oldHeader.PreviousVersionId, NextVersionId: oldHeader.NextVersionId, @@ -51,17 +53,20 @@ func MigrateResourceProtobuf(sctx sdk.Context, mctx MigrationContext) error { }, } + sctx.Logger().Debug("MigrateResourceProtobuf: Remove old values") // Remove old resource data and header store.Delete(headerKey) store.Delete(dataKey) + sctx.Logger().Debug("MigrateResourceProtobuf: Write new resource with metadata") // Write new resource err := mctx.resourceKeeperNew.SetResource(&sctx, &resourceWithMetadata) if err != nil { return err } + sctx.Logger().Debug("MigrateResourceProtobuf: Migration finished for resource with header key: " + string(headerKey)) } - println("Protobuf migration for resources. End") + sctx.Logger().Debug("MigrateResourceProtobuf: Migration finished") return nil } diff --git a/app/migrations/migration_resource_simple.go b/app/migrations/migration_resource_simple.go index 49fd8a41d..11878cf55 100644 --- a/app/migrations/migration_resource_simple.go +++ b/app/migrations/migration_resource_simple.go @@ -6,17 +6,17 @@ import ( ) func MigrateResourceSimple(sctx sdk.Context, mctx MigrationContext, apply func(resourceWithMetadata *resourcetypes.ResourceWithMetadata)) error { - println("Simple migration for resources. Start") + sctx.Logger().Debug("MigrateResourceSimple: Starting migration") store := sctx.KVStore(mctx.resourceStoreKey) - println("Simple migration for resources. Remove old counters") + sctx.Logger().Debug("MigrateResourceSimple: Removing old counters") // Reset counter mctx.didKeeperNew.SetDidDocCount(&sctx, 0) // Cache resources var metadatas []resourcetypes.Metadata - println("Simple migration for resources. Iterate over all resource metadatas") + sctx.Logger().Debug("MigrateResourceSimple: Iterating over all resource metadatas") mctx.resourceKeeperNew.IterateAllResourceMetadatas(&sctx, func(metadata resourcetypes.Metadata) bool { metadatas = append(metadatas, metadata) return true @@ -24,6 +24,8 @@ func MigrateResourceSimple(sctx sdk.Context, mctx MigrationContext, apply func(r // Iterate and migrate resources for _, metadata := range metadatas { + + sctx.Logger().Debug("MigrateResourceSimple: Starting migration for resource: " + metadata.Id) // Read value resourceWithMetadata, err := mctx.resourceKeeperNew.GetResource(&sctx, metadata.CollectionId, metadata.Id) if err != nil { @@ -45,9 +47,11 @@ func MigrateResourceSimple(sctx sdk.Context, mctx MigrationContext, apply func(r if err != nil { return err } + + sctx.Logger().Debug("MigrateResourceSimple: Migration finished for resource: " + resourceWithMetadata.Metadata.Id) } - println("Simple migration for resources. End") + sctx.Logger().Debug("MigrateResourceSimple: Migration finished") return nil } diff --git a/app/migrations/migration_resource_uuid.go b/app/migrations/migration_resource_uuid.go index 5c682c78b..bb5450a43 100644 --- a/app/migrations/migration_resource_uuid.go +++ b/app/migrations/migration_resource_uuid.go @@ -7,9 +7,14 @@ import ( ) func MigrateResourceUUID(sctx sdk.Context, mctx MigrationContext) error { - println("UUID migration for resources") + sctx.Logger().Debug("MigrateResourceUUID: Starting migration") + return MigrateResourceSimple(sctx, mctx, func(resource *resourcetypes.ResourceWithMetadata) { + sctx.Logger().Debug("MigrateResourceUUID: OldId: " + resource.Metadata.Id) + sctx.Logger().Debug("MigrateResourceUUID: OldCollectionId: " + resource.Metadata.CollectionId) resource.Metadata.CollectionId = helpers.MigrateUUIDId(resource.Metadata.CollectionId) resource.Metadata.Id = helpers.MigrateUUIDId(resource.Metadata.Id) + sctx.Logger().Debug("MigrateResourceUUID: NewId: " + resource.Metadata.Id) + sctx.Logger().Debug("MigrateResourceUUID: NewCollectionId: " + resource.Metadata.CollectionId) }) } diff --git a/app/migrations/migration_resource_version_links.go b/app/migrations/migration_resource_version_links.go index 007d6b1fd..f6f832a14 100644 --- a/app/migrations/migration_resource_version_links.go +++ b/app/migrations/migration_resource_version_links.go @@ -1,18 +1,18 @@ package migrations import ( + "fmt" "sort" - "time" "github.com/cheqd/cheqd-node/app/migrations/helpers" sdk "github.com/cosmos/cosmos-sdk/types" ) func MigrateResourceVersionLinks(sctx sdk.Context, mctx MigrationContext) error { - println("Resource version links migration. Start") + sctx.Logger().Debug("MigrateResourceVersionLinks: Starting migration") store := sctx.KVStore(mctx.resourceStoreKey) - println("Resource version links migration. Read all resources") + sctx.Logger().Debug("MigrateResourceVersionLinks: Reading all resources") // Read all resources. Yes, this is memory intensive, but it's the simplest way to do it. // Resource size is limited to 200KB, so this should be fine. resources, err := mctx.resourceKeeperNew.GetAllResources(&sctx) @@ -20,7 +20,7 @@ func MigrateResourceVersionLinks(sctx sdk.Context, mctx MigrationContext) error return err } - println("Resource version links migration. Read all keys and Clean store") + sctx.Logger().Debug("MigrateResourceVersionLinks: Reading all keys and Clean store") // Clean store keys := helpers.ReadAllKeys(store, nil) for _, key := range keys { @@ -29,35 +29,39 @@ func MigrateResourceVersionLinks(sctx sdk.Context, mctx MigrationContext) error // Reset version links for _, resource := range resources { + sctx.Logger().Debug(fmt.Sprintf( + "MigrateResourceVersionLinks: Id: %s CollectionId: %s OldPreviousVersionId: %s OldNextVersionId: %s", + resource.Metadata.Id, + resource.Metadata.CollectionId, + resource.Metadata.PreviousVersionId, + resource.Metadata.NextVersionId)) resource.Metadata.PreviousVersionId = "" resource.Metadata.NextVersionId = "" } - println("Resource version links migration. Sort resources by date created") + sctx.Logger().Debug("MigrateResourceVersionLinks: Sorting resources by date created") // Sort resources by date created - sort.Slice(resources[:], func(i, j int) bool { - iCreated, err := time.Parse(time.RFC3339, resources[i].Metadata.Created) - if err != nil { - panic(err) - } - - jCreated, err := time.Parse(time.RFC3339, resources[j].Metadata.Created) - if err != nil { - panic(err) - } - + sort.Slice(resources, func(i, j int) bool { + iCreated := resources[i].Metadata.Created + jCreated := resources[j].Metadata.Created return iCreated.Before(jCreated) }) - println("Resource version links migration. Set version links") + sctx.Logger().Debug("MigrateResourceVersionLinks: Setting version links") // Add resources to store in the same order as they were created. This will create proper links. for _, resource := range resources { - err = mctx.resourceKeeperNew.AddNewResourceVersion(&sctx, &resource) + err = mctx.resourceKeeperNew.AddNewResourceVersion(&sctx, resource) + sctx.Logger().Debug(fmt.Sprintf( + "MigrateResourceVersionLinks: Id: %s CollectionId: %s NewPreviousVersionId: %s NewNextVersionId: %s", + resource.Metadata.Id, + resource.Metadata.CollectionId, + resource.Metadata.PreviousVersionId, + resource.Metadata.NextVersionId)) if err != nil { return err } } - println("Resource version links migration. End") + sctx.Logger().Debug("MigrateResourceVersionLinks: Migration finished") return nil } diff --git a/cmd/cheqd-noded/cmd/debug_extensions.go b/cmd/cheqd-noded/cmd/debug_extensions.go index f291f422d..e776b77cb 100644 --- a/cmd/cheqd-noded/cmd/debug_extensions.go +++ b/cmd/cheqd-noded/cmd/debug_extensions.go @@ -50,12 +50,12 @@ func ed25519RandomCmd() *cobra.Command { PrivKeyBase64: base64.StdEncoding.EncodeToString(privKey), } - keyInfoJson, err := json.Marshal(keyInfo) + keyInfoJSON, err := json.Marshal(keyInfo) if err != nil { return err } - _, err = fmt.Fprintln(cmd.OutOrStdout(), string(keyInfoJson)) + _, err = fmt.Fprintln(cmd.OutOrStdout(), string(keyInfoJSON)) return err }, } @@ -83,12 +83,12 @@ func ed25519PubKeyBase64ToJwkCmd() *cobra.Command { return err } - pubKeyJwkJson, err := json.Marshal(pubKeyJwk) + pubKeyJwkJSON, err := json.Marshal(pubKeyJwk) if err != nil { return err } - _, err = fmt.Fprintln(cmd.OutOrStdout(), string(pubKeyJwkJson)) + _, err = fmt.Fprintln(cmd.OutOrStdout(), string(pubKeyJwkJSON)) return err }, } diff --git a/docker/Dockerfile b/docker/Dockerfile index 0826fbf05..107a78446 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,7 +15,7 @@ WORKDIR /go/src/github.com/cheqd/cheqd-node COPY . . # Make node binary -RUN make build +RUN make install && make build ############################################################### ### STAGE 2: Build cheqd-node image ### diff --git a/docker/localnet/gen-network-config.sh b/docker/localnet/gen-network-config.sh index f291d56ea..52096b53f 100644 --- a/docker/localnet/gen-network-config.sh +++ b/docker/localnet/gen-network-config.sh @@ -1,14 +1,14 @@ #!/bin/bash +# shellcheck disable=SC2086 # Generates network configuration for an arbitrary amount of validators, observers, and seeds. - set -euo pipefail -# sed in macos requires extra argument -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - SED_EXT='' -elif [[ "$OSTYPE" == "darwin"* ]]; then - SED_EXT='.orig' +# sed in MacOS requires extra argument +if [[ "$OSTYPE" == "darwin"* ]]; then + SED_EXT='.orig' +else + SED_EXT='' fi # Params @@ -38,16 +38,15 @@ function configure_node() { APP_TOML="${NODE_HOME}/config/app.toml" CONFIG_TOML="${NODE_HOME}/config/config.toml" - sed -i $SED_EXT 's/minimum-gas-prices = ""/minimum-gas-prices = "25ncheq"/g' "${APP_TOML}" + sed -i $SED_EXT 's/minimum-gas-prices = ""/minimum-gas-prices = "50ncheq"/g' "${APP_TOML}" sed -i $SED_EXT 's/enable = false/enable = true/g' "${APP_TOML}" - sed -i $SED_EXT 's|laddr = "tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|g' "${CONFIG_TOML}" sed -i $SED_EXT 's|addr_book_strict = true|addr_book_strict = false|g' "${CONFIG_TOML}" - sed -i $SED_EXT 's/timeout_propose = "3s"/timeout_propose = "500ms"/g' "${CONFIG_TOML}" sed -i $SED_EXT 's/timeout_prevote = "1s"/timeout_prevote = "500ms"/g' "${CONFIG_TOML}" sed -i $SED_EXT 's/timeout_precommit = "1s"/timeout_precommit = "500ms"/g' "${CONFIG_TOML}" sed -i $SED_EXT 's/timeout_commit = "5s"/timeout_commit = "500ms"/g' "${CONFIG_TOML}" + sed -i $SED_EXT 's/log_level = "info"/log_level = "debug"/g' "${CONFIG_TOML}" } function configure_genesis() { diff --git a/go.mod b/go.mod index 1ea5c2d88..6e4932d1b 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,10 @@ go 1.18 require ( cosmossdk.io/math v1.0.0-beta.3 filippo.io/edwards25519 v1.0.0-rc.1 - github.com/cosmos/cosmos-proto v1.0.0-alpha7 - github.com/cosmos/cosmos-sdk v0.46.6 - github.com/cosmos/ibc-go/v5 v5.1.0 + github.com/cosmos/cosmos-proto v1.0.0-alpha8 + github.com/cosmos/cosmos-sdk v0.46.7 + github.com/cosmos/gogoproto v1.4.3 + github.com/cosmos/ibc-go/v6 v6.1.0 github.com/gabriel-vasile/mimetype v1.4.1 github.com/go-ozzo/ozzo-validation/v4 v4.3.0 github.com/gogo/protobuf v1.3.3 @@ -18,7 +19,7 @@ require ( github.com/lestrrat-go/jwx v1.2.25 github.com/mr-tron/base58 v1.2.0 github.com/multiformats/go-multibase v0.1.1 - github.com/onsi/ginkgo/v2 v2.6.1 + github.com/onsi/ginkgo/v2 v2.7.0 github.com/onsi/gomega v1.24.2 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.0 @@ -28,21 +29,21 @@ require ( github.com/stretchr/testify v1.8.1 github.com/tendermint/tendermint v0.34.24 github.com/tendermint/tm-db v0.6.7 - google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e - google.golang.org/grpc v1.50.1 + google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 + google.golang.org/grpc v1.51.0 ) require ( - cloud.google.com/go v0.104.0 // indirect - cloud.google.com/go/compute v1.12.1 // indirect + cloud.google.com/go v0.105.0 // indirect + cloud.google.com/go/compute v1.13.0 // indirect cloud.google.com/go/compute/metadata v0.2.1 // indirect - cloud.google.com/go/iam v0.4.0 // indirect - cloud.google.com/go/storage v1.23.0 // indirect + cloud.google.com/go/iam v0.8.0 // indirect + cloud.google.com/go/storage v1.27.0 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect - github.com/armon/go-metrics v0.4.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-sdk-go v1.40.45 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect @@ -54,13 +55,12 @@ require ( github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect - github.com/confio/ics23/go v0.7.0 // indirect - github.com/cosmos/btcutil v1.0.4 // indirect + github.com/confio/ics23/go v0.9.0 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/iavl v0.19.4 // indirect - github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect - github.com/cosmos/ledger-go v0.9.3 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -77,7 +77,7 @@ require ( github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/locales v0.14.0 // indirect github.com/goccy/go-json v0.9.7 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect @@ -88,8 +88,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect - github.com/googleapis/gax-go/v2 v2.6.0 // indirect - github.com/googleapis/go-type-adapters v1.0.0 // indirect + github.com/googleapis/gax-go/v2 v2.7.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect @@ -110,7 +109,6 @@ require ( github.com/jmhodges/levigo v1.0.0 // indirect github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect github.com/klauspost/compress v1.15.11 // indirect - github.com/leodido/go-urn v1.2.1 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect github.com/lestrrat-go/blackmagic v1.0.0 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect @@ -153,18 +151,19 @@ require ( github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/ulikunitz/xz v0.5.8 // indirect - github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect + github.com/zondax/hid v0.9.1 // indirect + github.com/zondax/ledger-go v0.14.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect - go.opencensus.io v0.23.0 // indirect - golang.org/x/crypto v0.1.0 // indirect + go.opencensus.io v0.24.0 // indirect + golang.org/x/crypto v0.2.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect golang.org/x/net v0.4.0 // indirect - golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect + golang.org/x/oauth2 v0.3.0 // indirect golang.org/x/sys v0.3.0 // indirect golang.org/x/term v0.3.0 // indirect golang.org/x/text v0.5.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.102.0 // indirect + google.golang.org/api v0.103.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -177,9 +176,6 @@ require ( replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 - // Dragonberry patch (https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702/1) - github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 diff --git a/go.sum b/go.sum index e83817550..88002253d 100644 --- a/go.sum +++ b/go.sum @@ -19,22 +19,8 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0 h1:gSmWO7DY1vOm0MVU6DNXM11BWHHsTUmsC5cv1fuW5X8= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -42,21 +28,15 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0 h1:AYrLkB8NPdDRslNp4Jxmzrhdr03fUAIDbiGFjLWowoU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.4.0 h1:YBYU00SCDzZJdHqVc4I5d6lsklcYIjQZa1YmEz4jlSE= -cloud.google.com/go/iam v0.4.0/go.mod h1:cbaZxyScUhxl7ZAkNWiALgihfP75wS/fUsVNaa1r3vA= +cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -67,9 +47,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.23.0 h1:wWRIaDURQA8xxHguFCshYepGlrWIrbBnAmc7wfg07qY= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= @@ -123,8 +102,8 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= @@ -154,18 +133,17 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= @@ -208,12 +186,6 @@ github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3h github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -221,6 +193,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= +github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= +github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= @@ -232,30 +206,27 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= -github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= -github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= -github.com/cosmos/cosmos-sdk v0.46.6 h1:K9EZsqOZ2jQX3bIQUpn7Hk/YCoaJWRLU56PzvpX8INk= -github.com/cosmos/cosmos-sdk v0.46.6/go.mod h1:JNklMfXo7MhDF1j/jxZCmDyOYyqhVoKB22e8p1ATEqA= -github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= -github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= +github.com/cosmos/cosmos-sdk v0.46.7 h1:dkGy9y2ewgqvawrUOuWb2oz3MdotVduokyreXC4bS0s= +github.com/cosmos/cosmos-sdk v0.46.7/go.mod h1:fqKqz39U5IlEFb4nbQ72951myztsDzFKKDtffYJ63nk= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/gogoproto v1.4.3 h1:RP3yyVREh9snv/lsOvmsAPQt8f44LgL281X0IOIhhcI= +github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v5 v5.1.0 h1:m1NHXFkwwvNeJegZqtyox1WLinh+PMy4ivU/Cs9KjeA= -github.com/cosmos/ibc-go/v5 v5.1.0/go.mod h1:H6sV0/CkNRDtvSrhbsIgiog1WnSwhguGfg8x34MOVEk= +github.com/cosmos/ibc-go/v6 v6.1.0 h1:o7oXws2vKkKfOFzJI+oNylRn44PCNt5wzHd/zKQKbvQ= +github.com/cosmos/ibc-go/v6 v6.1.0/go.mod h1:CY3zh2HLfetRiW8LY6kVHMATe90Wj/UOoY8T6cuB0is= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= -github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= -github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= -github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= -github.com/cosmos/ledger-go v0.9.3 h1:WGyZK4ikuLIkbxJm3lEr1tdQYDdTdveTwoVla7hqfhQ= -github.com/cosmos/ledger-go v0.9.3/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= +github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= +github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -319,10 +290,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= @@ -383,9 +350,8 @@ github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvSc github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= @@ -426,9 +392,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -445,7 +409,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -469,9 +432,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -483,7 +443,6 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -496,11 +455,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -508,21 +462,12 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0 h1:y8Yozv7SZtlU//QXbezB6QkpuE6jMD2/gfzk4AftXjs= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -683,9 +628,8 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= github.com/lestrrat-go/blackmagic v1.0.0 h1:XzdxDbuQTz0RZZEmdU7cnQxUtFUzgCSPq8RCz4BxIi4= @@ -807,8 +751,8 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo/v2 v2.6.1 h1:1xQPCjcqYw/J5LchOcp4/2q/jzJFjiAOc25chhnDw+Q= -github.com/onsi/ginkgo/v2 v2.6.1/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= +github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= +github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -1040,9 +984,10 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 h1:O9XLFXGkVswDFmH9LaYpqu+r/AAFWqr0DL6V00KEVFg= -github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= +github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.0 h1:dlMC7aO8Wss1CxBq2I96kZ69Nh1ligzbs8UWOtq/AsA= +github.com/zondax/ledger-go v0.14.0/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= @@ -1055,9 +1000,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1090,8 +1034,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.2.0 h1:BRXPfhNivWL5Yq0BGQ39a2sW6t44aODpfxkWjYdzewE= +golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1122,7 +1066,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1182,9 +1125,7 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1193,11 +1134,6 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= @@ -1210,19 +1146,10 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= +golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1234,7 +1161,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1297,47 +1223,26 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= @@ -1422,19 +1327,12 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= @@ -1463,29 +1361,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0 h1:9yuVqlu2JCvcLg9p8S3fcFLZij8EPSyvODIY1rkMizQ= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1538,53 +1415,9 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 h1:jmIfw8+gSvXcZSgaFAGyInDXeWzUhvYH57G/5GKMn70= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1609,23 +1442,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1638,8 +1456,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -1689,8 +1505,7 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= -pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= +pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/go.work b/go.work new file mode 100644 index 000000000..7f8a91ea5 --- /dev/null +++ b/go.work @@ -0,0 +1,6 @@ +go 1.18 + +use ( + . + ./api +) diff --git a/go.work.sum b/go.work.sum new file mode 100644 index 000000000..baea88e89 --- /dev/null +++ b/go.work.sum @@ -0,0 +1,856 @@ +4d63.com/gochecknoglobals v0.1.0 h1:zeZSRqj5yCg28tCkIV/z/lWbwvNm5qnKVS15PI8nhD0= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go/accessapproval v1.5.0 h1:/nTivgnV/n1CaAeo+ekGexTYUsKEU9jUVkoY5359+3Q= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accesscontextmanager v1.4.0 h1:CFhNhU7pcD11cuDkQdrE6PQJgv0EXNKNv06jIzbLlCU= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/aiplatform v1.27.0 h1:DBi3Jk9XjCJ4pkkLM4NqKgj3ozUL1wq4l+d3/jTGXAI= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/analytics v0.12.0 h1:NKw6PpQi6V1O+KsjuTd+bhip9d0REYu4NevC45vtGp8= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/apigateway v1.4.0 h1:IIoXKR7FKrEAQhMTz5hK2wiDz2WNFHS7eVr/L1lE/rM= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigeeconnect v1.4.0 h1:AONoTYJviyv1vS4IkvWzq69gEVdvHx35wKXc+e6wjZQ= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/appengine v1.5.0 h1:lmG+O5oaR9xNwaRBwE2XoMhwQHsHql5IoiGr1ptdDwU= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/area120 v0.6.0 h1:TCMhwWEWhCn8d44/Zs7UCICTWje9j3HuV6nVGMjdpYw= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/artifactregistry v1.9.0 h1:3d0LRAU1K6vfqCahhl9fx2oGHcq+s5gftdix4v8Ibrc= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/asset v1.10.0 h1:aCrlaLGJWTODJX4G56ZYzJefITKEWNfbjjtHSzWpxW0= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/assuredworkloads v1.9.0 h1:hhIdCOowsT1GG5eMCIA0OwK6USRuYTou/1ZeNxCSRtA= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/automl v1.8.0 h1:BMioyXSbg7d7xLibn47cs0elW6RT780IUWr42W8rp2Q= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/baremetalsolution v0.4.0 h1:g9KO6SkakcYPcc/XjAzeuUrEOXlYPnMpuiaywYaGrmQ= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/batch v0.4.0 h1:1jvEBY55OH4Sd2FxEXQfxGExFWov1A/IaRe+Z5Z71Fw= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/beyondcorp v0.3.0 h1:w+4kThysgl0JiKshi2MKDCg2NZgOyqOI0wq2eBZyrzA= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/bigquery v1.44.0 h1:Wi4dITi+cf9VYp4VH2T9O41w0kCW0uQTELq2Z6tukN0= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/bigtable v1.2.0 h1:F4cCmA4nuV84V5zYQ3MKY+M1Cw1avHDuf3S/LcZPA9c= +cloud.google.com/go/billing v1.7.0 h1:Xkii76HWELHwBtkQVZvqmSo9GTr0O+tIbRNnMcGdlg4= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/binaryauthorization v1.4.0 h1:pL70vXWn9TitQYXBWTK2abHl2JHLwkFRjYw6VflRqEA= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/certificatemanager v1.4.0 h1:tzbR4UHBbgsewMWUD93JHi8EBi/gHBoSAcY1/sThFGk= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/channel v1.9.0 h1:pNuUlZx0Jb0Ts9P312bmNMuH5IiFWIR4RUtLb70Ke5s= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/cloudbuild v1.4.0 h1:TAAmCmAlOJ4uNBu6zwAjwhyl/7fLHHxIEazVhr3QBbQ= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/clouddms v1.4.0 h1:UhzHIlgFfMr6luVYVNydw/pl9/U5kgtjCMJHnSvoVws= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/cloudtasks v1.8.0 h1:faUiUgXjW8yVZ7XMnKHKm1WE4OldPBUWWfIRN/3z1dc= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/contactcenterinsights v1.4.0 h1:tTQLI/ZvguUf9Hv+36BkG2+/PeC8Ol1q4pBW+tgCx0A= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/container v1.7.0 h1:nbEK/59GyDRKKlo1SqpohY1TK8LmJ2XNcvS9Gyom2A0= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/containeranalysis v0.6.0 h1:2824iym832ljKdVpCBnpqm5K94YT/uHTVhNF+dRTXPI= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/datacatalog v1.8.0 h1:6kZ4RIOW/uT7QWC5SfPfq/G8sYzr/v+UOmOAxy4Z1TE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/dataflow v0.7.0 h1:CW3541Fm7KPTyZjJdnX6NtaGXYFn5XbFC5UcjgALKvU= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataform v0.5.0 h1:vLwowLF2ZB5J5gqiZCzv076lDI/Rd7zYQQFu5XO1PSg= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/datafusion v1.5.0 h1:j5m2hjWovTZDTQak4MJeXAR9yN7O+zMfULnjGw/OOLg= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datalabeling v0.6.0 h1:dp8jOF21n/7jwgo/uuA0RN8hvLcKO4q6s/yvwevs2ZM= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataplex v1.4.0 h1:cNxeA2DiWliQGi21kPRqnVeQ5xFhNoEjPRt1400Pm8Y= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataproc v1.8.0 h1:gVOqNmElfa6n/ccG/QDlfurMWwrK3ezvy2b2eDoCmS0= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataqna v0.6.0 h1:gx9jr41ytcA3dXkbbd409euEaWtofCVXYBvJz3iYm18= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/datastore v1.10.0 h1:4siQRf4zTiAVt/oeH4GureGkApgb2vtPQAtOmhpqQwE= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastream v1.5.0 h1:PgIgbhedBtYBU6POGXFMn2uSl9vpqubc3ewTNdcU8Mk= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/deploy v1.5.0 h1:kI6dxt8Ml0is/x7YZjLveTvR7YPzXAUD/8wQZ2nH5zA= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/dialogflow v1.19.0 h1:HYHVOkoxQ9bSfNIelSZYNAtUi4CeSrCnROyOsbOqPq8= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dlp v1.7.0 h1:9I4BYeJSVKoSKgjr70fLdRDumqcUeVmHV4fd5f9LR6Y= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/documentai v1.10.0 h1:jfq09Fdjtnpnmt/MLyf6A3DM3ynb8B2na0K+vSXvpFM= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/domains v0.7.0 h1:pu3JIgC1rswIqi5romW0JgNO6CTUydLYX8zyjiAvO1c= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/edgecontainer v0.2.0 h1:hd6J2n5dBBRuAqnNUEsKWrp6XNPKsaxwwIyzOPZTokk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/errorreporting v0.3.0 h1:kj1XEWMu8P0qlLhm3FwcaFsUvXChV/OraZwA70trRR0= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.4.0 h1:b6csrQXCHKQmfo9h3dG/pHyoEh+fQG1Yg78a53LAviY= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/eventarc v1.8.0 h1:AgCqrmMMIcel5WWKkzz5EkCUKC3Rl5LNMMYsS+LvsI0= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/filestore v1.4.0 h1:yjKOpzvqtDmL5AXbKttLc8j0hL20kuC1qPdy5HPcxp0= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/firestore v1.9.0 h1:IBlRyxgGySXu5VuW0RgGFlTtLukSnNkpDiEOMkQkmpA= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/functions v1.9.0 h1:35tgv1fQOtvKqH/uxJMzX3w6usneJ0zXpsFr9KAVhNE= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/gaming v1.8.0 h1:97OAEQtDazAJD7yh/kvQdSCQuTKdR0O+qWAJBZJ4xiA= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gkebackup v0.3.0 h1:4K+jiv4ocqt1niN8q5Imd8imRoXBHTrdnJVt/uFFxF4= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkeconnect v0.6.0 h1:zAcvDa04tTnGdu6TEZewaLN2tdMtUOJJ7fEceULjguA= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkehub v0.10.0 h1:JTcTaYQRGsVm+qkah7WzHb6e9sf1C0laYdRPn9aN+vg= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkemulticloud v0.4.0 h1:8F1NhJj8ucNj7lK51UZMtAjSWTgP1zO18XF6vkfiPPU= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/grafeas v0.2.0 h1:CYjC+xzdPvbV65gi6Dr4YowKcmLo045pm18L0DhdELM= +cloud.google.com/go/gsuiteaddons v1.4.0 h1:TGT2oGmO5q3VH6SjcrlgPUWI0njhYv4kywLm6jag0to= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iap v1.5.0 h1:BGEXovwejOCt1zDk8hXq0bOhhRu9haXKWXXXp2B4wBM= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/ids v1.2.0 h1:LncHK4HHucb5Du310X8XH9/ICtMwZ2PCfK0ScjWiJoY= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/iot v1.4.0 h1:Y9+oZT9jD4GUZzORXTU45XsnQrhxmDT+TFbPil6pRVQ= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/kms v1.6.0 h1:OWRZzrPmOZUzurjI2FBGtgY2mB1WaJkqhw6oIwSj0Yg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/language v1.8.0 h1:3Wa+IUMamL4JH3Zd3cDZUHpwyqplTACt6UZKRD2eCL4= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/lifesciences v0.6.0 h1:tIqhivE2LMVYkX0BLgG7xL64oNpDaFFI7teunglt1tI= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/logging v1.6.1 h1:ZBsZK+JG+oCDT+vaxwqF2egKNRjz8soXiS6Xv79benI= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/managedidentities v1.4.0 h1:3Kdajn6X25yWQFhFCErmKSYTSvkEd3chJROny//F1A0= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/maps v0.1.0 h1:kLReRbclTgJefw2fcCbdLPLhPj0U6UUWN10ldG8sdOU= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/mediatranslation v0.6.0 h1:qAJzpxmEX+SeND10Y/4868L5wfZpo4Y3BIEnIieP4dk= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/memcache v1.7.0 h1:yLxUzJkZVSH2kPaHut7k+7sbIBFpvSh1LW9qjM2JDjA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/metastore v1.8.0 h1:3KcShzqWdqxrDEXIBWpYJpOOrgpDj+HlBi07Grot49Y= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/monitoring v1.8.0 h1:c9riaGSPQ4dUKWB+M1Fl0N+iLxstMbCktdEwYSPGDvA= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/networkconnectivity v1.7.0 h1:BVdIKaI68bihnXGdCVL89Jsg9kq2kg+II30fjVqo62E= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkmanagement v1.5.0 h1:mDHA3CDW00imTvC5RW6aMGsD1bH+FtKwZm/52BxaiMg= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networksecurity v0.6.0 h1:qDEX/3sipg9dS5JYsAY+YvgTjPR63cozzAWop8oZS94= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/notebooks v1.5.0 h1:AC8RPjNvel3ExgXjO1YOAz+teg9+j+89TNxa7pIZfww= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/optimization v1.2.0 h1:7PxOq9VTT7TMib/6dMoWpMvWS2E4dJEvtYzjvBreaec= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/orchestration v1.4.0 h1:39d6tqvNjd/wsSub1Bn4cEmrYcet5Ur6xpaN+SxOxtY= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orgpolicy v1.5.0 h1:erF5PHqDZb6FeFrUHiYj2JK2BMhsk8CyAg4V4amJ3rE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/osconfig v1.10.0 h1:NO0RouqCOM7M2S85Eal6urMSSipWwHU8evzwS+siqUI= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/oslogin v1.7.0 h1:pKGDPfeZHDybtw48WsnVLjoIPMi9Kw62kUE5TXCLCN4= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/phishingprotection v0.6.0 h1:OrwHLSRSZyaiOt3tnY33dsKSedxbMzsXvqB21okItNQ= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/policytroubleshooter v1.4.0 h1:NQklJuOUoz1BPP+Epjw81COx7IISWslkZubz/1i0UN8= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/privatecatalog v0.6.0 h1:Vz86uiHCtNGm1DeC32HeG2VXmOq5JRYA3VRPf8ZEcSg= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/pubsub v1.27.1 h1:q+J/Nfr6Qx4RQeu3rJcnN48SNC0qzlYzSeqkPq93VHs= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsublite v1.5.0 h1:iqrD8vp3giTb7hI1q4TQQGj77cj8zzgmMPsTZtLnprM= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/recaptchaenterprise v1.3.1 h1:u6EznTGzIdsyOsvm+Xkw0aSuKFXQlyjGE9a4exk6iNQ= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0 h1:UqzFfb/WvhwXGDF1eQtdHLrmni+iByZXY4h3w9Kdyv8= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recommendationengine v0.6.0 h1:6w+WxPf2LmUEqX0YyvfCoYb8aBYOcbIV25Vg6R0FLGw= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommender v1.8.0 h1:9kMZQGeYfcOD/RtZfcNKGKtoex3DdoB4zRgYU/WaIwE= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/redis v1.10.0 h1:/zTwwBKIAD2DEWTrXZp8WD9yD/gntReF/HkPssVYd0U= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/resourcemanager v1.4.0 h1:NDao6CHMwEZIaNsdWy+tuvHaavNeGP06o1tgrR0kLvU= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcesettings v1.4.0 h1:eTzOwB13WrfF0kuzG2ZXCfB3TLunSHBur4s+HFU6uSM= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/retail v1.11.0 h1:N9fa//ecFUOEPsW/6mJHfcapPV0wBSwIUwpVZB7MQ3o= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/run v0.3.0 h1:AWPuzU7Xtaj3Jf+QarDWIs6AJ5hM1VFQ+F6Q+VZ6OT4= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/scheduler v1.7.0 h1:K/mxOewgHGeKuATUJNGylT75Mhtjmx1TOkKukATqMT8= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/secretmanager v1.9.0 h1:xE6uXljAC1kCR8iadt9+/blg1fvSbmenlsDN4fT9gqw= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/security v1.10.0 h1:KSKzzJMyUoMRQzcz7azIgqAUqxo7rmQ5rYvimMhikqg= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/securitycenter v1.16.0 h1:QTVtk/Reqnx2bVIZtJKm1+mpfmwRwymmNvlaFez7fQY= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/servicecontrol v1.5.0 h1:ImIzbOu6y4jL6ob65I++QzvqgFaoAKgHOG+RU9/c4y8= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicedirectory v1.7.0 h1:f7M8IMcVzO3T425AqlZbP3yLzeipsBHtRza8vVFYMhQ= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicemanagement v1.5.0 h1:TpkCO5M7dhKSy1bKUD9o/sSEW/U1Gtx7opA1fsiMx0c= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/serviceusage v1.4.0 h1:b0EwJxPJLpavSljMQh0RcdHsUrr5DQ+Nelt/3BAs5ro= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/shell v1.4.0 h1:b1LFhFBgKsG252inyhtmsUUZwchqSz3WTvAIf3JFo4g= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/spanner v1.41.0 h1:NvdTpRwf7DTegbfFdPjAWyD7bOVu0VeMqcvR9aCQCAc= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/speech v1.9.0 h1:yK0ocnFH4Wsf0cMdUyndJQ/hPv02oTJOxzi6AgpBy4s= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/storagetransfer v1.6.0 h1:fUe3OydbbvHcAYp07xY+2UpH4AermGbmnm7qdEj3tGE= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/talent v1.4.0 h1:MrekAGxLqAeAol4Sc0allOVqUGO8j+Iim8NMvpiD7tM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/texttospeech v1.5.0 h1:ccPiHgTewxgyAeCWgQWvZvrLmbfQSFABTMAfrSPLPyY= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/tpu v1.4.0 h1:ztIdKoma1Xob2qm6QwNh4Xi9/e7N3IfvtwG5AcNsj1g= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/trace v1.4.0 h1:qO9eLn2esajC9sxpqp1YKX37nXC3L4BfGnPS0Cx9dYo= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/translate v1.4.0 h1:AOYOH3MspzJ/bH1YXzB+xTE8fMpn3mwhLjugwGXvMPI= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/video v1.9.0 h1:ttlvO4J5c1VGq6FkHqWPD/aH6PfdxujHt+muTJlW1Zk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/videointelligence v1.9.0 h1:RPFgVVXbI2b5vnrciZjtsUgpNKVtHO/WIyXUhEfuMhA= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/vision v1.2.0 h1:/CsSTkbmO9HC8iQpxbK8ATms3OQaX3YQUeTMGCxlaK4= +cloud.google.com/go/vision/v2 v2.5.0 h1:TQHxRqvLMi19azwm3qYuDbEzZWmiKJNTpGbkNsfRCik= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vmmigration v1.3.0 h1:A2Tl2ZmwMRpvEmhV2ibISY85fmQR+Y5w9a0PlRz5P3s= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmwareengine v0.1.0 h1:JMPZaOT/gIUxVlTqSl/QQ32Y2k+r0stNeM1NSqhVP9o= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vpcaccess v1.5.0 h1:woHXXtnW8b9gLFdWO9HLPalAddBQ9V4LT+1vjKwR3W8= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/webrisk v1.7.0 h1:ypSnpGlJnZSXbN9a13PDmAYvVekBLnGKxQ3Q9SMwnYY= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/websecurityscanner v1.4.0 h1:y7yIFg/h/mO+5Y5aCOtVAnpGUOgqCH5rXQ2Oc8Oq2+g= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/workflows v1.9.0 h1:7Chpin9p50NTU8Tb7qk+I11U/IwVXmDhEoSsdccvInE= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +collectd.org v0.3.0 h1:iNBHGw1VvPJxH2B6RiFWFZ+vsjo1lCdRszBeOuwGi00= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= +git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3 h1:4wDp4BKF7NQqoh73VXpZsB/t1OEhDpz/zEpmdQfbjDk= +git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 h1:Ahny8Ud1LjVMMAlt8utUFKhhxJtwBAualvsbc/Sk7cE= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/Abirdcfly/dupword v0.0.7 h1:z14n0yytA3wNO2gpCD/jVtp/acEXPGmYu0esewpBt6Q= +github.com/Antonboom/errname v0.1.7 h1:mBBDKvEYwPl4WFFNwec1CZO096G6vzK9vvDQzAwkako= +github.com/Antonboom/nilnil v0.1.1 h1:PHhrh5ANKFWRBh7TdYmyyq2gyT2lotnvFvvFbylF81Q= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 h1:qoVeMsc9/fh/yhxVaA0obYjVH/oI/ihrOoMwsLS9KSA= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 h1:Px2UA+2RvSSvv+RvJNuUB6n7rs5Wsel4dXLe90Um2n4= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= +github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= +github.com/DataDog/zstd v1.5.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= +github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7IAzX8QezqtFV9m0MUHFJgts= +github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/OpenPeeDeeP/depguard v1.1.1 h1:TSUznLjvp/4IUP+OQ0t/4jF4QUyxIcVX8YnghZdunyA= +github.com/Shopify/sarama v1.19.0 h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s= +github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= +github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= +github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6 h1:1d9pzdbkth4D9AX6ndKSl7of3UTV0RYl3z64U2dXMGo= +github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= +github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= +github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db h1:nxAtV4VajJDhKysp2kdcJZsq8Ss1xSA0vZTkVHHJd0E= +github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a h1:pv34s756C4pEXnjgPfGYgdhg/ZdajGhyOvzx8k+23nw= +github.com/ashanbrown/forbidigo v1.3.0 h1:VkYIwb/xxdireGAdJNZoo24O4lmnEWkactplBlWTShc= +github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= +github.com/aws/aws-lambda-go v1.13.3 h1:SuCy7H3NLyp+1Mrfp+m80jcbi9KYWAs9/BXwppwRDzY= +github.com/aws/aws-sdk-go-v2 v1.9.1 h1:ZbovGV/qo40nrOJ4q8G33AGICzaPI45FHQWJ9650pF4= +github.com/aws/aws-sdk-go-v2/config v1.1.1 h1:ZAoq32boMzcaTW9bcUacBswAmHTbvlvDJICgHFZuECo= +github.com/aws/aws-sdk-go-v2/credentials v1.1.1 h1:NbvWIM1Mx6sNPTxowHgS2ewXCRp+NGTzUYb/96FZJbY= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 h1:EtEU7WRaWliitZh2nmuxEXrN0Cb8EgPUFGIoTMeqbzI= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1 h1:w/fPGB0t5rWwA43mux4e9ozFSH5zF1moQemlA131PWc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 h1:4AH9fFjUlVktQMznF+YN33aWNXaR4VgDXyP28qokJC0= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 h1:cKr6St+CtC3/dl/rEBJvlk7A/IN5D5F02GNkGzfbtVU= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 h1:37QubsarExl5ZuCBlnRP+7l1tNwZPBSTqpTBrPH98RU= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 h1:TJoIfnIFubCX0ACVeJ0w46HEH5MwjwYN4iFhuYIhfIY= +github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= +github.com/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= +github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= +github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 h1:y4B3+GPxKlrigF1ha5FFErxK+sr6sWxQovRMzwMhejo= +github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= +github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxjM= +github.com/breml/bidichk v0.2.3 h1:qe6ggxpTfA8E75hdjWPZ581sY3a2lnl0IRxLQFelECI= +github.com/breml/errchkjson v0.3.0 h1:YdDqhfqMT+I1vIxPSas44P+9Z9HzJwCeAzjB8PxP1xw= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= +github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= +github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc= +github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk= +github.com/bufbuild/buf v1.9.0 h1:8a60qapVuRj6crerWR0rny4UUV/MhZSL5gagJuBxmx8= +github.com/bufbuild/connect-go v1.0.0 h1:htSflKUT8y1jxhoPhPYTZMrsY3ipUXjjrbcZR5O2cVo= +github.com/bufbuild/protocompile v0.1.0 h1:HjgJBI85hY/qmW5tw/66sNDZ7z0UDdVSi/5r40WHw4s= +github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= +github.com/bwesterb/go-ristretto v1.2.0 h1:xxWOVbN5m8NNKiSDZXE1jtZvZnC6JSJ9cYFADiZcWtw= +github.com/c-bata/go-prompt v0.2.2 h1:uyKRz6Z6DUyj49QVijyM339UJV9yhbr70gESwbNU3e0= +github.com/casbin/casbin/v2 v2.37.0 h1:/poEwPSovi4bTOcP752/CsTQiRz2xycyVKFG7GUhbDw= +github.com/celestiaorg/smt v0.3.0 h1:Hc6m8fIVRajrg/Saf8ivX4xw551LHzOs8kqeadd6h9s= +github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= +github.com/charithe/durationcheck v0.0.9 h1:mPP4ucLrf/rKZiIG/a9IPXHGlh8p4CzgpyTy6EEutYk= +github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 h1:E7LT642ysztPWE0dfz43cWOvMiF42DyTRC+eZIaO4yI= +github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY= +github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA= +github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec h1:EdRZT3IeKQmfCSrgo8SZ8V3MEnskuJP0wCYNpe+aiXo= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= +github.com/cloudflare/cloudflare-go v0.14.0 h1:gFqGlGl/5f9UGXAaKapCGUfaTCgRKKnzu2VvzMZlOFA= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= +github.com/coinbase/kryptology v1.8.0 h1:Aoq4gdTsJhSU3lNWsD5BWmFSz2pE0GlmrljaOxepdYY= +github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= +github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= +github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a h1:AEpwbXTjBGKoqxuQ6QAcBMEuK0+PtajQj0wJkhTnSd0= +github.com/consensys/gnark-crypto v0.5.3 h1:4xLFGZR3NWEH2zy+YzvzHicpToQR8FXFbfLNvpGB+rE= +github.com/containerd/containerd v1.6.8 h1:h4dOFDwzHmqFEP754PgfgTeVXFnLiRc6kiqC7tplDJs= +github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= +github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04= +github.com/coreos/go-etcd v2.0.0+incompatible h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 h1:u9SHYsPQNyt5tgDm3YN7+9dYrpK96E5wFilTFWIDZOM= +github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 h1:rtAn27wIbmOGUs7RIbVgPEjb31ehTVniDwPGXyMxm5U= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI= +github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1 h1:6YvzjQtc+cDwCe9XwYPPa8zFCxNG79N7vmCjpK+vGOg= +github.com/cosmos/ibc-go/v6 v6.1.0 h1:o7oXws2vKkKfOFzJI+oNylRn44PCNt5wzHd/zKQKbvQ= +github.com/cosmos/ibc-go/v6 v6.1.0/go.mod h1:CY3zh2HLfetRiW8LY6kVHMATe90Wj/UOoY8T6cuB0is= +github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= +github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= +github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= +github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c h1:/ovYnF02fwL0kvspmy9AuyKg1JhdTRUgPw4nUxd9oZM= +github.com/daixiang0/gci v0.8.1 h1:T4xpSC+hmsi4CSyuYfIJdMZAr9o7xZmHpQVygMghGZ4= +github.com/dave/jennifer v1.2.0 h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc= +github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/lru v1.0.0 h1:Kbsb1SFDsIlaupWPwsPp+dkxiBY1frcS07PCPgotKz8= +github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU= +github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 h1:akOQj8IVgoeFfBTzGOEQakCYshWD6RNo1M5pivFXt70= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 h1:Izz0+t1Z5nI16/II7vuEo/nHjodOg0p7+OiDpjX5t1E= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= +github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64= +github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48 h1:iZOop7pqsg+56twTopWgwCGxdB5SI2yDO8Ti7eTRliQ= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7 h1:tYwu/z8Y0NkkzGEh3z21mSWggMg4LwLRFucLS7TjARg= +github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= +github.com/eclipse/paho.mqtt.golang v1.2.0 h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t2y2qayIX0= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 h1:xvqufLtNVwAhN8NMyWklVgxnWohi+wtMGQMhtxexlm0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= +github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= +github.com/ethereum/go-ethereum v1.10.17 h1:XEcumY+qSr1cZQaWsQs5Kck3FHB0V2RiMHPdTBJ+oT8= +github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90 h1:WXb3TSNmHp2vHoCroCIB1foO/yQ36swABL8aOVeDpgg= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db h1:gb2Z18BhTPJPpLQWj4T+rfKHYCHxRHCtRxhKKjRidVw= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 h1:a9ENSRDFBUPkJ5lCgVZh26+ZbGyoVJG7yb5SSzF5H54= +github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/getkin/kin-openapi v0.61.0 h1:6awGqF5nG5zkVpMsAih1QH4VgzS8phTxECUWIFo7zko= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd h1:r04MMPyLHj/QwZuMJ5+7tJcBr1AQjpiAK/rZWRrQT7o= +github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31 h1:gclg6gY70GLy3PbkQ1AERPfmLMMagS60DKF78eWwLn8= +github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8= +github.com/go-critic/go-critic v0.6.5 h1:fDaR/5GWURljXwF8Eh31T2GZNz9X4jeboS912mWF8Uo= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= +github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= +github.com/go-toolsmith/astcopy v1.0.2 h1:YnWf5Rnh1hUudj11kei53kI57quN/VH6Hp1n+erozn0= +github.com/go-toolsmith/astequal v1.0.3 h1:+LVdyRatFS+XO78SGV4I3TCEA0AC7fKEGma+fH+674o= +github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= +github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg= +github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= +github.com/go-toolsmith/typep v1.0.2 h1:8xdsa1+FSIH/RhEkgnD1j2CJOy5mNllW1Q9tRiYwvlk= +github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4/FHQWkvVRmgijNXRfzkIDHh23ggEo= +github.com/go-zookeeper/zk v1.0.2 h1:4mx0EYENAdX/B/rbunjlt5+4RTA/a9SMHBRuSKdGxPM= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= +github.com/gogo/googleapis v1.1.0 h1:kFkMAZBNAn4j7K0GiZr8cRYzejq68VbheufiV3YuyFI= +github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/geo v0.0.0-20190916061304-5b978397cfec h1:lJwO/92dFXWeXOZdoGXgptLmNLwynMSHUmU6besqtiw= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= +github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6J5HIP8ZtyMdiDscjMLfRBSPuzVVeo= +github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 h1:amWTbTGqOZ71ruzrdA+Nx5WA3tV1N0goTspwmKCQvBY= +github.com/golangci/golangci-lint v1.50.1 h1:C829clMcZXEORakZlwpk7M4iDw2XiwxxKaG504SZ9zY= +github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= +github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= +github.com/golangci/misspell v0.3.5 h1:pLzmVdl3VxTOncgzHcvLOKirdvcx/TydsClUQXTehjo= +github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= +github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= +github.com/google/flatbuffers v1.11.0 h1:O7CEyB8Cb3/DmtxODGtLHcEvpr81Jm5qLg/hsHnxA2A= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 h1:tlyzajkF3030q6M8SvmJSemC9DTHL/xaMa18b65+JM4= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 h1:PVRE9d4AQKmbelZ7emNig1+NT27DUmKZn5qXxfio54U= +github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= +github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= +github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= +github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= +github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= +github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= +github.com/hashicorp/consul/api v1.15.3 h1:WYONYL2rxTXtlekAqblR2SCdJsizMDIj/uXb5wNy9zU= +github.com/hashicorp/consul/sdk v0.3.0 h1:UOxjlb4xVNF93jak1mzzoBatyFju9nrkxpVwIp/QqxQ= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-retryablehttp v0.5.3 h1:QlWt0KvWT0lq8MFppF9tsJGF+ynG7ztc2KIPhzRGk7s= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= +github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= +github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= +github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= +github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= +github.com/hashicorp/serf v0.9.8 h1:JGklO/2Drf1QGa312EieQN3zhxQ+aJg6pG+aC3MFaVo= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= +github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hudl/fargo v1.4.0 h1:ZDDILMbB37UlAVLlWcJ2Iz1XuahZZTDZfdCKeclfq2s= +github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204 h1:+EYBkW+dbi3F/atB+LSQZSWh7+HNrV3A/N0y6DSoy9k= +github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150 h1:vlNjIqmUZ9CMAWsbURYl3a6wZbw7q5RHVvlXTNS/Bs8= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= +github.com/influxdata/flux v0.65.1 h1:77BcVUCzvN5HMm8+j9PRBQ4iZcu98Dl4Y9rf+J5vhnc= +github.com/influxdata/influxdb v1.8.3 h1:WEypI1BQFTT4teLM+1qkEcvUi0dAvopAI/ir0vAiBg8= +github.com/influxdata/influxdb-client-go/v2 v2.4.0 h1:HGBfZYStlx3Kqvsv1h2pJixbCl/jhnFtxpKFAv9Tu5k= +github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab h1:HqW4xhhynfjrtEiiSGcQUd6vrK23iMam1FO8rI7mwig= +github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385 h1:ED4e5Cc3z5vSN2Tz2GkOHN7vs4Sxe2yds6CXvDnvZFE= +github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 h1:vilfsDSy7TDxedi9gyBkMvAirat/oRcL0lFdJBf6tdM= +github.com/influxdata/promql/v2 v2.12.0 h1:kXn3p0D7zPw16rOtfDR+wo6aaiH8tSMfhPwONTxrlEc= +github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6 h1:UzJnB7VRL4PSkUJHwsyzseGOmrO/r4yA+AuxGJxiZmA= +github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9 h1:MHTrDWmQpHq/hkq+7cw9oYAt2PqUw52TZazRA0N7PGE= +github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368 h1:+TUUmaFa4YD1Q+7bH9o5NCHQGPMqZCYJiNW6lIIS9z4= +github.com/informalsystems/tm-load-test v1.0.0 h1:e1IeUw8701HWCMuOM1vLM/XcpH2Lrb88GNWdFAPDmmA= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a h1:d4+I1YEKVmWZrgkt6jpXBnLgV2ZjO0YxEtLDdfIZfH4= +github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e h1:UvSe12bq+Uj2hWd8aOlwPmoZ+CITRFrdit+sDGfAg8U= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= +github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= +github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= +github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= +github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= +github.com/jsternberg/zap-logfmt v1.0.0 h1:0Dz2s/eturmdUS34GM82JwNEdQ9hPoJgqptcEKcbpzY= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= +github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5 h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0= +github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef h1:2jNeR4YUziVtswNP9sEFAI913cVrzH85T+8Q6LpYbT0= +github.com/karalabe/usb v0.0.2 h1:M6QQBNxF+CQ8OFvxrT90BA0qBOXymndZnk5q235mFc4= +github.com/kisielk/errcheck v1.6.2 h1:uGQ9xI8/pgc9iOoCe7kWQgRE6SBTrCGmTSf0LrEtY7c= +github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= +github.com/kkHAIKE/contextcheck v1.1.3 h1:l4pNvrb8JSwRd51ojtcOxOeHJzHek+MtOyXbaR0uvmw= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= +github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6 h1:KAZ1BW2TCmT6PRihDPpocIy1QTtsAsrx6TneU/4+CMg= +github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= +github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= +github.com/kunwardeep/paralleltest v1.0.6 h1:FCKYMF1OF2+RveWlABsdnmsvJrei5aoyZoaGS+Ugg8g= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kyoh86/exportloopref v0.1.8 h1:5Ry/at+eFdkX9Vsdw3qU4YkvGtzuVfzT4X7S77LoN/M= +github.com/labstack/echo/v4 v4.2.1 h1:LF5Iq7t/jrtUuSutNuiEWtB5eiHfZ5gSe2pcu5exjQw= +github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= +github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= +github.com/ldez/tagliatelle v0.3.1 h1:3BqVVlReVUZwafJUwQ+oxbx2BEX2vUG4Yu/NOfMiKiM= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leonklingele/grouper v1.1.0 h1:tC2y/ygPbMFSBOs3DcyaEMKnnwH7eYKzohOtRrf0SAg= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743 h1:143Bb8f8DuGWck/xpNUOckBVYfFbBTnLevfRZ1aVVqo= +github.com/lightstep/lightstep-tracer-go v0.18.1 h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuNSc19z330K6vl4zk= +github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77 h1:6xiz3+ZczT3M4+I+JLpcPGG1bQKm8067HktB17EDWEE= +github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= +github.com/lyft/protoc-gen-validate v0.0.13 h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= +github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= +github.com/maratori/testpackage v1.1.0 h1:GJY4wlzQhuBusMF1oahQCBtUV/AQ/k69IZ68vxaac2Q= +github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 h1:pWxk9e//NbPwfxat7RXkts09K+dEBJWakUWwICVqYbA= +github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd h1:HvFwW+cm9bCbZ/+vuGNq7CRWXql8c0y8nGeYpqmpvmk= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= +github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104 h1:d8RFOZ2IiFtFWBcKEHAFYJcPTf0wY5q0exFNJZVWa1U= +github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= +github.com/mgechev/revive v1.2.4 h1:+2Hd/S8oO2H0Ikq2+egtNwQsVhAeELHjxjIUFX5ajLI= +github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= +github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= +github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= +github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= +github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= +github.com/moby/buildkit v0.10.4 h1:FvC+buO8isGpUFZ1abdSLdGHZVqg9sqI4BbFL8tlzP4= +github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5 h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA= +github.com/moricho/tparallel v0.2.1 h1:95FytivzT6rYzdJLdtfn6m1bfFJylOJK41+lgv/EHf4= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY= +github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76 h1:0xuRacu/Zr+jX+KyLLPPktbwXqyOvnOPUQmMLzX1jxU= +github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= +github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 h1:shk/vn9oCoOTmwcouEdwIeOtOGA/ELRUw/GwvxwfT+0= +github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= +github.com/nats-io/jwt/v2 v2.0.3 h1:i/O6cmIsjpcQyWDYNcq2JyZ3/VTF8SJ4JWluI5OhpvI= +github.com/nats-io/nats-server/v2 v2.5.0 h1:wsnVaaXH9VRSg+A2MVg5Q727/CqxnmPLGFQ3YZYKTQg= +github.com/nats-io/nats.go v1.12.1 h1:+0ndxwUPz3CmQ2vjbXdkC1fo3FdiOQDim4gl3Mge8Qo= +github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= +github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= +github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= +github.com/neilotoole/errgroup v0.1.6 h1:PODGqPXdT5BC/zCYIMoTrwV+ujKcW+gBXM6Ye9Ve3R8= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/nishanths/exhaustive v0.8.3 h1:pw5O09vwg8ZaditDp/nQRqVnrMczSJDxRDJMowvhsrM= +github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= +github.com/oklog/oklog v0.3.2 h1:wVfs8F+in6nTBMkA7CbRw+zZMIB7nNM825cM1wuzoTk= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU= +github.com/opentracing/basictracer-go v1.0.0 h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7lZWlQw5UXuoo= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5 h1:ZCnq+JUrvXcDVhX/xRolRBZifmabN1HcS1wrPSvxhrU= +github.com/openzipkin/zipkin-go v0.2.5 h1:UwtQQx2pyPIgWYHRg+epgdx1/HnBQTgN3/oIYEJTQzU= +github.com/pact-foundation/pact-go v1.0.4 h1:OYkFijGHoZAYbOIb1LWXrwKQbMMRUv1oQ89blD2Mh2Q= +github.com/paulbellamy/ratecounter v0.2.0 h1:2L/RhJq+HA8gBQImDXtLPrDXK5qAj6ozWVK/zFXVJGs= +github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= +github.com/performancecopilot/speed v3.0.0+incompatible h1:2WnRzIquHa5QxaJKShDkLM+sc0JPuwhXzK8OYOyt3Vg= +github.com/performancecopilot/speed/v4 v4.0.0 h1:VxEDCmdkfbQYDlcr/GC9YoN9PQ6p8ulk9xVsepYy9ZY= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= +github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= +github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= +github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= +github.com/pkg/sftp v1.13.1 h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs= +github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5 h1:tFwafIEMf0B7NlcxV/zJ6leBIa81D3hgGSgsE5hCkOQ= +github.com/polyfloyd/go-errorlint v1.0.5 h1:AHB5JRCjlmelh9RrLxT9sgzpalIwwq4hqE8EkwIwKdY= +github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= +github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= +github.com/quasilyte/go-ruleguard v0.3.18 h1:sd+abO1PEI9fkYennwzHn9kl3nqP6M5vE7FiOzZ+5CE= +github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f h1:6Gtn2i04RD0gVyYf2/IUMTIs+qYleBt4zxDqkLTcu4U= +github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 h1:L8QM9bvf68pVdQ3bCFZMDmnt9yqcMBro1pC7F+IPYMY= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= +github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52 h1:RnWNS9Hlm8BIkjr6wx8li5abe0fr73jljLycdfemTp0= +github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= +github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= +github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4= +github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/ryancurrah/gomodguard v1.2.4 h1:CpMSDKan0LtNGGhPrvupAoLeObRFjND8/tU1rEOtBp4= +github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= +github.com/sagikazarmark/crypt v0.8.0 h1:xtk0uUHVWVsRBdEUGYBym4CXbcllXky2M7Qlwsf8C0Y= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU= +github.com/sanposhiho/wastedassign/v2 v2.0.6 h1:+6/hQIHKNJAUixEj6EmOngGIisyeI+T3335lYTyxRoA= +github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= +github.com/sashamelentyev/usestdlibvars v1.20.0 h1:K6CXjqqtSYSsuyRDDC7Sjn6vTMLiSJa4ZmDkiokoqtw= +github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= +github.com/securego/gosec/v2 v2.13.1 h1:7mU32qn2dyC81MH9L2kefnQyRMUarfDER3iQyMHcjYM= +github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM= +github.com/segmentio/kafka-go v0.2.0 h1:HtCSf6B4gN/87yc5qTl7WsxPKQIIGXLPPM1bMCPOsoY= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/sivchari/containedctx v1.0.2 h1:0hLQKpgC53OVF1VT7CeoFHk9YKstur1XOgfYIc1yrHI= +github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= +github.com/sivchari/tenv v1.7.0 h1:d4laZMBK6jpe5PWepxlV9S+LC0yXqvYHiq8E6ceoVVE= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa h1:YJfZp12Z3AFhSBeXOlv4BO55RMwPn2NoQeDsrdWnBtY= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= +github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= +github.com/sony/gobreaker v0.4.1 h1:oMnRNZXX5j85zso6xCPRNPtmAycat+WcoKbklScLDgQ= +github.com/sourcegraph/go-diff v0.6.1 h1:hmA1LzxW0n1c3Q4YbrFgg4P99GSnebYa3x8gr0HZqLQ= +github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= +github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= +github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= +github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e h1:mOtuXaRAbVZsxAHVdPR3IjfmN8T1h2iczJLynhLybf8= +github.com/tdakkota/asciicheck v0.1.1 h1:PKzG7JUTUmVspQTDqtkX9eSiLGossXTybutHwTXuO0A= +github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= +github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= +github.com/tidwall/gjson v1.14.0 h1:6aeJ0bzojgWLa82gDQHcx3S0Lr/O51I9bJ5nv6JFx5w= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/sjson v1.2.4 h1:cuiLzLnaMeBhRmEv00Lpk3tkYrcxpmbU81tAY4Dw0tc= +github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 h1:kl4KhGNsJIbDHS9/4U9yQo1UcPQM0kOMJHn29EoH/Ro= +github.com/timonwong/loggercheck v0.9.3 h1:ecACo9fNiHxX4/Bc02rW2+kaJIAMAes7qJ7JKxt0EZI= +github.com/tinylib/msgp v1.1.5 h1:2gXmtWueD2HefZHQe1QOy9HVzmFrLOVvsXwXBQ0ayy0= +github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= +github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE= +github.com/tomarrell/wrapcheck/v2 v2.7.0 h1:J/F8DbSKJC83bAvC6FoZaRjZiZ/iKoueSdrEkmGeacA= +github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= +github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 h1:OXcKh35JaYsGMRzpvFkLv/MEyPuL49CThT1pZ8aSml4= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= +github.com/tyler-smith/go-bip39 v1.0.2 h1:+t3w+KwLXO6154GNJY+qUtIxLTmFjfUmpguQT1OlOT8= +github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= +github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= +github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= +github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= +github.com/uudashr/gocognit v1.0.6 h1:2Cgi6MweCsdB6kpcVQp7EW4U23iBFQWfTXiWlyp842Y= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= +github.com/vektra/mockery/v2 v2.14.0 h1:KZ1p5Hrn8tiY+LErRMr14HHle6khxo+JKOXLBW/yfqs= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/willf/bitset v1.1.3 h1:ekJIKh6+YbUIVt9DfNbkR5d6aFcFTLDRyJNAACURBg8= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= +github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6 h1:YdYsPAZ2pC6Tow/nPZOPQ96O3hm/ToAkGsPLzedXERk= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= +github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= +github.com/ybbus/jsonrpc v2.1.2+incompatible h1:V4mkE9qhbDQ92/MLMIhlhMSbz8jNXdagC3xBR5NDwaQ= +github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= +go.etcd.io/etcd/api/v3 v3.5.5 h1:BX4JIbQ7hl7+jL+g+2j5UAr0o1bctCm6/Ct+ArBGkf0= +go.etcd.io/etcd/client/pkg/v3 v3.5.5 h1:9S0JUVvmrVl7wCF39iTQthdaaNIiAaQbmK75ogO6GU8= +go.etcd.io/etcd/client/v2 v2.305.5 h1:DktRP60//JJpnPC0VBymAN/7V71GHMdjDCBt4ZPXDjI= +go.etcd.io/etcd/client/v3 v3.5.5 h1:q++2WTJbUgpQu4B6hCuT7VkdwaTP7Qz6Daak3WzbrlI= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.3 h1:syAz40OyelLZo42+3U68Phisvrx4qh+4wpdZw7eUUdY= +go.opentelemetry.io/otel v1.11.0 h1:kfToEGMDq6TrVrJ9Vht84Y8y9enykSZzDDZglV0kIEk= +go.opentelemetry.io/otel/metric v0.32.3 h1:dMpnJYk2KULXr0j8ph6N7+IcuiIQXlPXD4kix9t7L9c= +go.opentelemetry.io/otel/trace v1.11.0 h1:20U/Vj42SX+mASlXLmSGBg6jpI1jQtv682lZtTAOVFI= +go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 h1:Ic/qN6TEifvObMGQy72k0n1LlJr7DjWWEi+MOsDOiSk= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= +gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= +gopkg.in/cheggaaa/pb.v1 v1.0.27 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/gcfg.v1 v1.2.3 h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= +gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= +gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA= +mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= +mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= +mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= +mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 h1:seuXWbRB1qPrS3NQnHmFKLJLtskWyueeIzmLXghMGgk= +pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= +rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= +rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= +rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 h1:ucqkfpjg9WzSUubAO62csmucvxl4/JeW3F4I4909XkM= diff --git a/make/proto.mk b/make/proto.mk index 42b00c553..9c631658a 100644 --- a/make/proto.mk +++ b/make/proto.mk @@ -10,7 +10,7 @@ containerProtoGen=cheqd-node-proto-gen-$(containerProtoVer) containerProtoFmt=cheqd-node-proto-fmt-$(containerProtoVer) containerProtoGenSwagger=cheqd-node-proto-gen-swagger-$(containerProtoVer) -proto-all: proto-lint proto-format proto-gen proto-check-breaking +proto-all: proto-lint proto-format proto-gen proto-swagger-gen proto-gen: @echo "Generating Protobuf files" @@ -22,46 +22,14 @@ proto-format: @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ find . -name "*.proto" -not -path "./third_party/*" -exec clang-format -i {} \; ; fi -DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf:1.7.0 +DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf:1.11.0 -# Uncomment next lines while working on pulsar and swagger functionality +proto-lint: + @$(DOCKER_BUF) lint --error-format=json +proto-swagger-gen: + @echo "Generating Protobuf Swagger" + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then docker start -a $(containerProtoGenSwagger); else docker run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ + sh ./scripts/protoc-swagger-gen.sh; fi -# proto-lint: -# @$(DOCKER_BUF) lint --error-format=json - -# proto-check-breaking: -# @$(DOCKER_BUF) breaking --against https://github.com/cheqd/cheqd-node.git#branch=main - -# GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos -# GOOGLE_PROTO_URL = https://raw.githubusercontent.com/googleapis/googleapis/master -# COSMOS_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.45.4/proto/cosmos -# COSMOS_ORM_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/orm/v1.0.0-alpha.10/proto/cosmos - -# GOGO_PROTO_TYPES = third_party/proto/gogoproto -# GOOGLE_PROTO_TYPES = third_party/proto/google -# COSMOS_PROTO_TYPES = third_party/proto/cosmos - -# proto-swagger-deps: -# @mkdir -p $(GOGO_PROTO_TYPES) -# @curl -sSL $(GOGO_PROTO_URL)/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto - -# @mkdir -p $(GOOGLE_PROTO_TYPES)/api/ -# @curl -sSL $(GOOGLE_PROTO_URL)/google/api/annotations.proto > $(GOOGLE_PROTO_TYPES)/api/annotations.proto -# @curl -sSL $(GOOGLE_PROTO_URL)/google/api/http.proto > $(GOOGLE_PROTO_TYPES)/api/http.proto - -# @mkdir -p $(COSMOS_PROTO_TYPES)/base/v1beta1/ -# @curl -sSL $(COSMOS_PROTO_URL)/base/v1beta1/coin.proto > $(COSMOS_PROTO_TYPES)/base/v1beta1/coin.proto - -# @mkdir -p $(COSMOS_PROTO_TYPES)/base/query/v1beta1/ -# @curl -sSL $(COSMOS_PROTO_URL)/base/query/v1beta1/pagination.proto > $(COSMOS_PROTO_TYPES)/base/query/v1beta1/pagination.proto - -# @mkdir -p $(COSMOS_PROTO_TYPES)/orm/v1alpha1/ -# @curl -sSL $(COSMOS_ORM_PROTO_URL)/orm/v1alpha1/orm.proto > $(COSMOS_PROTO_TYPES)/orm/v1alpha1/orm.proto - -# proto-swagger-gen: proto-swagger-deps -# @echo "Generating Protobuf Swagger" -# @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then docker start -a $(containerProtoGenSwagger); else docker run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ -# sh ./scripts/protoc-swagger-gen.sh; fi - -.PHONY: proto-all proto-gen proto-format #proto-lint proto-check-breaking proto-swagger-deps proto-swagger-gen \ No newline at end of file +.PHONY: proto-all proto-gen proto-format proto-lint proto-swagger-gen \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fd58af905..9e6435b2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,52 @@ "@semantic-release/commit-analyzer": "^9.0.2", "@semantic-release/git": "^10.0.1", "conventional-changelog-conventionalcommits": "^5.0.0", - "semantic-release": "^19.0.5" + "semantic-release": "^20.0.2", + "swagger-combine": "^1.4.0" + } + }, + "node_modules/@apidevtools/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", + "dev": true, + "dependencies": { + "@jsdevtools/ono": "^7.1.3", + "@types/json-schema": "^7.0.6", + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0" + } + }, + "node_modules/@apidevtools/openapi-schemas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/@apidevtools/swagger-methods": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", + "dev": true + }, + "node_modules/@apidevtools/swagger-parser": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz", + "integrity": "sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==", + "dev": true, + "dependencies": { + "@apidevtools/json-schema-ref-parser": "^9.0.6", + "@apidevtools/openapi-schemas": "^2.0.4", + "@apidevtools/swagger-methods": "^3.0.2", + "@jsdevtools/ono": "^7.1.3", + "call-me-maybe": "^1.0.1", + "z-schema": "^5.0.1" + }, + "peerDependencies": { + "openapi-types": ">=7" } }, "node_modules/@babel/code-frame": { @@ -60,6 +105,12 @@ "node": ">=0.1.90" } }, + "node_modules/@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", + "dev": true + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -410,6 +461,12 @@ "node": ">= 10" } }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", @@ -422,12 +479,6 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "node_modules/@types/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", @@ -513,6 +564,12 @@ "integrity": "sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==", "dev": true }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/argv-formatter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", @@ -583,6 +640,12 @@ "node": ">=8" } }, + "node_modules/call-me-maybe": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", + "dev": true + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -670,14 +733,17 @@ } }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/color-convert": { @@ -695,6 +761,16 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "optional": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, "node_modules/compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -810,19 +886,18 @@ "dev": true }, "node_modules/cosmiconfig": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.0.0.tgz", + "integrity": "sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==", "dev": true, "dependencies": { - "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "path-type": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/cross-spawn": { @@ -1000,17 +1075,126 @@ "dev": true }, "node_modules/env-ci": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-5.5.0.tgz", - "integrity": "sha512-o0JdWIbOLP+WJKIUt36hz1ImQQFuN92nhsfTkHHap+J8CiI8WgGpH/a9jEGHh4/TU5BUUGjlnKXNoDb57+ne+A==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-8.0.0.tgz", + "integrity": "sha512-W+3BqGZozFua9MPeXpmTm5eYEBtGgL76jGu/pwMVp/L8PdECSCEWaIp7d4Mw7kuUrbUldK0oV0bNd6ZZjLiMiA==", "dev": true, "dependencies": { - "execa": "^5.0.0", - "fromentries": "^1.3.2", - "java-properties": "^1.0.0" + "execa": "^6.1.0", + "java-properties": "^1.0.2" + }, + "engines": { + "node": "^16.10 || >=18" + } + }, + "node_modules/env-ci/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/env-ci/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/env-ci/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, "engines": { - "node": ">=10.17" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/error-ex": { @@ -1093,24 +1277,37 @@ } }, "node_modules/fastq": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", - "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dev": true, "dependencies": { "reusify": "^1.0.4" } }, "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" }, "engines": { - "node": ">=8" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1142,15 +1339,15 @@ } }, "node_modules/find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-5.1.0.tgz", + "integrity": "sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==", "dev": true, "dependencies": { - "semver-regex": "^3.1.2" + "semver-regex": "^4.0.5" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1166,26 +1363,6 @@ "readable-stream": "^2.0.0" } }, - "node_modules/fromentries": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", - "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/fs-extra": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", @@ -1376,12 +1553,15 @@ } }, "node_modules/hook-std": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", - "integrity": "sha512-zZ6T5WcuBMIUVh49iPQS9t977t7C0l7OtHrpeMb5uk48JdflRX0NSFvCekfYNmGQETnLq9W/isMyHl69kxGi8g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", + "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==", "dev": true, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hosted-git-info": { @@ -1433,9 +1613,9 @@ } }, "node_modules/ignore": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", - "integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" @@ -1651,6 +1831,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1694,6 +1886,18 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -1706,6 +1910,19 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==", + "deprecated": "Please switch to @apidevtools/json-schema-ref-parser", + "dev": true, + "dependencies": { + "@apidevtools/json-schema-ref-parser": "9.0.9" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -1810,6 +2027,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, "node_modules/lodash.capitalize": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", @@ -1822,6 +2045,18 @@ "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", "dev": true }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "dev": true + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true + }, "node_modules/lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", @@ -1871,9 +2106,9 @@ } }, "node_modules/marked": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.4.tgz", - "integrity": "sha512-Wcc9ikX7Q5E4BYDPvh1C6QNSxrjC9tBgz+A/vAhp59KXUgachw++uMvMKiSW8oA85nopmPZcEvBoex/YLMsiyA==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.5.tgz", + "integrity": "sha512-jPueVhumq7idETHkb203WDD4fMA3yV9emQ5vLwop58lu8bTclMghBWcYAavlDqIEMaisADinV1TooIFCfqOsYQ==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -4717,13 +4952,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/openapi-types": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.0.tgz", + "integrity": "sha512-XpeCy01X6L5EpP+6Hc3jWN7rMZJ+/k1lwki/kTmWzbVhdPie3jd5O2ZtedEx8Yp58icJ0osVldLMrTB/zslQXA==", + "dev": true, + "peer": true + }, "node_modules/p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", + "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5275,9 +5517,9 @@ "dev": true }, "node_modules/semantic-release": { - "version": "19.0.5", - "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-19.0.5.tgz", - "integrity": "sha512-NMPKdfpXTnPn49FDogMBi36SiBfXkSOJqCkk0E4iWOY1tusvvgBwqUmxTX1kmlT6kIYed9YwNKD1sfPpqa5yaA==", + "version": "20.0.2", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-20.0.2.tgz", + "integrity": "sha512-K6TYMAnSUqM2oH0/0ZJErMzkx4SgV2dM8jh5RNGj1ANJ81z/u5XVaPPCZADAl7voEf6t2hd6YioLd0I6yXui2A==", "dev": true, "dependencies": { "@semantic-release/commit-analyzer": "^9.0.2", @@ -5285,35 +5527,350 @@ "@semantic-release/github": "^8.0.0", "@semantic-release/npm": "^9.0.0", "@semantic-release/release-notes-generator": "^10.0.0", - "aggregate-error": "^3.0.0", - "cosmiconfig": "^7.0.0", + "aggregate-error": "^4.0.1", + "cosmiconfig": "^8.0.0", "debug": "^4.0.0", - "env-ci": "^5.0.0", - "execa": "^5.0.0", - "figures": "^3.0.0", - "find-versions": "^4.0.0", + "env-ci": "^8.0.0", + "execa": "^6.1.0", + "figures": "^5.0.0", + "find-versions": "^5.1.0", "get-stream": "^6.0.0", "git-log-parser": "^1.2.0", - "hook-std": "^2.0.0", - "hosted-git-info": "^4.0.0", - "lodash": "^4.17.21", - "marked": "^4.0.10", - "marked-terminal": "^5.0.0", + "hook-std": "^3.0.0", + "hosted-git-info": "^6.0.0", + "lodash-es": "^4.17.21", + "marked": "^4.1.0", + "marked-terminal": "^5.1.1", "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "p-reduce": "^2.0.0", - "read-pkg-up": "^7.0.0", + "p-each-series": "^3.0.0", + "p-reduce": "^3.0.0", + "read-pkg-up": "^9.1.0", "resolve-from": "^5.0.0", "semver": "^7.3.2", - "semver-diff": "^3.1.1", + "semver-diff": "^4.0.0", "signale": "^1.2.1", - "yargs": "^16.2.0" + "yargs": "^17.5.1" }, "bin": { "semantic-release": "bin/semantic-release.js" }, "engines": { - "node": ">=16 || ^14.17" + "node": ">=18" + } + }, + "node_modules/semantic-release/node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/semantic-release/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/hosted-git-info": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "dev": true, + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/semantic-release/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/semantic-release/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/locate-path": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.1.1.tgz", + "integrity": "sha512-vJXaRMJgRVD3+cUZs3Mncj2mxpt5mP0EmNOsxRSZRMlbqjvxzDEOIUWXGmavo0ZC9+tNZCBLQ66reA11nbpHZg==", + "dev": true, + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/lru-cache": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.1.tgz", + "integrity": "sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/semantic-release/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/p-reduce": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/semantic-release/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^2.0.0" + }, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/read-pkg-up": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", + "integrity": "sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==", + "dev": true, + "dependencies": { + "find-up": "^6.3.0", + "read-pkg": "^7.1.0", + "type-fest": "^2.5.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/semver": { @@ -5332,33 +5889,27 @@ } }, "node_modules/semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", "dev": true, "dependencies": { - "semver": "^6.3.0" + "semver": "^7.3.5" }, "engines": { - "node": ">=8" - } - }, - "node_modules/semver-diff/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/semver-regex": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", - "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5650,6 +6201,40 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/swagger-combine": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/swagger-combine/-/swagger-combine-1.4.0.tgz", + "integrity": "sha512-nVQPzSGixSJ6U3BSTBYswIbamumNCz1ZXPqnCrXYz6BHlSeOtfGKuyZ+sAWtpOepUFuOu93x+VOIzAxLKK6xYw==", + "dev": true, + "dependencies": { + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0", + "json-schema-ref-parser": "^9.0.9", + "lodash": "^4.17.21", + "minimist": "^1.2.5", + "swagger-parser": "^10.0.3", + "traverse": "^0.6.6", + "url-join": "^4.0.1" + }, + "bin": { + "swagger-combine": "bin/swagger-combine" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/swagger-parser": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-10.0.3.tgz", + "integrity": "sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==", + "dev": true, + "dependencies": { + "@apidevtools/swagger-parser": "10.0.3" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", @@ -5838,6 +6423,15 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/validator": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -5955,31 +6549,22 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "dev": true, "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { @@ -5990,6 +6575,47 @@ "engines": { "node": ">=10" } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/z-schema": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.5.tgz", + "integrity": "sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==", + "dev": true, + "dependencies": { + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "validator": "^13.7.0" + }, + "bin": { + "z-schema": "bin/z-schema" + }, + "engines": { + "node": ">=8.0.0" + }, + "optionalDependencies": { + "commander": "^9.4.1" + } } } } diff --git a/package.json b/package.json index e7341f46d..67f6f347e 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@semantic-release/commit-analyzer": "^9.0.2", "@semantic-release/git": "^10.0.1", "conventional-changelog-conventionalcommits": "^5.0.0", - "semantic-release": "^19.0.5" + "semantic-release": "^20.0.2", + "swagger-combine": "^1.4.0" } } diff --git a/post/tax.go b/post/tax.go index 788d66a90..b9f9b39cb 100644 --- a/post/tax.go +++ b/post/tax.go @@ -11,8 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" ) -// taxDecorator will handle tax for all taxable messages -type taxDecorator struct { +// TaxDecorator will handle tax for all taxable messages +type TaxDecorator struct { accountKeeper ante.AccountKeeper bankKeeper cheqdante.BankKeeper feegrantKeeper ante.FeegrantKeeper @@ -21,8 +21,8 @@ type taxDecorator struct { } // NewTaxDecorator returns a new taxDecorator -func NewTaxDecorator(ak ante.AccountKeeper, bk cheqdante.BankKeeper, fk ante.FeegrantKeeper, dk cheqdante.DidKeeper, rk cheqdante.ResourceKeeper) taxDecorator { - return taxDecorator{ +func NewTaxDecorator(ak ante.AccountKeeper, bk cheqdante.BankKeeper, fk ante.FeegrantKeeper, dk cheqdante.DidKeeper, rk cheqdante.ResourceKeeper) TaxDecorator { + return TaxDecorator{ accountKeeper: ak, bankKeeper: bk, feegrantKeeper: fk, @@ -32,7 +32,7 @@ func NewTaxDecorator(ak ante.AccountKeeper, bk cheqdante.BankKeeper, fk ante.Fee } // AnteHandle handles tax for all taxable messages -func (td taxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { +func (td TaxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { // must implement FeeTx feeTx, ok := tx.(sdk.FeeTx) if !ok { @@ -79,7 +79,7 @@ func (td taxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, nex } // isTaxable returns true if the message is taxable and returns -func (td taxDecorator) isTaxable(ctx sdk.Context, sdkTx sdk.Tx) (rewards sdk.Coins, burn sdk.Coins, taxable bool, err error) { +func (td TaxDecorator) isTaxable(ctx sdk.Context, sdkTx sdk.Tx) (rewards sdk.Coins, burn sdk.Coins, taxable bool, err error) { feeTx, ok := sdkTx.(sdk.FeeTx) if !ok { return sdk.Coins{}, sdk.Coins{}, false, sdkerrors.Wrapf(sdkerrors.ErrTxDecode, "invalid transaction type: %T, must implement FeeTx", sdkTx) @@ -96,7 +96,7 @@ func (td taxDecorator) isTaxable(ctx sdk.Context, sdkTx sdk.Tx) (rewards sdk.Coi } // getFeePayer returns the fee payer and checks if a fee grant exists -func (td taxDecorator) getFeePayer(ctx sdk.Context, feeTx sdk.FeeTx, tax sdk.Coins, msgs []sdk.Msg) (types.AccountI, error) { +func (td TaxDecorator) getFeePayer(ctx sdk.Context, feeTx sdk.FeeTx, tax sdk.Coins, msgs []sdk.Msg) (types.AccountI, error) { feePayer := feeTx.FeePayer() feeGranter := feeTx.FeeGranter() deductFrom := feePayer @@ -122,7 +122,7 @@ func (td taxDecorator) getFeePayer(ctx sdk.Context, feeTx sdk.FeeTx, tax sdk.Coi return deductFromAcc, nil } -func (td taxDecorator) validateTax(tax sdk.Coins, simulate bool) error { +func (td TaxDecorator) validateTax(tax sdk.Coins, simulate bool) error { // no-op if simulate if simulate { return nil @@ -139,7 +139,7 @@ func (td taxDecorator) validateTax(tax sdk.Coins, simulate bool) error { } // deductTaxFromFeePayer deducts fees from the account -func (td taxDecorator) deductTaxFromFeePayer(ctx sdk.Context, acc types.AccountI, fees sdk.Coins) error { +func (td TaxDecorator) deductTaxFromFeePayer(ctx sdk.Context, acc types.AccountI, fees sdk.Coins) error { // ensure module account has been set if addr := td.accountKeeper.GetModuleAddress(didtypes.ModuleName); addr == nil { return fmt.Errorf("cheqd fee collector module account (%s) has not been set", didtypes.ModuleName) @@ -162,7 +162,7 @@ func (td taxDecorator) deductTaxFromFeePayer(ctx sdk.Context, acc types.AccountI } // distributeRewards distributes rewards to the fee collector -func (td taxDecorator) distributeRewards(ctx sdk.Context, rewards sdk.Coins) error { +func (td TaxDecorator) distributeRewards(ctx sdk.Context, rewards sdk.Coins) error { // move rewards to fee collector err := td.bankKeeper.SendCoinsFromModuleToModule(ctx, didtypes.ModuleName, types.FeeCollectorName, rewards) if err != nil { @@ -172,7 +172,7 @@ func (td taxDecorator) distributeRewards(ctx sdk.Context, rewards sdk.Coins) err } // burnFees burns fees from the module account -func (td taxDecorator) burnFees(ctx sdk.Context, fees sdk.Coins) error { +func (td TaxDecorator) burnFees(ctx sdk.Context, fees sdk.Coins) error { // burn fees err := td.bankKeeper.BurnCoins(ctx, didtypes.ModuleName, fees) if err != nil { diff --git a/proto/buf.gen.swagger.yaml b/proto/buf.gen.swagger.yaml index 392100fd7..0fe01d773 100644 --- a/proto/buf.gen.swagger.yaml +++ b/proto/buf.gen.swagger.yaml @@ -4,5 +4,8 @@ version: v1 plugins: - name: swagger - out: ../tmp-swagger-gen - opt: logtostderr=true,fqn_for_swagger_name=true,simple_operation_ids=true + out: ../api/docs + opt: + - fqn_for_swagger_name=true + - logtostderr=true + - simple_operation_ids=true diff --git a/proto/buf.lock b/proto/buf.lock index e66cf44e3..446ad1fdc 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -8,12 +8,12 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: 44369accb517453db1f2228530da42c0 + commit: fe58c1d200724c37a5cbc5f70953f900 - remote: buf.build owner: cosmos repository: gogo-proto - commit: bee5511075b7499da6178d9e4aaa628b + commit: 34d970b699f84aa382f3c29773a60836 - remote: buf.build owner: googleapis repository: googleapis - commit: 8d7204855ec14631a499bd7393ce1970 + commit: 75b4300737fb4efca0831636be94e517 diff --git a/proto/buf.yaml b/proto/buf.yaml index e2f572573..14a1a0159 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -5,11 +5,11 @@ version: v1 name: buf.build/cheqd/proto deps: - - buf.build/cosmos/cosmos-sdk - - buf.build/cosmos/cosmos-proto - - buf.build/cosmos/gogo-proto + # Update these dependencies when our chain goes to Cosmos SDK v0.47.x + - buf.build/cosmos/cosmos-sdk # Cosmos SDK v0.46.7 + - buf.build/cosmos/cosmos-proto # 29th November 2022 + - buf.build/cosmos/gogo-proto # 29th August 2022 - buf.build/googleapis/googleapis - breaking: use: - FILE @@ -19,6 +19,7 @@ breaking: lint: ignore: + - cosmos - cheqd/did/v1 - cheqd/resource/v1 use: @@ -26,4 +27,3 @@ lint: except: - SERVICE_SUFFIX - RPC_REQUEST_STANDARD_NAME - - RPC_RESPONSE_STANDARD_NAME diff --git a/proto/cheqd/did/v1/did.proto b/proto/cheqd/did/v1/did.proto index a588389ae..367c1cddf 100644 --- a/proto/cheqd/did/v1/did.proto +++ b/proto/cheqd/did/v1/did.proto @@ -9,7 +9,7 @@ option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1"; message Did { repeated string context = 1; // optional string id = 2; - repeated string controller = 3; //optional + repeated string controller = 3; // optional repeated VerificationMethod verification_method = 4; // optional repeated string authentication = 5; // optional repeated string assertion_method = 6; // optional diff --git a/proto/cheqd/did/v2/diddoc.proto b/proto/cheqd/did/v2/diddoc.proto index 0560ac612..830826f7d 100644 --- a/proto/cheqd/did/v2/diddoc.proto +++ b/proto/cheqd/did/v2/diddoc.proto @@ -2,45 +2,137 @@ syntax = "proto3"; package cheqd.did.v2; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + option go_package = "github.com/cheqd/cheqd-node/x/did/types"; +// DidDoc defines a DID Document, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/ message DidDoc { + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 repeated string context = 1; + + // id is the DID of the DID document. + // Format: did:cheqd:: string id = 2; + + // controller is a list of DIDs that are allowed to control the DID document. repeated string controller = 3; + + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. repeated VerificationMethod verification_method = 4; + + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. repeated string authentication = 5; + + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. repeated string assertion_method = 6; + + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. repeated string capability_invocation = 7; + + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. repeated string capability_delegation = 8; + + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. repeated string key_agreement = 9; + + // service is a list of services that can be used to interact with the DID subject. repeated Service service = 10; + + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. repeated string also_known_as = 11; } +// VerificationMethod defines a verification method, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#verification-methods message VerificationMethod { + // id is the unique identifier of the verification method. + // Format: did:cheqd::# string id = 1; - string type = 2; + + // type is the type of the verification method. + // Example: Ed25519VerificationKey2020 + string verification_method_type = 2; + + // controller is the DID of the controller of the verification method. + // Format: did:cheqd:: string controller = 3; + + // verification_material is the public key of the verification method. + // Commonly used verification material types: publicJwk, publicKeyBase58, publicKeyMultibase string verification_material = 4; } +// Service defines a service, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#services message Service { + // id is the unique identifier of the service. + // Format: did:cheqd::# string id = 1; - string type = 2; + + // type is the type of the service. + // Example: LinkedResource + string service_type = 2; + + // serviceEndpoint is the endpoint of the service. + // Example: https://example.com/endpoint repeated string service_endpoint = 3; } +// DidDocWithMetadata defines a DID Document with metadata, as defined in the DID Core specification. +// Contains the DID Document, as well as DID Document metadata. message DidDocWithMetadata { - DidDoc did_doc = 1; - Metadata metadata = 2; + // didDocument is the DID Document. + DidDoc did_doc = 1 [(gogoproto.jsontag) = "didDocument"]; + + // didDocumentMetadata is the DID Document metadata. + Metadata metadata = 2 [(gogoproto.jsontag) = "didDocumentMetadata"]; } +// Metadata defines DID Document metadata, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#did-document-metadata-properties message Metadata { - string created = 1; - string updated = 2; + // created is the timestamp of the creation of the DID Document. + // Format: RFC3339 + // Example: 2021-03-10T15:16:17Z + google.protobuf.Timestamp created = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + + // updated is the timestamp of the last update of the DID Document. + // Format: RFC3339 + // Example: 2021-03-10T15:16:17Z + google.protobuf.Timestamp updated = 2 [ + (gogoproto.nullable) = true, + (gogoproto.stdtime) = true + ]; + + // deactivated is a flag that indicates whether the DID Document is deactivated. + // Default: false bool deactivated = 3; + + // version_id is the version identifier of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 string version_id = 4; - string next_version_id = 5; - string previous_version_id = 6; + + // next_version_id is the version identifier of the next version of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 + string next_version_id = 5 [(gogoproto.nullable) = true]; + + // previous_version_id is the version identifier of the previous version of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 + string previous_version_id = 6 [(gogoproto.nullable) = true]; } diff --git a/proto/cheqd/did/v2/fee.proto b/proto/cheqd/did/v2/fee.proto index 9696b09bd..9cda411c9 100644 --- a/proto/cheqd/did/v2/fee.proto +++ b/proto/cheqd/did/v2/fee.proto @@ -8,12 +8,26 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/cheqd/cheqd-node/x/did/types"; option (gogoproto.equal_all) = true; -// FeeParams defines the parameters for the `did` module fixed fee. +// FeeParams defines the parameters for the cheqd DID module fixed fee message FeeParams { - // Tx types define the fixed fee each for the `did` module. + // Fixed fee for creating a DID + // + // Default: 50 CHEQ or 50000000000ncheq cosmos.base.v1beta1.Coin create_did = 1 [(gogoproto.nullable) = false]; + + // Fixed fee for updating a DID + // + // Default: 25 CHEQ or 25000000000ncheq cosmos.base.v1beta1.Coin update_did = 2 [(gogoproto.nullable) = false]; + + // Fixed fee for deactivating a DID + // + // Default: 10 CHEQ or 10000000000ncheq cosmos.base.v1beta1.Coin deactivate_did = 3 [(gogoproto.nullable) = false]; + + // Percentage of the fixed fee that will be burned + // + // Default: 0.5 (50%) string burn_factor = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", diff --git a/proto/cheqd/did/v2/genesis.proto b/proto/cheqd/did/v2/genesis.proto index 52e39364c..b2a73bfa8 100644 --- a/proto/cheqd/did/v2/genesis.proto +++ b/proto/cheqd/did/v2/genesis.proto @@ -7,13 +7,26 @@ import "cheqd/did/v2/fee.proto"; option go_package = "github.com/cheqd/cheqd-node/x/did/types"; +// DidDocVersionSet contains all versions of DID Documents and their metadata for a given DID. +// The latest version of the DID Document set is stored in the latest_version field. message DidDocVersionSet { + // Latest version of the DID Document set string latest_version = 1; + + // All versions of the DID Document set repeated DidDocWithMetadata did_docs = 2; } +// GenesisState defines the cheqd DID module's genesis state. message GenesisState { + // Namespace for the DID module + // Example: mainnet, testnet, local string did_namespace = 1; + + // All DID Document version sets (contains all versions of all DID Documents) repeated DidDocVersionSet version_sets = 2; + + // Fee parameters for the DID module + // Defines fixed fees and burn percentage for each DID operation type (create, update, delete) FeeParams fee_params = 3; } diff --git a/proto/cheqd/did/v2/query.proto b/proto/cheqd/did/v2/query.proto index 177c85619..f2e54ff9e 100644 --- a/proto/cheqd/did/v2/query.proto +++ b/proto/cheqd/did/v2/query.proto @@ -3,43 +3,100 @@ syntax = "proto3"; package cheqd.did.v2; import "cheqd/did/v2/diddoc.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; import "google/api/annotations.proto"; option go_package = "github.com/cheqd/cheqd-node/x/did/types"; +// Query defines the gRPC querier service for the DID module service Query { - rpc DidDoc(QueryGetDidDocRequest) returns (QueryGetDidDocResponse) { - option (google.api.http).get = "/cheqd/did/v2/{id}"; + // Fetch latest version of a DID Document for a given DID + rpc DidDoc(QueryDidDocRequest) returns (QueryDidDocResponse) { + option (google.api.http) = {get: "/cheqd/did/v2/{id}"}; } - rpc DidDocVersion(QueryGetDidDocVersionRequest) returns (QueryGetDidDocVersionResponse) { - option (google.api.http).get = "/cheqd/did/v2/{id}/version/{version}"; + + // Fetch specific version of a DID Document for a given DID + rpc DidDocVersion(QueryDidDocVersionRequest) returns (QueryDidDocVersionResponse) { + option (google.api.http) = {get: "/cheqd/did/v2/{id}/version/{version}"}; } - rpc AllDidDocVersionsMetadata(QueryGetAllDidDocVersionsMetadataRequest) returns (QueryGetAllDidDocVersionsMetadataResponse) { - option (google.api.http).get = "/cheqd/did/v2/{id}/metadata"; + + // Fetch list of all versions of DID Documents for a given DID + rpc AllDidDocVersionsMetadata(QueryAllDidDocVersionsMetadataRequest) returns (QueryAllDidDocVersionsMetadataResponse) { + option (google.api.http) = {get: "/cheqd/did/v2/{id}/versions"}; } } -message QueryGetDidDocRequest { +// QueryDidDocRequest is the request type for the Query/DidDoc method +message QueryDidDocRequest { + // DID unique identifier of the DID Document to fetch. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j string id = 1; } -message QueryGetDidDocResponse { +// QueryDidDocResponse is the response type for the Query/DidDoc method +message QueryDidDocResponse { + // Successful resolution of the DID Document returns the following: + // - did_doc is the latest version of the DID Document + // - metadata is is the DID Document metadata associated with the latest version of the DID Document DidDocWithMetadata value = 1; } -message QueryGetDidDocVersionRequest { +// QueryDidDocVersionRequest is the request type for the Query/DidDocVersion method +message QueryDidDocVersionRequest { + // DID unique identifier of the DID Document to fetch. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j string id = 1; + + // Unique version identifier of the DID Document to fetch. + // Returns the specified version of the DID Document. + // + // Format: + // + // Example: 93f2573c-eca9-4098-96cb-a1ec676a29ed string version = 2; } -message QueryGetDidDocVersionResponse { +// QueryDidDocVersionResponse is the response type for the Query/DidDocVersion method +message QueryDidDocVersionResponse { + // Successful resolution of the DID Document returns the following: + // - did_doc is the requested version of the DID Document + // - metadata is DID Document metadata associated with the requested version of the DID Document DidDocWithMetadata value = 1; } -message QueryGetAllDidDocVersionsMetadataRequest { +// QueryAllDidDocVersionsMetadataRequest is the request type for the Query/AllDidDocVersionsMetadata method +message QueryAllDidDocVersionsMetadataRequest { + // DID unique identifier of the DID Document to fetch version metadata. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j string id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; } -message QueryGetAllDidDocVersionsMetadataResponse { +// QueryAllDidDocVersionsMetadataResponse is the response type for the Query/AllDidDocVersionsMetadata method +message QueryAllDidDocVersionsMetadataResponse { + // versions is the list of all versions of the requested DID Document repeated Metadata versions = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/proto/cheqd/did/v2/tx.proto b/proto/cheqd/did/v2/tx.proto index aa1eb46df..bd68b7042 100644 --- a/proto/cheqd/did/v2/tx.proto +++ b/proto/cheqd/did/v2/tx.proto @@ -6,75 +6,205 @@ import "cheqd/did/v2/diddoc.proto"; option go_package = "github.com/cheqd/cheqd-node/x/did/types"; +// Msg defines the Cosmos SDK Msg service for the cheqd.did.v2 module. service Msg { + // CreateDidDoc defines a method for creating a new DID document rpc CreateDidDoc(MsgCreateDidDoc) returns (MsgCreateDidDocResponse); + + // UpdateDidDoc defines a method for updating an existing DID document rpc UpdateDidDoc(MsgUpdateDidDoc) returns (MsgUpdateDidDocResponse); + + // DeactivateDidDoc defines a method for deactivating an existing DID document rpc DeactivateDidDoc(MsgDeactivateDidDoc) returns (MsgDeactivateDidDocResponse); } +// MsgCreateDidDoc defines the Msg/CreateDidDoc request type. +// It describes the parameters of a request for creating a new DID document. message MsgCreateDidDoc { + // Payload containing the DID Document to be created MsgCreateDidDocPayload payload = 1; + + // Signatures of the DID Document's controller(s) repeated SignInfo signatures = 2; } +// MsgUpdateDidDoc defines the Msg/UpdateDidDoc request type. +// It describes the parameters of a request for updating an existing DID document. message MsgUpdateDidDoc { + // Payload containing the DID Document to be updated. This should be updated the DID Document. MsgUpdateDidDocPayload payload = 1; + + // Signatures of the DID Document's controller(s) repeated SignInfo signatures = 2; } +// MsgDeactivateDidDoc defines the Msg/DeactivateDidDoc request type. +// It describes the parameters of a request for deactivating an existing DID document. message MsgDeactivateDidDoc { + // Payload containing the DID Document to be deactivated MsgDeactivateDidDocPayload payload = 1; + + // Signatures of the DID Document's controller(s) repeated SignInfo signatures = 2; } +// SignInfo defines the structure of a DID Document controller's signature message SignInfo { + // Verification method ID of the DID Controller string verification_method_id = 1; + + // Signature of the DID Document controller bytes signature = 2; } +// MsgCreateDidDocPayload defines the structure of the payload for creating a new DID document message MsgCreateDidDocPayload { + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 repeated string context = 1; + + // id is the DID of the DID document. + // Format: did:cheqd:: string id = 2; + + // controller is a list of DIDs that are allowed to control the DID document. repeated string controller = 3; + + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. + // Documentation: https://www.w3.org/TR/did-core/#verification-methods + // + // Required fields: + // - id: A unique identifier for the verification method + // - type: A supported verification method type (supported: Ed25519VerificationKey2018, Ed25519VerificationKey2020, JsonWebKey2020) + // - controller: DID of the controller of the verification method + // - verification_material: Public key of the verification method (supported: publicJwk, publicKeyBase58, publicKeyMultibase) repeated VerificationMethod verification_method = 4; + + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. repeated string authentication = 5; + + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. repeated string assertion_method = 6; + + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. repeated string capability_invocation = 7; + + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. repeated string capability_delegation = 8; + + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. repeated string key_agreement = 9; - repeated string also_known_as = 10; - repeated Service service = 11; + + // service is a list of services that can be used to interact with the DID subject. + // Documentation: https://www.w3.org/TR/did-core/#services + // + // Required fields: + // - id: A unique identifier for the service + // - type: A service type defined in DID Specification Registries + // - service_endpoint: Service endpoint(s), provided as a URI or set of URIs + repeated Service service = 10; + + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. + repeated string also_known_as = 11; + + // Version ID of the DID Document to be created + // + // Format: string version_id = 12; } +// MsgCreateDidDocResponse defines response type for Msg/CreateDidDoc. message MsgCreateDidDocResponse { + // Return the created DID Document with metadata DidDocWithMetadata value = 1; } +// MsgUpdateDidDocPayload defines the structure of the payload for updating an existing DID document message MsgUpdateDidDocPayload { + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 repeated string context = 1; + + // id is the DID of the DID document. + // Format: did:cheqd:: string id = 2; + + // controller is a list of DIDs that are allowed to control the DID document. repeated string controller = 3; + + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. + // Documentation: https://www.w3.org/TR/did-core/#verification-methods + // + // Required fields: + // - id: A unique identifier for the verification method + // - type: A supported verification method type (supported: Ed25519VerificationKey2018, Ed25519VerificationKey2020, JsonWebKey2020) + // - controller: DID of the controller of the verification method + // - verification_material: Public key of the verification method (supported: publicJwk, publicKeyBase58, publicKeyMultibase) repeated VerificationMethod verification_method = 4; + + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. repeated string authentication = 5; + + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. repeated string assertion_method = 6; + + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. repeated string capability_invocation = 7; + + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. repeated string capability_delegation = 8; + + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. repeated string key_agreement = 9; - repeated string also_known_as = 10; - repeated Service service = 11; + + // service is a list of services that can be used to interact with the DID subject. + // Documentation: https://www.w3.org/TR/did-core/#services + // + // Required fields: + // - id: A unique identifier for the service + // - type: A service type defined in DID Specification Registries + // - service_endpoint: Service endpoint(s), provided as a URI or set of URIs + repeated Service service = 10; + + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. + repeated string also_known_as = 11; + + // Updated version ID of the DID Document. + // Links to next/previous versions of the DID Document will be automatically updated. + // + // Format: string version_id = 12; } message MsgUpdateDidDocResponse { + // Return the updated DID Document with metadata DidDocWithMetadata value = 1; } +// MsgDeactivateDidDocPayload defines the structure of the payload for deactivating an existing DID document message MsgDeactivateDidDocPayload { + // Unique identifier of the DID Document to be deactivated string id = 1; + + // Version ID of the DID Document to be deactivated + // This is primarily used as a sanity check to ensure that the correct DID Document is being deactivated. string version_id = 2; } +// MsgDeactivateDidDocResponse defines response type for Msg/DeactivateDidDoc. message MsgDeactivateDidDocResponse { + // Return the deactivated DID Document with metadata DidDocWithMetadata value = 1; } diff --git a/proto/cheqd/resource/v1/query.proto b/proto/cheqd/resource/v1/query.proto index fd8274750..7aa732f0a 100644 --- a/proto/cheqd/resource/v1/query.proto +++ b/proto/cheqd/resource/v1/query.proto @@ -8,10 +8,10 @@ option go_package = "github.com/cheqd/cheqd-node/x/resource/types/v1"; // Query defines the gRPC querier service. service Query { - rpc Resource(QueryGetResourceRequest) returns (QueryGetResourceResponse) { + rpc Resource(QueryGetResourceRequest) returns (QueryResourceResponse) { option (google.api.http).get = "/1.0/identifiers/{collection_id}/resources/{id}"; } - rpc CollectionResources(QueryGetCollectionResourcesRequest) returns (QueryGetCollectionResourcesResponse) { + rpc CollectionResources(QueryGetCollectionResourcesRequest) returns (QueryCollectionResourcesResponse) { option (google.api.http).get = "/1.0/identifiers/{collection_id}/resources/all"; } rpc AllResourceVersions(QueryGetAllResourceVersionsRequest) returns (QueryGetAllResourceVersionsResponse) { @@ -24,7 +24,7 @@ message QueryGetResourceRequest { string id = 2; } -message QueryGetResourceResponse { +message QueryResourceResponse { Resource resource = 1; } @@ -32,7 +32,7 @@ message QueryGetCollectionResourcesRequest { string collection_id = 1; } -message QueryGetCollectionResourcesResponse { +message QueryCollectionResourcesResponse { repeated ResourceHeader resources = 1; } diff --git a/proto/cheqd/resource/v2/fee.proto b/proto/cheqd/resource/v2/fee.proto index 500324ade..edb87dcee 100644 --- a/proto/cheqd/resource/v2/fee.proto +++ b/proto/cheqd/resource/v2/fee.proto @@ -8,12 +8,27 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/cheqd/cheqd-node/x/resource/types"; option (gogoproto.equal_all) = true; -// FeeParams defines the parameters for the `resource` module fixed fee. +// FeeParams defines the parameters for the cheqd Resource module fixed fee. +// Creation requests for different IANA media types are charged different fees. message FeeParams { - // Media types define the fixed fee each for the `resource` module. + // Fixed fee for creating a resource with media type 'image/*' + // + // Default: 10 CHEQ or 10000000000ncheq cosmos.base.v1beta1.Coin image = 1 [(gogoproto.nullable) = false]; + + // Fixed fee for creating a resource with media type 'application/json' + // + // Default: 2.5 CHEQ or 2500000000ncheq cosmos.base.v1beta1.Coin json = 2 [(gogoproto.nullable) = false]; + + // Fixed fee for creating a resource with all other media types + // + // Default: 5 CHEQ or 5000000000ncheq cosmos.base.v1beta1.Coin default = 3 [(gogoproto.nullable) = false]; + + // Percentage of the fixed fee that will be burned + // + // Default: 0.5 (50%) string burn_factor = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", diff --git a/proto/cheqd/resource/v2/genesis.proto b/proto/cheqd/resource/v2/genesis.proto index 434e7f7e6..d1d619e36 100644 --- a/proto/cheqd/resource/v2/genesis.proto +++ b/proto/cheqd/resource/v2/genesis.proto @@ -7,7 +7,12 @@ import "cheqd/resource/v2/resource.proto"; option go_package = "github.com/cheqd/cheqd-node/x/resource/types"; +// GenesisState defines the chqed Resource module's genesis state message GenesisState { + // All Resources with metadata repeated ResourceWithMetadata resources = 1; + + // Fee parameters for the Resource module + // Defines fixed fees and burn percentage for resources FeeParams fee_params = 2; } diff --git a/proto/cheqd/resource/v2/query.proto b/proto/cheqd/resource/v2/query.proto index abdbb667c..b216cf233 100644 --- a/proto/cheqd/resource/v2/query.proto +++ b/proto/cheqd/resource/v2/query.proto @@ -7,40 +7,81 @@ import "google/api/annotations.proto"; option go_package = "github.com/cheqd/cheqd-node/x/resource/types"; +// Query defines the gRPC querier service for the resource module service Query { - rpc Resource(QueryGetResourceRequest) returns (QueryGetResourceResponse) { + // Fetch a resource from a collection with a given collection_id and id + rpc Resource(QueryResourceRequest) returns (QueryResourceResponse) { option (google.api.http).get = "/cheqd/resource/v2/{collection_id}/resources/{id}"; } - rpc ResourceMetadata(QueryGetResourceMetadataRequest) returns (QueryGetResourceMetadataResponse) { + + // Fetch a resource's metadata from a collection with a given collection_id and id + rpc ResourceMetadata(QueryResourceMetadataRequest) returns (QueryResourceMetadataResponse) { option (google.api.http).get = "/cheqd/resource/v2/{collection_id}/resources/{id}/metadata"; } - rpc CollectionResources(QueryGetCollectionResourcesRequest) returns (QueryGetCollectionResourcesResponse) { + + // Fetch all resource metadata from a collection with a given collection_id + rpc CollectionResources(QueryCollectionResourcesRequest) returns (QueryCollectionResourcesResponse) { option (google.api.http).get = "/cheqd/resource/v2/{collection_id}/metadata"; } } -message QueryGetResourceRequest { +// QueryResourceRequest is the request type for the Query/Resource RPC method +message QueryResourceRequest { + // collection_id is an identifier of the DidDocument the resource belongs to. + // Format: + // + // Examples: + // - c82f2b02-bdab-4dd7-b833-3e143745d612 + // - wGHEXrZvJxR8vw5P3UWH1j string collection_id = 1; + + // id is a unique id of the resource. + // Format: string id = 2; } -message QueryGetResourceResponse { +// QueryResourceResponse is the response type for the Query/Resource RPC method +message QueryResourceResponse { + // Successful resolution of the resource returns the following: + // - resource is the requested resource + // - metadata is the resource metadata associated with the requested resource ResourceWithMetadata resource = 1; } -message QueryGetResourceMetadataRequest { +// QueryResourceMetadataRequest is the request type for the Query/ResourceMetadata RPC method +message QueryResourceMetadataRequest { + // collection_id is an identifier of the DidDocument the resource belongs to. + // Format: + // + // Examples: + // - c82f2b02-bdab-4dd7-b833-3e143745d612 + // - wGHEXrZvJxR8vw5P3UWH1j string collection_id = 1; + + // id is a unique id of the resource. + // Format: string id = 2; } -message QueryGetResourceMetadataResponse { +// QueryResourceMetadataResponse is the response type for the Query/ResourceMetadata RPC method +message QueryResourceMetadataResponse { + // resource is the requested resource metadata Metadata resource = 1; } -message QueryGetCollectionResourcesRequest { +// QueryCollectionResourcesRequest is the request type for the Query/CollectionResources RPC method +message QueryCollectionResourcesRequest { + // collection_id is an identifier of the DidDocument the resource belongs to. + // Format: + // + // Examples: + // - c82f2b02-bdab-4dd7-b833-3e143745d612 + // - wGHEXrZvJxR8vw5P3UWH1j string collection_id = 1; } -message QueryGetCollectionResourcesResponse { +// QueryCollectionResourcesResponse is the response type for the Query/CollectionResources RPC method +message QueryCollectionResourcesResponse { + // resources is the requested collection of resource metadata repeated Metadata resources = 1; } diff --git a/proto/cheqd/resource/v2/resource.proto b/proto/cheqd/resource/v2/resource.proto index 60e756327..e78a90f88 100644 --- a/proto/cheqd/resource/v2/resource.proto +++ b/proto/cheqd/resource/v2/resource.proto @@ -2,33 +2,95 @@ syntax = "proto3"; package cheqd.resource.v2; -option go_package = "github.com/cheqd/cheqd-node/x/resource/types"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; -message Resource { - bytes data = 1; -} +option go_package = "github.com/cheqd/cheqd-node/x/resource/types"; +// ResourceWithMetadata describes the overall structure of a DID-Linked Resource message ResourceWithMetadata { Resource resource = 1; Metadata metadata = 2; } -message AlternativeUri { - string uri = 1; - string description = 2; +// Resource stores the contents of a DID-Linked Resource +message Resource { + // bytes is the raw data of the Resource + bytes data = 1; } +// Metadata stores the metadata of a DID-Linked Resource message Metadata { + // collection_id is the ID of the collection that the Resource belongs to. Defined client-side. + // This field is the unique identifier of the DID linked to this Resource string collection_id = 1; + + // id is the ID of the Resource. Defined client-side. + // This field is a unique identifier for this specific version of the Resource. + // Format: string id = 2; + + // name is a human-readable name for the Resource. Defined client-side. + // Does not change between different versions. + // Example: PassportSchema, EducationTrustRegistry string name = 3; + + // version is a human-readable semantic version for the Resource. Defined client-side. + // Stored as a string. OPTIONAL. + // Example: 1.0.0, v2.1.0 string version = 4; + + // resource_type is a Resource type that identifies what the Resource is. Defined client-side. + // This is NOT the same as the resource's media type. + // Example: AnonCredsSchema, StatusList2021 string resource_type = 5; - repeated AlternativeUri also_known_as = 6; + // List of alternative URIs for the SAME Resource. + repeated AlternativeUri also_known_as = 6 [(gogoproto.nullable) = true]; + + // media_type is IANA media type of the Resource. Defined ledger-side. + // Example: application/json, image/png string media_type = 7; - string created = 8; + + // created is the time at which the Resource was created. Defined ledger-side. + // Format: RFC3339 + // Example: 2021-01-01T00:00:00Z + google.protobuf.Timestamp created = 8 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + + // checksum is a SHA-256 checksum hash of the Resource. Defined ledger-side. + // Example: d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f string checksum = 9; - string previous_version_id = 10; - string next_version_id = 11; + + // previous_version_id is the ID of the previous version of the Resource. Defined ledger-side. + // This is based on the Resource's name and Resource type to determine whether it's the same Resource. + // Format: + string previous_version_id = 10 [(gogoproto.nullable) = true]; + + // next_version_id is the ID of the next version of the Resource. Defined ledger-side. + // This is based on the Resource's name and Resource type to determine whether it's the same Resource. + // Format: + string next_version_id = 11 [(gogoproto.nullable) = true]; +} + +// AlternativeUri are alternative URIs that can be used to access the Resource. +// By default, at least the DID URI equivalent of the Resource is populated. +message AlternativeUri { + // uri is the URI of the Resource. + // Examples: + // - did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + // - https://resolver..cheqd.net/1.0/identifiers/did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + // - https://example.com/example.json + // - https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + // - ipfs://bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + string uri = 1; + + // description is a human-readable description of the URI. Defined client-side. + // Examples: + // - did-uri + // - http-uri + // - ipfs-uri + string description = 2; } diff --git a/proto/cheqd/resource/v2/tx.proto b/proto/cheqd/resource/v2/tx.proto index fa0c6cf93..b5de043ae 100644 --- a/proto/cheqd/resource/v2/tx.proto +++ b/proto/cheqd/resource/v2/tx.proto @@ -7,26 +7,75 @@ import "cheqd/resource/v2/resource.proto"; option go_package = "github.com/cheqd/cheqd-node/x/resource/types"; -// Msg defines the Msg service. +// Msg defines the Cosmos SDK Msg service for the cheqd.resource.v2 module. service Msg { + // CreateResource defines a method for creating a resource. rpc CreateResource(MsgCreateResource) returns (MsgCreateResourceResponse); } +// MsgCreateResource defines the Msg/CreateResource request type. +// It describes the parameters of a request for creating a resource. message MsgCreateResource { + // Payload containing the resource to be created. MsgCreateResourcePayload payload = 1; + + // Signatures of the corresponding DID Document's controller(s). repeated cheqd.did.v2.SignInfo signatures = 2; } +// MsgCreateResourcePayload defines the structure of the payload for creating a resource. +// +// If a resource with the given id does not exist already, +// it will be created. The resource will be created in the resource collection. +// +// If a resource with the given id, collection_id already exists, an error code 2200 will be returned. +// +// A new version of the resource in an existing collection will be created, +// if a resource in that collection with the same name, resource_type and empty next_version_id exists. +// +// An update operation is not possible, because the resource is immutable by design. message MsgCreateResourcePayload { + // data is a byte-representation of the actual Data the user wants to store. bytes data = 1; + + // collection_id is an identifier of the DidDocument the resource belongs to. + // Format: + // + // Examples: + // - c82f2b02-bdab-4dd7-b833-3e143745d612 + // - wGHEXrZvJxR8vw5P3UWH1j string collection_id = 2; + + // id is a unique id of the resource. + // Format: string id = 3; + + // name is a human-readable name of the resource. + // Format: + // + // Does not change between different versions. + // Example: PassportSchema, EducationTrustRegistry string name = 4; + + // version is a version of the resource. + // Format: + // Stored as a string. OPTIONAL. + // + // Example: 1.0.0, v2.1.0 string version = 5; + + // resource_type is a type of the resource. + // Format: + // + // This is NOT the same as the resource's media type. + // Example: AnonCredsSchema, StatusList2021 string resource_type = 6; + + // also_known_as is a list of URIs that can be used to get the resource. repeated cheqd.resource.v2.AlternativeUri also_known_as = 7; } message MsgCreateResourceResponse { + // Return the created resource metadata. Metadata resource = 1; } diff --git a/scripts/protocgen2.sh b/scripts/protoc-pulsar-gen.sh similarity index 61% rename from scripts/protocgen2.sh rename to scripts/protoc-pulsar-gen.sh index 1140071da..2393f6a29 100755 --- a/scripts/protocgen2.sh +++ b/scripts/protoc-pulsar-gen.sh @@ -13,5 +13,16 @@ protoc_gen_install() { protoc_gen_install echo "Generating API module" + +# Remove old generated API/Pulsar files (cd api; find ./ -type f \( -iname \*.pulsar.go -o -iname \*.pb.go -o -iname \*.cosmos_orm.go -o -iname \*.pb.gw.go \) -delete; find . -empty -type d -delete; cd ..) -(cd proto; buf generate --template buf.gen.pulsar.yaml) \ No newline at end of file +cd proto + +# Find all proto files but exclude "v1" paths +proto_dirs=$(find ./ -type f -path '*/v1/*' -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +for proto_dir in $proto_dirs; do + proto_files=$(find "${proto_dir}" -maxdepth 1 -name '*.proto') + for f in $proto_files; do + buf generate --template buf.gen.pulsar.yaml "$f" + done +done diff --git a/scripts/protoc-swagger-gen.sh b/scripts/protoc-swagger-gen.sh new file mode 100755 index 000000000..601219223 --- /dev/null +++ b/scripts/protoc-swagger-gen.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +set -euox pipefail + +# Define directories +SWAGGER_DIR=./api/docs +SWAGGER_UI_DIR=${SWAGGER_DIR}/swagger-ui + +# Define URLs +SWAGGER_UI_VERSION=4.15.5 +SWAGGER_UI_DOWNLOAD_URL=https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${SWAGGER_UI_VERSION}.zip +SWAGGER_UI_PACKAGE_NAME=${SWAGGER_DIR}/swagger-ui-${SWAGGER_UI_VERSION} + +cd ./proto + +# Find all proto files but exclude "v1" paths +proto_dirs=$(find ./cheqd -type f -path '*/v1/*' -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) + +# loop through proto directories +for dir in $proto_dirs; do + # generate swagger files (filter query files) + query_file=$(find "${dir}" -maxdepth 1 \( -name 'query.proto' \)) + if [[ -n "$query_file" ]]; then + buf generate --template buf.gen.swagger.yaml "$query_file" + fi +done + +cd .. + +# combine swagger files +# uses nodejs package `swagger-combine`. +# all the individual swagger files need to be configured in `config.yaml` for merging +swagger-combine ${SWAGGER_DIR}/config.json -o ${SWAGGER_DIR}/swagger.yaml -f yaml --continueOnConflictingPaths true + +# Remove individual swagger files +rm -rf ${SWAGGER_DIR}/cheqd + +# if swagger-ui does not exist locally, download swagger-ui and move dist directory to +# swagger-ui directory, then remove zip file and unzipped swagger-ui directory +if [ ! -d "${SWAGGER_UI_DIR}" ]; then + # download swagger-ui + wget -O ${SWAGGER_UI_PACKAGE_NAME}.zip ${SWAGGER_UI_DOWNLOAD_URL} + # unzip swagger-ui package + unzip ${SWAGGER_UI_PACKAGE_NAME}.zip -d ${SWAGGER_DIR} + # move swagger-ui dist directory to swagger-ui directory + mv ${SWAGGER_UI_PACKAGE_NAME}/dist ${SWAGGER_UI_DIR} + # remove swagger-ui zip file and unzipped swagger-ui directory + rm -rf ${SWAGGER_UI_PACKAGE_NAME}.zip ${SWAGGER_UI_PACKAGE_NAME} +fi + +# Copy generated swagger yaml file to swagger-ui directory +cp ${SWAGGER_DIR}/swagger.yaml ${SWAGGER_DIR}/swagger-ui/ + +# update swagger initializer to default to swagger.yaml +# Note: using -i.bak makes this compatible with both GNU and BSD/Mac +sed -i.bak "s|https://petstore.swagger.io/v2/swagger.json|swagger.yaml|" ${SWAGGER_UI_DIR}/swagger-initializer.js + +# install statik +go install github.com/rakyll/statik@latest + +# generate statik golang code using updated swagger-ui directory +statik -src=${SWAGGER_DIR}/swagger-ui -dest=${SWAGGER_DIR} -f -m + +# log whether or not the swagger directory was updated +if [ -n "$(git status ${SWAGGER_DIR} --porcelain)" ]; then + echo "Swagger statik file updated" +else + echo "Swagger statik file already in sync" +fi diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh old mode 100644 new mode 100755 index 106f80618..01128ad9e --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -7,7 +7,9 @@ go get github.com/cosmos/gogoproto 2>/dev/null echo "Generating gogo proto code" cd proto -proto_dirs=$(find ./ -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) + +# Find all proto files but exclude "v1" paths +proto_dirs=$(find ./ -type f -path '*/v1/*' -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) for proto_dir in $proto_dirs; do proto_files=$(find "${proto_dir}" -maxdepth 1 -name '*.proto') for f in $proto_files; do @@ -25,4 +27,8 @@ rm -rf github.com go mod tidy -# ./scripts/protocgen2.sh +sh ./scripts/protoc-pulsar-gen.sh + +# go mod tidy in API folder +cd api +go mod tidy diff --git a/scripts/state-sync.sh b/scripts/state-sync.sh old mode 100644 new mode 100755 diff --git a/simapp/app.go b/simapp/app.go index 46ee6246c..17ca8bdcc 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -94,7 +94,7 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" // ibc - ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper" + ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper" // cheqd specific imports cheqdapp "github.com/cheqd/cheqd-node/app" diff --git a/tests/legacy/ibc-defi/README.md b/tests/ibc-defi/README.md similarity index 100% rename from tests/legacy/ibc-defi/README.md rename to tests/ibc-defi/README.md diff --git a/tests/legacy/ibc-defi/cheqd/cheqd-init.sh b/tests/ibc-defi/cheqd/cheqd-init.sh similarity index 50% rename from tests/legacy/ibc-defi/cheqd/cheqd-init.sh rename to tests/ibc-defi/cheqd/cheqd-init.sh index 68cce5ec8..17e2b53f9 100755 --- a/tests/legacy/ibc-defi/cheqd/cheqd-init.sh +++ b/tests/ibc-defi/cheqd/cheqd-init.sh @@ -1,31 +1,33 @@ #!/bin/bash +# shellcheck disable=SC2086 set -euox pipefail -# sed in macos requires extra argument - -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - sed_extension='' -elif [[ "$OSTYPE" == "darwin"* ]]; then - sed_extension='.orig' +# sed in MacOS requires extra argument +if [[ "$OSTYPE" == "darwin"* ]]; then + SED_EXT='.orig' +else + SED_EXT='' fi CHAIN_ID="cheqd" # Node -cheqd-noded init node0 --chain-id $CHAIN_ID +cheqd-noded init node0 --chain-id "$CHAIN_ID" NODE_0_VAL_PUBKEY=$(cheqd-noded tendermint show-validator) # User cheqd-noded keys add cheqd-user --keyring-backend test # Config -sed -i $sed_extension 's|minimum-gas-prices = ""|minimum-gas-prices = "25ncheq"|g' "$HOME/.cheqdnode/config/app.toml" -sed -i $sed_extension 's|laddr = "tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|g' "$HOME/.cheqdnode/config/config.toml" +sed -i $SED_EXT 's|minimum-gas-prices = ""|minimum-gas-prices = "50ncheq"|g' "$HOME/.cheqdnode/config/app.toml" + +# shellcheck disable=SC2086 +sed -i $SED_EXT 's|laddr = "tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|g' "$HOME/.cheqdnode/config/config.toml" # Genesis GENESIS="$HOME/.cheqdnode/config/genesis.json" -sed -i $sed_extension 's/"stake"/"ncheq"/' "$GENESIS" +sed -i $SED_EXT 's/"stake"/"ncheq"/' "$GENESIS" cheqd-noded add-genesis-account cheqd-user 1000000000000000000ncheq --keyring-backend test cheqd-noded gentx cheqd-user 10000000000000000ncheq --chain-id $CHAIN_ID --pubkey "$NODE_0_VAL_PUBKEY" --keyring-backend test diff --git a/tests/legacy/ibc-defi/docker-compose.yaml b/tests/ibc-defi/docker-compose.yaml similarity index 68% rename from tests/legacy/ibc-defi/docker-compose.yaml rename to tests/ibc-defi/docker-compose.yaml index bc1808be8..e2783d54a 100644 --- a/tests/legacy/ibc-defi/docker-compose.yaml +++ b/tests/ibc-defi/docker-compose.yaml @@ -2,11 +2,10 @@ version: '3.7' services: cheqd: - image: cheqd + image: cheqd/cheqd-node:build-latest build: - context: ../../.. + context: ../../ dockerfile: docker/Dockerfile - target: base ports: - "26656:26656" # p2p - "26657:26657" # rpc @@ -15,10 +14,7 @@ services: entrypoint: tail -f /dev/null osmosis: - image: osmosis - build: - context: osmosis - dockerfile: osmosis.Dockerfile + image: osmolabs/osmosis:13-alpine ports: - "26666:26656" # p2p - "26667:26657" # rpc @@ -27,13 +23,10 @@ services: entrypoint: tail -f /dev/null hermes: - image: hermes - build: - context: ./hermes - dockerfile: hermes.Dockerfile + image: informalsystems/hermes:1.2.0 configs: - source: hermes-config - target: /hermes/.hermes/config.toml + target: /home/hermes/.hermes/config.toml ports: - "3000:3000" # rest - "3001:3001" # telemetry diff --git a/tests/legacy/ibc-defi/hermes/config.toml b/tests/ibc-defi/hermes/config.toml similarity index 90% rename from tests/legacy/ibc-defi/hermes/config.toml rename to tests/ibc-defi/hermes/config.toml index 4a0f513ed..e6ddcadcc 100644 --- a/tests/legacy/ibc-defi/hermes/config.toml +++ b/tests/ibc-defi/hermes/config.toml @@ -2,7 +2,7 @@ # client_id, connection_id, channel_id and port_id [global] -log_level = 'info' +log_level = 'debug' [mode] @@ -45,8 +45,8 @@ address_type = { derivation = 'cosmos' } store_prefix = 'ibc' default_gas = 100000 max_gas = 2000000 -gas_price = { price = 25, denom = 'ncheq' } -gas_adjustment = 0.1 +gas_price = { price = 50, denom = 'ncheq' } +gas_multiplier = 1.3 max_msg_num = 30 max_tx_size = 2097152 clock_drift = '5s' @@ -65,8 +65,8 @@ key_name = 'osmosis-key' store_prefix = 'ibc' default_gas = 100000 max_gas = 400000 -gas_price = { price = 0, denom = 'stake' } -gas_adjustment = 0.1 +gas_price = { price = 0, denom = 'uosmo' } +gas_multiplier = 1.3 max_msg_num = 30 max_tx_size = 2097152 clock_drift = '5s' diff --git a/tests/legacy/ibc-defi/ibc-transfer-test.sh b/tests/ibc-defi/ibc-transfer-test.sh similarity index 51% rename from tests/legacy/ibc-defi/ibc-transfer-test.sh rename to tests/ibc-defi/ibc-transfer-test.sh index c006c08ec..8ebe739b8 100755 --- a/tests/legacy/ibc-defi/ibc-transfer-test.sh +++ b/tests/ibc-defi/ibc-transfer-test.sh @@ -43,97 +43,114 @@ function assert_network_running() { info "Cleanup" -docker-compose down --volumes --remove-orphans +docker compose down --volumes --remove-orphans info "Running cheqd network" -docker-compose up -d cheqd -docker-compose cp cheqd/cheqd-init.sh cheqd:/home/cheqd/cheqd-init.sh -docker-compose exec cheqd bash /home/cheqd/cheqd-init.sh -docker-compose exec -d cheqd cheqd-noded start +docker compose up -d cheqd +docker compose cp cheqd/cheqd-init.sh cheqd:/home/cheqd/cheqd-init.sh +docker compose exec cheqd bash /home/cheqd/cheqd-init.sh +docker compose exec -d cheqd cheqd-noded start info "Running osmosis network" -docker-compose up -d osmosis -docker-compose cp osmosis/osmosis_init.sh osmosis:/home/osmosis/osmosis_init.sh -docker-compose exec osmosis bash /home/osmosis/osmosis_init.sh -docker-compose exec -d osmosis osmosisd start +docker compose up -d osmosis +docker compose cp osmosis/osmosis-init.sh osmosis:/home/osmosis/osmosis-init.sh +docker compose exec osmosis bash /home/osmosis/osmosis-init.sh +docker compose exec -d osmosis osmosisd start info "Waiting for chains" # TODO: Get rid of this -sleep 10 +sleep 20 info "Checking statuses" -CHEQD_STATUS=$(docker-compose exec cheqd cheqd-noded status 2>&1) +CHEQD_STATUS=$(docker compose exec cheqd cheqd-noded status 2>&1) assert_network_running "${CHEQD_STATUS}" -OSMOSIS_STATUS=$(docker-compose exec osmosis osmosisd status 2>&1) +OSMOSIS_STATUS=$(docker compose exec osmosis osmosisd status 2>&1) assert_network_running "${OSMOSIS_STATUS}" info "Create relayer user on cheqd" # --- CHEQD_RELAYER_KEY_NAME="cheqd-relayer" -CHEQD_RELAYER_ACCOUNT=$(docker-compose exec cheqd cheqd-noded keys add ${CHEQD_RELAYER_KEY_NAME} --keyring-backend test --output json 2>&1) +CHEQD_RELAYER_ACCOUNT=$(docker compose exec cheqd cheqd-noded keys add ${CHEQD_RELAYER_KEY_NAME} --keyring-backend test --output json 2>&1) CHEQD_RELAYER_ADDRESS=$(echo "${CHEQD_RELAYER_ACCOUNT}" | jq --raw-output '.address') CHEQD_RELAYER_MNEMONIC=$(echo "${CHEQD_RELAYER_ACCOUNT}" | jq --raw-output '.mnemonic') +echo "${CHEQD_RELAYER_MNEMONIC}" > cheqd_relayer_mnemonic.txt + info "Send some tokens to it" # --- -RES=$(docker-compose exec cheqd cheqd-noded tx bank send cheqd-user "${CHEQD_RELAYER_ADDRESS}" 1000000000000ncheq --gas-prices 25ncheq --chain-id cheqd -y --keyring-backend test) +RES=$(docker compose exec cheqd cheqd-noded tx bank send cheqd-user "${CHEQD_RELAYER_ADDRESS}" 1000000000000ncheq --gas-prices 50ncheq --chain-id cheqd -y --keyring-backend test) assert_tx_successful "${RES}" info "Create relayer user on osmosis" # --- OSMOSIS_RELAYER_KEY_NAME="osmosis-relayer" -OSMOSIS_RELAYER_ACCOUNT=$(docker-compose exec osmosis osmosisd keys add ${OSMOSIS_RELAYER_KEY_NAME} --output json --keyring-backend test 2>&1) +OSMOSIS_RELAYER_ACCOUNT=$(docker compose exec osmosis osmosisd keys add ${OSMOSIS_RELAYER_KEY_NAME} --output json --keyring-backend test 2>&1) OSMOSIS_RELAYER_ADDRESS=$(echo "${OSMOSIS_RELAYER_ACCOUNT}" | jq --raw-output '.address') OSMOSIS_RELAYER_MNEMONIC=$(echo "${OSMOSIS_RELAYER_ACCOUNT}" | jq --raw-output '.mnemonic') +echo "${OSMOSIS_RELAYER_MNEMONIC}" > osmo_relayer_mnemonic.txt + info "Send some tokens to it" # --- -RES=$(docker-compose exec osmosis osmosisd tx bank send osmosis-user "${OSMOSIS_RELAYER_ADDRESS}" 1000stake --chain-id osmosis -y --keyring-backend test --output json) +RES=$(docker compose exec osmosis osmosisd tx bank send osmosis-user "${OSMOSIS_RELAYER_ADDRESS}" 10000000uosmo --chain-id osmosis -y --keyring-backend test --output json) assert_tx_successful "${RES}" sleep 10 # Wait for state info "Import accounts in hermes" # --- -docker-compose up -d hermes -docker-compose exec hermes hermes keys restore cheqd --mnemonic "$CHEQD_RELAYER_MNEMONIC" --name cheqd-key -docker-compose exec hermes hermes keys restore osmosis --mnemonic "$OSMOSIS_RELAYER_MNEMONIC" --name osmosis-key +docker compose up -d hermes + +# Create dirs for keys +docker compose exec --user root hermes mkdir -p /home/hermes/.hermes/keys/cheqd/keyring-test +docker compose exec --user root hermes mkdir -p /home/hermes/.hermes/keys/osmosis/keyring-test + +# Hand over ownership to hermes user +docker compose exec --user root hermes chown -R hermes:hermes /home/hermes/.hermes/keys + +# Copy keys +docker compose cp cheqd_relayer_mnemonic.txt hermes:/home/hermes +docker compose cp osmo_relayer_mnemonic.txt hermes:/home/hermes + +# Import keys +docker compose exec hermes hermes keys add --chain cheqd --mnemonic-file cheqd_relayer_mnemonic.txt --key-name cheqd-key +docker compose exec hermes hermes keys add --chain osmosis --mnemonic-file osmo_relayer_mnemonic.txt --key-name osmosis-key info "Open channel" # --- -docker-compose exec hermes hermes create channel cheqd --chain-b osmosis --port-a transfer --port-b transfer --new-client-connection +docker compose exec hermes hermes create channel --a-chain cheqd --b-chain osmosis --a-port transfer --b-port transfer --new-client-connection info "Start hermes" # --- -docker-compose exec -d hermes hermes start +docker compose exec -d hermes hermes start -info "Check balances" # --- -CHEQD_USER_ADDRESS=$(docker-compose exec cheqd cheqd-noded keys show --address cheqd-user --keyring-backend test | sed 's/\r//g') -OSMOSIS_USER_ADDRESS=$(docker-compose exec osmosis osmosisd keys show --address osmosis-user --keyring-backend test | sed 's/\r//g') +info "Get balances" # --- +CHEQD_USER_ADDRESS=$(docker compose exec cheqd cheqd-noded keys show --address cheqd-user --keyring-backend test | sed 's/\r//g') +OSMOSIS_USER_ADDRESS=$(docker compose exec osmosis osmosisd keys show --address osmosis-user --keyring-backend test | sed 's/\r//g') -CHEQD_BALANCE_1=$(docker-compose exec cheqd cheqd-noded query bank balances "$CHEQD_USER_ADDRESS" --output json) -docker-compose exec osmosis osmosisd query bank balances "$OSMOSIS_USER_ADDRESS" +CHEQD_BALANCE_1=$(docker compose exec cheqd cheqd-noded query bank balances "$CHEQD_USER_ADDRESS" --output json) +docker compose exec osmosis osmosisd query bank balances "$OSMOSIS_USER_ADDRESS" -info "Forward transfer" # --- +info "Transfer cheqd -> osmosis" # --- PORT="transfer" CHANNEL="channel-0" -docker-compose exec cheqd cheqd-noded tx ibc-transfer transfer $PORT $CHANNEL "$OSMOSIS_USER_ADDRESS" 10000000000ncheq --from cheqd-user --chain-id cheqd --gas-prices 25ncheq --keyring-backend test -y +docker compose exec cheqd cheqd-noded tx ibc-transfer transfer $PORT $CHANNEL "$OSMOSIS_USER_ADDRESS" 10000000000ncheq --from cheqd-user --chain-id cheqd --gas-prices 50ncheq --keyring-backend test -y sleep 30 # Wait for relayer -info "Check balances the second time" # --- -CHEQD_BALANCE_2=$(docker-compose exec cheqd cheqd-noded query bank balances "$CHEQD_USER_ADDRESS" --output json) -BALANCES=$(docker-compose exec osmosis osmosisd query bank balances "$OSMOSIS_USER_ADDRESS" --output json) +info "Get balances" # --- +CHEQD_BALANCE_2=$(docker compose exec cheqd cheqd-noded query bank balances "$CHEQD_USER_ADDRESS" --output json) +BALANCES=$(docker compose exec osmosis osmosisd query bank balances "$OSMOSIS_USER_ADDRESS" --output json) info "Denom trace" # --- DENOM=$(echo "$BALANCES" | jq --raw-output '.balances[0].denom') DENOM_CUT=$(echo "$DENOM" | cut -c 5-) -docker-compose exec osmosis osmosisd query ibc-transfer denom-trace "$DENOM_CUT" +docker compose exec osmosis osmosisd query ibc-transfer denom-trace "$DENOM_CUT" -info "Back transfer" # --- +info "Transfer osmosis -> cheqd" # --- PORT="transfer" CHANNEL="channel-0" -docker-compose exec osmosis osmosisd tx ibc-transfer transfer $PORT $CHANNEL "$CHEQD_USER_ADDRESS" 10000000000"${DENOM}" --from osmosis-user --chain-id osmosis --keyring-backend test -y +docker compose exec osmosis osmosisd tx ibc-transfer transfer $PORT $CHANNEL "$CHEQD_USER_ADDRESS" 10000000000"${DENOM}" --from osmosis-user --chain-id osmosis --keyring-backend test -y sleep 30 # Wait for relayer -info "Check balances the last time" # --- -CHEQD_BALANCE_3=$(docker-compose exec cheqd cheqd-noded query bank balances "$CHEQD_USER_ADDRESS" --output json) -docker-compose exec osmosis osmosisd query bank balances "$OSMOSIS_USER_ADDRESS" +info "Get balances" # --- +CHEQD_BALANCE_3=$(docker compose exec cheqd cheqd-noded query bank balances "$CHEQD_USER_ADDRESS" --output json) +docker compose exec osmosis osmosisd query bank balances "$OSMOSIS_USER_ADDRESS" CHEQD_BALANCE_1=$(echo "$CHEQD_BALANCE_1" | jq --raw-output '.balances[0].amount') CHEQD_BALANCE_2=$(echo "$CHEQD_BALANCE_2" | jq --raw-output '.balances[0].amount') @@ -142,7 +159,7 @@ CHEQD_BALANCE_3=$(echo "$CHEQD_BALANCE_3" | jq --raw-output '.balances[0].amount info "Assert balances" # --- if [[ $CHEQD_BALANCE_2 < $CHEQD_BALANCE_1 ]] then - info "cheqd -> osmosis transfer is successfull" + info "cheqd -> osmosis transfer is successful" else err "cheqd -> osmosis transfer error" exit 1 @@ -150,7 +167,7 @@ fi if [[ $CHEQD_BALANCE_3 > $CHEQD_BALANCE_2 ]] then - info "osmosis -> cheqd transfer is successfull" + info "osmosis -> cheqd transfer is successful" else err "osmosis -> cheqd transfer error" exit 1 @@ -164,6 +181,5 @@ else exit 1 fi - info "Tear down" # --- -docker-compose down --timeout 20 +docker compose down --timeout 20 \ No newline at end of file diff --git a/tests/legacy/ibc-defi/osmosis/osmosis_init.sh b/tests/ibc-defi/osmosis/osmosis-init.sh similarity index 53% rename from tests/legacy/ibc-defi/osmosis/osmosis_init.sh rename to tests/ibc-defi/osmosis/osmosis-init.sh index b23843ac5..0ec9b0813 100644 --- a/tests/legacy/ibc-defi/osmosis/osmosis_init.sh +++ b/tests/ibc-defi/osmosis/osmosis-init.sh @@ -1,30 +1,32 @@ #!/bin/bash +# shellcheck disable=SC2086 set -euox pipefail # sed in macos requires extra argument -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - sed_extension='' -elif [[ "$OSTYPE" == "darwin"* ]]; then - sed_extension='.orig' +# sed in MacOS requires extra argument +if [[ "$OSTYPE" == "darwin"* ]]; then + SED_EXT='.orig' +else + SED_EXT='' fi CHAIN_ID="osmosis" # Node -osmosisd init --chain-id $CHAIN_ID testing +osmosisd init --chain-id "$CHAIN_ID" testing # User osmosisd keys add osmosis-user --keyring-backend=test # Genesis -osmosisd add-genesis-account "$(osmosisd keys show osmosis-user -a --keyring-backend=test)" 1000000000stake,1000000000valtoken -osmosisd gentx osmosis-user 500000000stake --keyring-backend=test --chain-id $CHAIN_ID +osmosisd add-genesis-account "$(osmosisd keys show osmosis-user -a --keyring-backend=test)" 2000000000uosmo +osmosisd gentx osmosis-user 500000000uosmo --keyring-backend=test --chain-id "$CHAIN_ID" osmosisd collect-gentxs jq '.app_state["gov"]["voting_params"]["voting_period"]="10s"' "$HOME/.osmosisd/config/genesis.json" > "$HOME/.osmosisd/config/tmp_genesis.json" && \ mv "$HOME/.osmosisd/config/tmp_genesis.json" "$HOME/.osmosisd/config/genesis.json" # Config -sed -i $sed_extension 's|laddr = "tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|g' "$HOME/.osmosisd/config/config.toml" +sed -i $SED_EXT 's|laddr = "tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|g' "$HOME/.osmosisd/config/config.toml" diff --git a/tests/integration/cli/config.go b/tests/integration/cli/config.go index 56ea071d3..0f109a70e 100644 --- a/tests/integration/cli/config.go +++ b/tests/integration/cli/config.go @@ -1,16 +1,16 @@ package cli -const CLI_BINARY_NAME = "cheqd-noded" +const CliBinaryName = "cheqd-noded" const ( - KEYRING_BACKEND = "test" - OUTPUT_FORMAT = "json" - GAS = "auto" - GAS_ADJUSTMENT = "1.8" - GAS_PRICES = "25ncheq" + KeyringBackend = "test" + OutputFormat = "json" + Gas = "auto" + GasAdjustment = "1.8" + GasPrices = "25ncheq" ) const ( - GREEN = "\033[32m" - PURPLE = "\033[35m" + Green = "\033[32m" + Purple = "\033[35m" ) diff --git a/tests/integration/cli/exec.go b/tests/integration/cli/exec.go index ff5a2f8d8..d04ac5c51 100644 --- a/tests/integration/cli/exec.go +++ b/tests/integration/cli/exec.go @@ -7,7 +7,7 @@ import ( ) func Exec(args ...string) (string, error) { - cmd := exec.Command(CLI_BINARY_NAME, args...) + cmd := exec.Command(CliBinaryName, args...) out, err := cmd.CombinedOutput() if err != nil { return "", errors.Wrap(err, string(out)) diff --git a/tests/integration/cli/query.go b/tests/integration/cli/query.go index 71f44494d..a90c3e4e8 100644 --- a/tests/integration/cli/query.go +++ b/tests/integration/cli/query.go @@ -10,16 +10,16 @@ import ( paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" ) -var CLI_QUERY_PARAMS = []string{ - "--chain-id", network.CHAIN_ID, - "--output", OUTPUT_FORMAT, +var CLIQueryParams = []string{ + "--chain-id", network.ChainID, + "--output", OutputFormat, } func Query(module, query string, queryArgs ...string) (string, error) { args := []string{"query", module, query} // Common params - args = append(args, CLI_QUERY_PARAMS...) + args = append(args, CLIQueryParams...) // Other args args = append(args, queryArgs...) @@ -57,61 +57,61 @@ func QueryParams(subspace, key string) (paramproposal.ParamChange, error) { return resp, nil } -func QueryDidDoc(did string) (didtypes.QueryGetDidDocResponse, error) { +func QueryDidDoc(did string) (didtypes.QueryDidDocResponse, error) { res, err := Query("cheqd", "did-document", did) if err != nil { - return didtypes.QueryGetDidDocResponse{}, err + return didtypes.QueryDidDocResponse{}, err } - var resp didtypes.QueryGetDidDocResponse + var resp didtypes.QueryDidDocResponse err = helpers.Codec.UnmarshalJSON([]byte(res), &resp) if err != nil { - return didtypes.QueryGetDidDocResponse{}, err + return didtypes.QueryDidDocResponse{}, err } return resp, nil } -func QueryResource(collectionId string, resourceId string) (resourcetypes.QueryGetResourceResponse, error) { - res, err := Query("resource", "resource", collectionId, resourceId) +func QueryResource(collectionID string, resourceID string) (resourcetypes.QueryResourceResponse, error) { + res, err := Query("resource", "resource", collectionID, resourceID) if err != nil { - return resourcetypes.QueryGetResourceResponse{}, err + return resourcetypes.QueryResourceResponse{}, err } - var resp resourcetypes.QueryGetResourceResponse + var resp resourcetypes.QueryResourceResponse err = helpers.Codec.UnmarshalJSON([]byte(res), &resp) if err != nil { - return resourcetypes.QueryGetResourceResponse{}, err + return resourcetypes.QueryResourceResponse{}, err } return resp, nil } -func QueryResourceMetadata(collectionId string, resourceId string) (resourcetypes.QueryGetResourceMetadataResponse, error) { - res, err := Query("resource", "resource-metadata", collectionId, resourceId) +func QueryResourceMetadata(collectionID string, resourceID string) (resourcetypes.QueryResourceMetadataResponse, error) { + res, err := Query("resource", "resource-metadata", collectionID, resourceID) if err != nil { - return resourcetypes.QueryGetResourceMetadataResponse{}, err + return resourcetypes.QueryResourceMetadataResponse{}, err } - var resp resourcetypes.QueryGetResourceMetadataResponse + var resp resourcetypes.QueryResourceMetadataResponse err = helpers.Codec.UnmarshalJSON([]byte(res), &resp) if err != nil { - return resourcetypes.QueryGetResourceMetadataResponse{}, err + return resourcetypes.QueryResourceMetadataResponse{}, err } return resp, nil } -func QueryResourceCollection(collectionId string) (resourcetypes.QueryGetCollectionResourcesResponse, error) { - res, err := Query("resource", "collection-resources", collectionId) +func QueryResourceCollection(collectionID string) (resourcetypes.QueryCollectionResourcesResponse, error) { + res, err := Query("resource", "collection-resources", collectionID) if err != nil { - return resourcetypes.QueryGetCollectionResourcesResponse{}, err + return resourcetypes.QueryCollectionResourcesResponse{}, err } - var resp resourcetypes.QueryGetCollectionResourcesResponse + var resp resourcetypes.QueryCollectionResourcesResponse err = helpers.Codec.UnmarshalJSON([]byte(res), &resp) if err != nil { - return resourcetypes.QueryGetCollectionResourcesResponse{}, err + return resourcetypes.QueryCollectionResourcesResponse{}, err } return resp, nil diff --git a/tests/integration/cli/tx.go b/tests/integration/cli/tx.go index 5b9221a29..fa0990195 100644 --- a/tests/integration/cli/tx.go +++ b/tests/integration/cli/tx.go @@ -11,24 +11,24 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -var CLI_TX_PARAMS = []string{ - "--chain-id", network.CHAIN_ID, - "--keyring-backend", KEYRING_BACKEND, - "--output", OUTPUT_FORMAT, +var CLITxParams = []string{ + "--chain-id", network.ChainID, + "--keyring-backend", KeyringBackend, + "--output", OutputFormat, "--yes", } -var CLI_GAS_PARAMS = []string{ - "--gas", GAS, - "--gas-adjustment", GAS_ADJUSTMENT, - "--gas-prices", GAS_PRICES, +var CliGasParams = []string{ + "--gas", Gas, + "--gas-adjustment", GasAdjustment, + "--gas-prices", GasPrices, } func Tx(module, tx, from string, feeParams []string, txArgs ...string) (sdk.TxResponse, error) { args := []string{"tx", module, tx} // Common params - args = append(args, CLI_TX_PARAMS...) + args = append(args, CLITxParams...) // Fee params args = append(args, feeParams...) @@ -66,85 +66,85 @@ func RevokeFeeGrant(granter, grantee string, feeParams []string) (sdk.TxResponse } func CreateDidDoc(tmpDir string, payload types.MsgCreateDidDocPayload, signInputs []cli.SignInput, from string, feeParams []string) (sdk.TxResponse, error) { - payloadJson, err := helpers.Codec.MarshalJSON(&payload) + payloadJSON, err := helpers.Codec.MarshalJSON(&payload) if err != nil { return sdk.TxResponse{}, err } payloadWithSignInputs := cli.PayloadWithSignInputs{ - Payload: payloadJson, + Payload: payloadJSON, SignInputs: signInputs, } - payloadWithSignInputsJson, err := json.Marshal(&payloadWithSignInputs) + payloadWithSignInputsJSON, err := json.Marshal(&payloadWithSignInputs) if err != nil { return sdk.TxResponse{}, err } - payloadFile := helpers.MustWriteTmpFile(tmpDir, []byte(payloadWithSignInputsJson)) + payloadFile := helpers.MustWriteTmpFile(tmpDir, payloadWithSignInputsJSON) return Tx("cheqd", "create-did", from, feeParams, payloadFile) } func UpdateDidDoc(tmpDir string, payload types.MsgUpdateDidDocPayload, signInputs []cli.SignInput, from string, feeParams []string) (sdk.TxResponse, error) { - payloadJson, err := helpers.Codec.MarshalJSON(&payload) + payloadJSON, err := helpers.Codec.MarshalJSON(&payload) if err != nil { return sdk.TxResponse{}, err } payloadWithSignInputs := cli.PayloadWithSignInputs{ - Payload: payloadJson, + Payload: payloadJSON, SignInputs: signInputs, } - payloadWithSignInputsJson, err := json.Marshal(&payloadWithSignInputs) + payloadWithSignInputsJSON, err := json.Marshal(&payloadWithSignInputs) if err != nil { return sdk.TxResponse{}, err } - payloadFile := helpers.MustWriteTmpFile(tmpDir, []byte(payloadWithSignInputsJson)) + payloadFile := helpers.MustWriteTmpFile(tmpDir, payloadWithSignInputsJSON) return Tx("cheqd", "update-did", from, feeParams, payloadFile) } func DeactivateDidDoc(tmpDir string, payload types.MsgDeactivateDidDocPayload, signInputs []cli.SignInput, from string, feeParams []string) (sdk.TxResponse, error) { - payloadJson, err := helpers.Codec.MarshalJSON(&payload) + payloadJSON, err := helpers.Codec.MarshalJSON(&payload) if err != nil { return sdk.TxResponse{}, err } payloadWithSignInputs := cli.PayloadWithSignInputs{ - Payload: payloadJson, + Payload: payloadJSON, SignInputs: signInputs, } - payloadWithSignInputsJson, err := json.Marshal(&payloadWithSignInputs) + payloadWithSignInputsJSON, err := json.Marshal(&payloadWithSignInputs) if err != nil { return sdk.TxResponse{}, err } - payloadFile := helpers.MustWriteTmpFile(tmpDir, []byte(payloadWithSignInputsJson)) + payloadFile := helpers.MustWriteTmpFile(tmpDir, payloadWithSignInputsJSON) return Tx("cheqd", "deactivate-did", from, feeParams, payloadFile) } func CreateResource(tmpDir string, options resourcecli.CreateResourceOptions, signInputs []cli.SignInput, from string, feeParams []string) (sdk.TxResponse, error) { - payloadJson, err := json.Marshal(&options) + payloadJSON, err := json.Marshal(&options) if err != nil { return sdk.TxResponse{}, err } payloadWithSignInputs := cli.PayloadWithSignInputs{ - Payload: payloadJson, + Payload: payloadJSON, SignInputs: signInputs, } - payloadWithSignInputsJson, err := json.Marshal(&payloadWithSignInputs) + payloadWithSignInputsJSON, err := json.Marshal(&payloadWithSignInputs) if err != nil { return sdk.TxResponse{}, err } - payloadFile := helpers.MustWriteTmpFile("", []byte(payloadWithSignInputsJson)) + payloadFile := helpers.MustWriteTmpFile("", payloadWithSignInputsJSON) return Tx("resource", "create", from, feeParams, payloadFile) } diff --git a/tests/integration/cli_diddoc_negative_test.go b/tests/integration/cli_diddoc_negative_test.go index edda049c4..a9e15f51d 100644 --- a/tests/integration/cli_diddoc_negative_test.go +++ b/tests/integration/cli_diddoc_negative_test.go @@ -11,9 +11,9 @@ import ( "github.com/cheqd/cheqd-node/tests/integration/network" "github.com/cheqd/cheqd-node/tests/integration/testdata" cli_types "github.com/cheqd/cheqd-node/x/did/client/cli" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/cheqd/cheqd-node/x/did/types" "github.com/google/uuid" - "github.com/multiformats/go-multibase" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -27,23 +27,22 @@ var _ = Describe("cheqd cli - negative did", func() { It("cannot create diddoc with missing cli arguments, sign inputs mismatch, non-supported VM type, already existing did", func() { // Define a valid new DID Doc - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() + did := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() keyId := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) payload := types.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\":\"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -52,33 +51,32 @@ var _ = Describe("cheqd cli - negative did", func() { signInputs := []cli_types.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, } - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) // Second new valid DID Doc - did2 := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() + did2 := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() keyId2 := did2 + "#key1" pubKey2, privKey2, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase582, err := multibase.Encode(multibase.Base58BTC, pubKey2) - Expect(err).To(BeNil()) + publicKeyMultibase2 := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey2) payload2 := types.MsgCreateDidDocPayload{ Id: did2, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId2, - Type: "Ed25519VerificationKey2020", - Controller: did2, - VerificationMaterial: "{\"publicKeyMultibase\":\"" + string(pubKeyMultibase582) + "\"}", + Id: keyId2, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did2, + VerificationMaterial: publicKeyMultibase2, }, }, Authentication: []string{keyId2}, @@ -87,72 +85,72 @@ var _ = Describe("cheqd cli - negative did", func() { signInputs2 := []cli_types.SignInput{ { - VerificationMethodId: keyId2, + VerificationMethodID: keyId2, PrivKey: privKey2, }, } - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot create diddoc with missing cli arguments")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot create diddoc with missing cli arguments")) // Fail to create a new DID Doc with missing cli arguments // a. missing payload, sign inputs and account - _, err = cli.CreateDidDoc(tmpDir, types.MsgCreateDidDocPayload{}, []cli_types.SignInput{}, "", cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, types.MsgCreateDidDocPayload{}, []cli_types.SignInput{}, "", cli.CliGasParams) Expect(err).ToNot(BeNil()) // b. missing payload, sign inputs - _, err = cli.CreateDidDoc(tmpDir, types.MsgCreateDidDocPayload{}, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, types.MsgCreateDidDocPayload{}, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).ToNot(BeNil()) // c. missing payload, account - _, err = cli.CreateDidDoc(tmpDir, types.MsgCreateDidDocPayload{}, signInputs2, "", cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, types.MsgCreateDidDocPayload{}, signInputs2, "", cli.CliGasParams) // d. missing sign inputs, account - _, err = cli.CreateDidDoc(tmpDir, payload2, []cli_types.SignInput{}, "", cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, payload2, []cli_types.SignInput{}, "", cli.CliGasParams) // e. missing payload - _, err = cli.CreateDidDoc(tmpDir, types.MsgCreateDidDocPayload{}, signInputs2, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, types.MsgCreateDidDocPayload{}, signInputs2, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).ToNot(BeNil()) // f. missing sign inputs - _, err = cli.CreateDidDoc(tmpDir, payload2, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, payload2, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).ToNot(BeNil()) // g. missing account - _, err = cli.CreateDidDoc(tmpDir, payload2, signInputs2, "", cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, payload2, signInputs2, "", cli.CliGasParams) Expect(err).ToNot(BeNil()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot create diddoc with sign inputs mismatch")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot create diddoc with sign inputs mismatch")) // Fail to create a new DID Doc with sign inputs mismatch // a. sign inputs mismatch - _, err = cli.CreateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).ToNot(BeNil()) // b. non-existing key id _, err = cli.CreateDidDoc(tmpDir, payload2, []cli_types.SignInput{ { - VerificationMethodId: "non-existing-key-id", + VerificationMethodID: "non-existing-key-id", PrivKey: privKey2, }, - }, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + }, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).ToNot(BeNil()) // c. non-matching private key _, err = cli.CreateDidDoc(tmpDir, payload2, []cli_types.SignInput{ { - VerificationMethodId: keyId2, + VerificationMethodID: keyId2, PrivKey: privKey, }, - }, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + }, testdata.BASE_ACCOUNT_2, cli.CliGasParams) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot create diddoc with non-supported VM type")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot create diddoc with non-supported VM type")) // Fail to create a new DID Doc with non-supported VM type payload3 := payload2 - payload3.VerificationMethod[0].Type = "NonSupportedVMType" - _, err = cli.CreateDidDoc(tmpDir, payload3, signInputs2, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + payload3.VerificationMethod[0].VerificationMethodType = "NonSupportedVMType" + _, err = cli.CreateDidDoc(tmpDir, payload3, signInputs2, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).ToNot(BeNil()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot create diddoc with already existing DID")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot create diddoc with already existing DID")) // Fail to create a new DID Doc with already existing DID - _, err = cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) }) @@ -160,24 +158,23 @@ var _ = Describe("cheqd cli - negative did", func() { It("cannot update a DID Doc with missing cli arguments, sign inputs mismatch, non-supported VM type, non-existing did, unchanged payload", func() { // Define a valid DID Doc to be updated - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() + did := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() keyId := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) payload := types.MsgCreateDidDocPayload{ Id: did, Controller: []string{did}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\":\"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -186,12 +183,12 @@ var _ = Describe("cheqd cli - negative did", func() { signInputs := []cli_types.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, } - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -200,10 +197,10 @@ var _ = Describe("cheqd cli - negative did", func() { Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\":\"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -211,30 +208,29 @@ var _ = Describe("cheqd cli - negative did", func() { VersionId: uuid.NewString(), } - res, err = cli.UpdateDidDoc(tmpDir, updatedPayload, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + res, err = cli.UpdateDidDoc(tmpDir, updatedPayload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) // Generate second controller - did2 := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() + did2 := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() keyId2 := did2 + "#key1" keyId2AsExtraController := did + "#key2" pubKey2, privKey2, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase582, err := multibase.Encode(multibase.Base58BTC, pubKey2) - Expect(err).To(BeNil()) + publicKeyMultibase2 := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey2) payload2 := types.MsgCreateDidDocPayload{ Id: did2, Controller: []string{did2}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId2, - Type: "Ed25519VerificationKey2020", - Controller: did2, - VerificationMaterial: "{\"publicKeyMultibase\":\"" + string(pubKeyMultibase582) + "\"}", + Id: keyId2, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did2, + VerificationMaterial: publicKeyMultibase2, }, }, Authentication: []string{keyId2}, @@ -243,12 +239,12 @@ var _ = Describe("cheqd cli - negative did", func() { signInputs2 := []cli_types.SignInput{ { - VerificationMethodId: keyId2, + VerificationMethodID: keyId2, PrivKey: privKey2, }, } - res_, err := cli.CreateDidDoc(tmpDir, payload2, signInputs2, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + res_, err := cli.CreateDidDoc(tmpDir, payload2, signInputs2, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res_.Code).To(BeEquivalentTo(0)) @@ -275,11 +271,11 @@ var _ = Describe("cheqd cli - negative did", func() { signInputsFuzzed := []cli_types.SignInput{ { - VerificationMethodId: keyIdFuzzed, + VerificationMethodID: keyIdFuzzed, PrivKey: privKeyFuzzed, }, { - VerificationMethodId: keyIdFuzzed2, + VerificationMethodID: keyIdFuzzed2, PrivKey: privKeyFuzzed2, }, } @@ -288,10 +284,10 @@ var _ = Describe("cheqd cli - negative did", func() { followingUpdatedPayload := deepCopierUpdateDid.DeepCopy(updatedPayload) followingUpdatedPayload.Controller = []string{did, did2} followingUpdatedPayload.VerificationMethod = append(followingUpdatedPayload.VerificationMethod, &types.VerificationMethod{ - Id: keyId2AsExtraController, - Type: "Ed25519VerificationKey2020", - Controller: did2, - VerificationMaterial: "{\"publicKeyMultibase\":\"" + string(pubKeyMultibase582) + "\"}", + Id: keyId2AsExtraController, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did2, + VerificationMaterial: publicKeyMultibase2, }) followingUpdatedPayload.Authentication = append(followingUpdatedPayload.Authentication, keyId2AsExtraController) followingUpdatedPayload.CapabilityDelegation = []string{keyId} @@ -300,131 +296,131 @@ var _ = Describe("cheqd cli - negative did", func() { signInputsAugmented := append(signInputs, signInputs2...) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot update diddoc with missing cli arguments")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot update diddoc with missing cli arguments")) // Fail to update the DID Doc with missing cli arguments // a. missing payload, sign inputs and account - _, err = cli.UpdateDidDoc(tmpDir, types.MsgUpdateDidDocPayload{}, []cli_types.SignInput{}, "", cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, types.MsgUpdateDidDocPayload{}, []cli_types.SignInput{}, "", cli.CliGasParams) Expect(err).ToNot(BeNil()) // b. missing payload, sign inputs - _, err = cli.UpdateDidDoc(tmpDir, types.MsgUpdateDidDocPayload{}, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, types.MsgUpdateDidDocPayload{}, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // c. missing payload, account - _, err = cli.UpdateDidDoc(tmpDir, types.MsgUpdateDidDocPayload{}, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, types.MsgUpdateDidDocPayload{}, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // d. missing sign inputs, account - _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // e. missing payload - _, err = cli.UpdateDidDoc(tmpDir, types.MsgUpdateDidDocPayload{}, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, types.MsgUpdateDidDocPayload{}, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // f. missing sign inputs - _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, []cli_types.SignInput{}, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // g. missing account - _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputs, "", cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputs, "", cli.CliGasParams) Expect(err).ToNot(BeNil()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot update diddoc with sign inputs mismatch")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot update diddoc with sign inputs mismatch")) // Fail to update the DID Doc with sign inputs mismatch // a. sign inputs total mismatch - _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputsFuzzed, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputsFuzzed, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // b. sign inputs invalid length - _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // c. non-existing key id _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, []cli_types.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, { - VerificationMethodId: "non-existing-key-id", + VerificationMethodID: "non-existing-key-id", PrivKey: privKey2, }, - }, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // d. non-matching private key _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, []cli_types.SignInput{ { - VerificationMethodId: keyId2AsExtraController, + VerificationMethodID: keyId2AsExtraController, PrivKey: privKey, }, { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey2, }, - }, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // e. invalid private key _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, []cli_types.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKeyFuzzedExtra, }, { - VerificationMethodId: keyId2AsExtraController, + VerificationMethodID: keyId2AsExtraController, PrivKey: privKey2, }, - }, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot update diddoc with a non-supported VM type")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot update diddoc with a non-supported VM type")) // Fail to update the DID Doc with a non-supported VM type invalidVmTypePayload := deepCopierUpdateDid.DeepCopy(followingUpdatedPayload) invalidVmTypePayload.VerificationMethod = []*types.VerificationMethod{ followingUpdatedPayload.VerificationMethod[0], { - Id: followingUpdatedPayload.VerificationMethod[1].Id, - Type: "NonSupportedVmType", - Controller: followingUpdatedPayload.VerificationMethod[1].Controller, - VerificationMaterial: "{\"publicKeyMultibase\":\"pretty-long-public-key-multibase\"}", + Id: followingUpdatedPayload.VerificationMethod[1].Id, + VerificationMethodType: "NonSupportedVmType", + Controller: followingUpdatedPayload.VerificationMethod[1].Controller, + VerificationMaterial: "pretty-long-public-key-multibase", }, } invalidVmTypePayload.VersionId = uuid.NewString() - _, err = cli.UpdateDidDoc(tmpDir, invalidVmTypePayload, signInputsAugmented, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, invalidVmTypePayload, signInputsAugmented, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot update diddoc with a non-existing DID")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot update diddoc with a non-existing DID")) // Fail to update a non-existing DID Doc - nonExistingDid := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() + nonExistingDid := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() nonExistingDidPayload := deepCopierUpdateDid.DeepCopy(followingUpdatedPayload) nonExistingDidPayload.Id = nonExistingDid - _, err = cli.UpdateDidDoc(tmpDir, nonExistingDidPayload, signInputsAugmented, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, nonExistingDidPayload, signInputsAugmented, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).ToNot(BeNil()) // Finally, update the DID Doc - res, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputsAugmented, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + res, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputsAugmented, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot update diddoc with an unchanged payload")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot update diddoc with an unchanged payload")) // Fail to update the DID Doc with an unchanged payload followingUpdatedPayload.VersionId = uuid.NewString() - _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputsAugmented, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + _, err = cli.UpdateDidDoc(tmpDir, followingUpdatedPayload, signInputsAugmented, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) // TODO: Decide if this should be an error, if the DID Doc is unchanged }) It("cannot query a diddoc with missing cli arguments, non-existing diddoc", func() { - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot query diddoc with missing cli arguments")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot query diddoc with missing cli arguments")) // Fail to query the DID Doc with missing cli arguments // a. missing did _, err := cli.QueryDidDoc("") Expect(err).ToNot(BeNil()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot query diddoc with a non-existing DID")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot query diddoc with a non-existing DID")) // Fail to query a non-existing DID Doc - nonExistingDid := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() + nonExistingDid := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() _, err = cli.QueryDidDoc(nonExistingDid) Expect(err).ToNot(BeNil()) }) diff --git a/tests/integration/cli_diddoc_pricing_negative_test.go b/tests/integration/cli_diddoc_pricing_negative_test.go index 4094512ff..264b470c1 100644 --- a/tests/integration/cli_diddoc_pricing_negative_test.go +++ b/tests/integration/cli_diddoc_pricing_negative_test.go @@ -10,9 +10,9 @@ import ( "github.com/cheqd/cheqd-node/tests/integration/network" "github.com/cheqd/cheqd-node/tests/integration/testdata" clitypes "github.com/cheqd/cheqd-node/x/did/client/cli" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/cheqd/cheqd-node/x/did/types" "github.com/google/uuid" - "github.com/multiformats/go-multibase" sdk "github.com/cosmos/cosmos-sdk/types" @@ -53,23 +53,22 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { Expect(err).To(BeNil()) // Create a new DID Doc - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() + did := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() keyId := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) payload = types.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -78,7 +77,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { signInputs = []clitypes.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, } @@ -103,10 +102,10 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { Id: payload.Id, VerificationMethod: []*types.VerificationMethod{ { - Id: payload.VerificationMethod[0].Id, - Controller: payload.VerificationMethod[0].Controller, - Type: payload.VerificationMethod[0].Type, - VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, + Id: payload.VerificationMethod[0].Id, + Controller: payload.VerificationMethod[0].Controller, + VerificationMethodType: payload.VerificationMethod[0].VerificationMethodType, + VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, }, }, Authentication: payload.Authentication, @@ -159,10 +158,10 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { Id: payload.Id, VerificationMethod: []*types.VerificationMethod{ { - Id: payload.VerificationMethod[0].Id, - Controller: payload.VerificationMethod[0].Controller, - Type: payload.VerificationMethod[0].Type, - VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, + Id: payload.VerificationMethod[0].Id, + Controller: payload.VerificationMethod[0].Controller, + VerificationMethodType: payload.VerificationMethod[0].VerificationMethodType, + VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, }, }, Authentication: payload.Authentication, @@ -198,14 +197,14 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { It("should not succeed in create diddoc message - case: gas auto, insufficient funds", func() { By("submitting create diddoc message with insufficient funds") - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_6, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_6, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(5)) }) It("should not succeed in update diddoc message - case: gas auto, insufficient funds", func() { By("submitting the create diddoc message") - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -214,10 +213,10 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { Id: payload.Id, VerificationMethod: []*types.VerificationMethod{ { - Id: payload.VerificationMethod[0].Id, - Controller: payload.VerificationMethod[0].Controller, - Type: payload.VerificationMethod[0].Type, - VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, + Id: payload.VerificationMethod[0].Id, + Controller: payload.VerificationMethod[0].Controller, + VerificationMethodType: payload.VerificationMethod[0].VerificationMethodType, + VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, }, }, Authentication: payload.Authentication, @@ -226,14 +225,14 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { } By("submitting update diddoc message with insufficient funds") - res, err = cli.UpdateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_6, cli.CLI_GAS_PARAMS) + res, err = cli.UpdateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_6, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(5)) }) It("should not succeed in deactivate diddoc message - case: gas auto, insufficient funds", func() { By("submitting the create diddoc message") - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -244,7 +243,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { } By("submitting deactivate diddoc message with insufficient funds") - res, err = cli.DeactivateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_6, cli.CLI_GAS_PARAMS) + res, err = cli.DeactivateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_6, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(5)) }) @@ -272,7 +271,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { It("should not charge more than tax for update diddoc message - case: fixed fee", func() { By("submitting the create diddoc message") - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -281,10 +280,10 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { Id: payload.Id, VerificationMethod: []*types.VerificationMethod{ { - Id: payload.VerificationMethod[0].Id, - Controller: payload.VerificationMethod[0].Controller, - Type: payload.VerificationMethod[0].Type, - VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, + Id: payload.VerificationMethod[0].Id, + Controller: payload.VerificationMethod[0].Controller, + VerificationMethodType: payload.VerificationMethod[0].VerificationMethodType, + VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, }, }, Authentication: payload.Authentication, @@ -314,7 +313,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { It("should not charge more than tax for deactivate diddoc message - case: fixed fee", func() { By("submitting the create diddoc message") - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -363,10 +362,10 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { Id: payload.Id, VerificationMethod: []*types.VerificationMethod{ { - Id: payload.VerificationMethod[0].Id, - Controller: payload.VerificationMethod[0].Controller, - Type: payload.VerificationMethod[0].Type, - VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, + Id: payload.VerificationMethod[0].Id, + Controller: payload.VerificationMethod[0].Controller, + VerificationMethodType: payload.VerificationMethod[0].VerificationMethodType, + VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, }, }, Authentication: payload.Authentication, diff --git a/tests/integration/cli_diddoc_pricing_test.go b/tests/integration/cli_diddoc_pricing_test.go index 20e501759..cf312a346 100644 --- a/tests/integration/cli_diddoc_pricing_test.go +++ b/tests/integration/cli_diddoc_pricing_test.go @@ -10,9 +10,9 @@ import ( "github.com/cheqd/cheqd-node/tests/integration/network" "github.com/cheqd/cheqd-node/tests/integration/testdata" clitypes "github.com/cheqd/cheqd-node/x/did/client/cli" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/cheqd/cheqd-node/x/did/types" "github.com/google/uuid" - "github.com/multiformats/go-multibase" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -34,23 +34,22 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(err).To(BeNil()) // Create a new DID Doc - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() + did := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() keyId := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) payload = types.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -59,7 +58,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { signInputs = []clitypes.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, } @@ -133,7 +132,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(balanceBefore.Denom).To(BeEquivalentTo(types.BaseMinimalDenom)) By("submitting a create diddoc message") - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -189,7 +188,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { It("should tax update diddoc message - case: fixed fee", func() { By("submitting a create diddoc message") - resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -198,10 +197,10 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Id: payload.Id, VerificationMethod: []*types.VerificationMethod{ { - Id: payload.VerificationMethod[0].Id, - Controller: payload.VerificationMethod[0].Controller, - Type: payload.VerificationMethod[0].Type, - VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, + Id: payload.VerificationMethod[0].Id, + Controller: payload.VerificationMethod[0].Controller, + VerificationMethodType: payload.VerificationMethod[0].VerificationMethodType, + VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, }, }, Authentication: payload.Authentication, @@ -271,7 +270,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { It("should tax update diddoc message - case: gas auto", func() { By("submitting a create diddoc message") - resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -280,10 +279,10 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Id: payload.Id, VerificationMethod: []*types.VerificationMethod{ { - Id: payload.VerificationMethod[0].Id, - Controller: payload.VerificationMethod[0].Controller, - Type: payload.VerificationMethod[0].Type, - VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, + Id: payload.VerificationMethod[0].Id, + Controller: payload.VerificationMethod[0].Controller, + VerificationMethodType: payload.VerificationMethod[0].VerificationMethodType, + VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, }, }, Authentication: payload.Authentication, @@ -298,7 +297,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { By("submitting an update diddoc message") tax := feeParams.UpdateDid - res, err := cli.UpdateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + res, err := cli.UpdateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -353,7 +352,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { It("should tax deactivate diddoc message - case: fixed fee", func() { By("submitting a create diddoc message") - resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -425,7 +424,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { It("should tax deactivate diddoc message - case: gas auto", func() { By("submitting a create diddoc message") - resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -441,7 +440,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(balanceBefore.Denom).To(BeEquivalentTo(types.BaseMinimalDenom)) By("submitting an deactivate diddoc message") - res, err := cli.DeactivateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + res, err := cli.DeactivateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -497,7 +496,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { It("should tax create diddoc message with feegrant - case: fixed fee", func() { By("creating a feegrant") - res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -510,7 +509,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(err).To(BeNil()) By("submitting a create diddoc message") - resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CLI_GAS_PARAMS)) + resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CliGasParams)) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -532,13 +531,13 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(diff.IsZero()).To(BeTrue()) By("revoking the feegrant") - res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) }) It("should tax update diddoc message with feegrant - case: fixed fee", func() { By("submitting a create diddoc message") - resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -547,10 +546,10 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Id: payload.Id, VerificationMethod: []*types.VerificationMethod{ { - Id: payload.VerificationMethod[0].Id, - Controller: payload.VerificationMethod[0].Controller, - Type: payload.VerificationMethod[0].Type, - VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, + Id: payload.VerificationMethod[0].Id, + Controller: payload.VerificationMethod[0].Controller, + VerificationMethodType: payload.VerificationMethod[0].VerificationMethodType, + VerificationMaterial: payload.VerificationMethod[0].VerificationMaterial, }, }, Authentication: payload.Authentication, @@ -559,7 +558,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { } By("creating a feegrant") - res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -572,7 +571,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(err).To(BeNil()) By("submitting an update diddoc message") - resp, err = cli.UpdateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CLI_GAS_PARAMS)) + resp, err = cli.UpdateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CliGasParams)) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -594,13 +593,13 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(diff.IsZero()).To(BeTrue()) By("revoking the feegrant") - res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) }) It("should tax deactivate diddoc message with feegrant - case: fixed fee", func() { By("submitting a create diddoc message") - resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + resp, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -611,7 +610,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { } By("creating a feegrant") - res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -624,7 +623,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(err).To(BeNil()) By("submitting a deactivate diddoc message") - resp, err = cli.DeactivateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CLI_GAS_PARAMS)) + resp, err = cli.DeactivateDidDoc(tmpDir, payload2, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CliGasParams)) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -646,7 +645,7 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() { Expect(diff.IsZero()).To(BeTrue()) By("revoking the feegrant") - res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) }) }) diff --git a/tests/integration/cli_diddoc_test.go b/tests/integration/cli_diddoc_test.go index a01fbf519..b9f9e4fe2 100644 --- a/tests/integration/cli_diddoc_test.go +++ b/tests/integration/cli_diddoc_test.go @@ -10,9 +10,9 @@ import ( "github.com/cheqd/cheqd-node/tests/integration/network" "github.com/cheqd/cheqd-node/tests/integration/testdata" cli_types "github.com/cheqd/cheqd-node/x/did/client/cli" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/cheqd/cheqd-node/x/did/types" "github.com/google/uuid" - "github.com/multiformats/go-multibase" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -25,81 +25,321 @@ var _ = Describe("cheqd cli - positive did", func() { tmpDir = GinkgoT().TempDir() }) - It("can create diddoc, update it and query the result", func() { - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can create diddoc")) + It("can create diddoc, update it and query the result (Ed25519VerificationKey2020)", func() { + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can create diddoc (Ed25519VerificationKey2020)")) // Create a new DID Doc - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + uuid.NewString() - keyId := did + "#key1" + did := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() + keyID := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) + + payload := types.MsgCreateDidDocPayload{ + Id: did, + VerificationMethod: []*types.VerificationMethod{ + { + Id: keyID, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, + }, + }, + Authentication: []string{keyID}, + VersionId: uuid.NewString(), + } + + signInputs := []cli_types.SignInput{ + { + VerificationMethodID: keyID, + PrivKey: privKey, + }, + } + + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) + Expect(res.Code).To(BeEquivalentTo(0)) + + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can update diddoc (Ed25519VerificationKey2020)")) + // Update the DID Doc + newPubKey, newPrivKey, err := ed25519.GenerateKey(nil) + Expect(err).To(BeNil()) + + newPubKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(newPubKey) + + payload2 := types.MsgUpdateDidDocPayload{ + Id: did, + VerificationMethod: []*types.VerificationMethod{ + { + Id: keyID, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: newPubKeyMultibase, + }, + }, + Authentication: []string{keyID}, + VersionId: uuid.NewString(), + } + + signInputs2 := []cli_types.SignInput{ + { + VerificationMethodID: keyID, + PrivKey: privKey, + }, + { + VerificationMethodID: keyID, + PrivKey: newPrivKey, + }, + } + + res2, err := cli.UpdateDidDoc(tmpDir, payload2, signInputs2, testdata.BASE_ACCOUNT_1, cli.CliGasParams) + Expect(err).To(BeNil()) + Expect(res2.Code).To(BeEquivalentTo(0)) + + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query diddoc (Ed25519VerificationKey2020)")) + // Query the DID Doc + resp, err := cli.QueryDidDoc(did) + Expect(err).To(BeNil()) + + didDoc := resp.Value.DidDoc + Expect(didDoc.Id).To(BeEquivalentTo(did)) + Expect(didDoc.Authentication).To(HaveLen(1)) + Expect(didDoc.Authentication[0]).To(BeEquivalentTo(keyID)) + Expect(didDoc.VerificationMethod).To(HaveLen(1)) + Expect(didDoc.VerificationMethod[0].Id).To(BeEquivalentTo(keyID)) + Expect(didDoc.VerificationMethod[0].VerificationMethodType).To(BeEquivalentTo("Ed25519VerificationKey2020")) + Expect(didDoc.VerificationMethod[0].Controller).To(BeEquivalentTo(did)) + Expect(didDoc.VerificationMethod[0].VerificationMaterial).To(BeEquivalentTo(newPubKeyMultibase)) + + // Check that DIDDoc is not deactivated + Expect(resp.Value.Metadata.Deactivated).To(BeFalse()) + + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can deactivate diddoc (Ed25519VerificationKey2020)")) + // Deactivate the DID Doc + payload3 := types.MsgDeactivateDidDocPayload{ + Id: did, + VersionId: uuid.NewString(), + } + + signInputs3 := []cli_types.SignInput{ + { + VerificationMethodID: keyID, + PrivKey: newPrivKey, + }, + } + + res3, err := cli.DeactivateDidDoc(tmpDir, payload3, signInputs3, testdata.BASE_ACCOUNT_1, cli.CliGasParams) + Expect(err).To(BeNil()) + Expect(res3.Code).To(BeEquivalentTo(0)) + + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query deactivated diddoc (Ed25519VerificationKey2020)")) + // Query the DID Doc + + resp2, err := cli.QueryDidDoc(did) + Expect(err).To(BeNil()) + + didDoc2 := resp2.Value.DidDoc + Expect(didDoc2).To(BeEquivalentTo(didDoc)) + + // Check that the DID Doc is deactivated + Expect(resp2.Value.Metadata.Deactivated).To(BeTrue()) + }) + + It("can create diddoc, update it and query the result (JsonWebKey2020)", func() { + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can create diddoc (JsonWebKey2020)")) + // Create a new DID Doc + did := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() + keyID := did + "#key1" + + pubKey, privKey, err := ed25519.GenerateKey(nil) + Expect(err).To(BeNil()) + + publicKeyMultibase := testsetup.GenerateJSONWebKey2020VerificationMaterial(pubKey) payload := types.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(pubKeyMultibase58) + "\"}", + Id: keyID, + VerificationMethodType: "JsonWebKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VersionId: uuid.NewString(), } signInputs := []cli_types.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyID, PrivKey: privKey, }, } - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can update diddoc")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can update diddoc (JsonWebKey2020)")) // Update the DID Doc newPubKey, newPrivKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - newPubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, newPubKey) + newPubKeyMultibase := testsetup.GenerateJSONWebKey2020VerificationMaterial(newPubKey) + + payload2 := types.MsgUpdateDidDocPayload{ + Id: did, + VerificationMethod: []*types.VerificationMethod{ + { + Id: keyID, + VerificationMethodType: "JsonWebKey2020", + Controller: did, + VerificationMaterial: newPubKeyMultibase, + }, + }, + Authentication: []string{keyID}, + VersionId: uuid.NewString(), + } + + signInputs2 := []cli_types.SignInput{ + { + VerificationMethodID: keyID, + PrivKey: privKey, + }, + { + VerificationMethodID: keyID, + PrivKey: newPrivKey, + }, + } + + res2, err := cli.UpdateDidDoc(tmpDir, payload2, signInputs2, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) + Expect(res2.Code).To(BeEquivalentTo(0)) + + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query diddoc (JsonWebKey2020)")) + // Query the DID Doc + resp, err := cli.QueryDidDoc(did) + Expect(err).To(BeNil()) + + didDoc := resp.Value.DidDoc + Expect(didDoc.Id).To(BeEquivalentTo(did)) + Expect(didDoc.Authentication).To(HaveLen(1)) + Expect(didDoc.Authentication[0]).To(BeEquivalentTo(keyID)) + Expect(didDoc.VerificationMethod).To(HaveLen(1)) + Expect(didDoc.VerificationMethod[0].Id).To(BeEquivalentTo(keyID)) + Expect(didDoc.VerificationMethod[0].VerificationMethodType).To(BeEquivalentTo("JsonWebKey2020")) + Expect(didDoc.VerificationMethod[0].Controller).To(BeEquivalentTo(did)) + Expect(didDoc.VerificationMethod[0].VerificationMaterial).To(BeEquivalentTo(newPubKeyMultibase)) + + // Check that DIDDoc is not deactivated + Expect(resp.Value.Metadata.Deactivated).To(BeFalse()) + + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can deactivate diddoc (JsonWebKey2020)")) + // Deactivate the DID Doc + payload3 := types.MsgDeactivateDidDocPayload{ + Id: did, + VersionId: uuid.NewString(), + } + + signInputs3 := []cli_types.SignInput{ + { + VerificationMethodID: keyID, + PrivKey: newPrivKey, + }, + } + + res3, err := cli.DeactivateDidDoc(tmpDir, payload3, signInputs3, testdata.BASE_ACCOUNT_1, cli.CliGasParams) + Expect(err).To(BeNil()) + Expect(res3.Code).To(BeEquivalentTo(0)) + + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query deactivated diddoc (JsonWebKey2020)")) + // Query the DID Doc + + resp2, err := cli.QueryDidDoc(did) + Expect(err).To(BeNil()) + + didDoc2 := resp2.Value.DidDoc + Expect(didDoc2).To(BeEquivalentTo(didDoc)) + + // Check that the DID Doc is deactivated + Expect(resp2.Value.Metadata.Deactivated).To(BeTrue()) + }) + + It("can create diddoc, update it and query the result (Ed25519VerificationKey2018)", func() { + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can create diddoc (Ed25519VerificationKey2018)")) + // Create a new DID Doc + did := "did:cheqd:" + network.DidNamespace + ":" + uuid.NewString() + keyID := did + "#key1" + + pubKey, privKey, err := ed25519.GenerateKey(nil) + Expect(err).To(BeNil()) + + pubKeyBase58 := testsetup.GenerateEd25519VerificationKey2018VerificationMaterial(pubKey) + + payload := types.MsgCreateDidDocPayload{ + Id: did, + VerificationMethod: []*types.VerificationMethod{ + { + Id: keyID, + VerificationMethodType: "Ed25519VerificationKey2018", + Controller: did, + VerificationMaterial: pubKeyBase58, + }, + }, + Authentication: []string{keyID}, + VersionId: uuid.NewString(), + } + + signInputs := []cli_types.SignInput{ + { + VerificationMethodID: keyID, + PrivKey: privKey, + }, + } + + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) + Expect(err).To(BeNil()) + Expect(res.Code).To(BeEquivalentTo(0)) + + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can update diddoc (Ed25519VerificationKey2018)")) + // Update the DID Doc + newPubKey, newPrivKey, err := ed25519.GenerateKey(nil) + Expect(err).To(BeNil()) + + newpubKeyBase58 := testsetup.GenerateEd25519VerificationKey2018VerificationMaterial(newPubKey) payload2 := types.MsgUpdateDidDocPayload{ Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(newPubKeyMultibase58) + "\"}", + Id: keyID, + VerificationMethodType: "Ed25519VerificationKey2018", + Controller: did, + VerificationMaterial: newpubKeyBase58, }, }, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VersionId: uuid.NewString(), } signInputs2 := []cli_types.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyID, PrivKey: privKey, }, { - VerificationMethodId: keyId, + VerificationMethodID: keyID, PrivKey: newPrivKey, }, } - res2, err := cli.UpdateDidDoc(tmpDir, payload2, signInputs2, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + res2, err := cli.UpdateDidDoc(tmpDir, payload2, signInputs2, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res2.Code).To(BeEquivalentTo(0)) - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can query diddoc")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query diddoc (Ed25519VerificationKey2018)")) // Query the DID Doc resp, err := cli.QueryDidDoc(did) Expect(err).To(BeNil()) @@ -107,17 +347,17 @@ var _ = Describe("cheqd cli - positive did", func() { didDoc := resp.Value.DidDoc Expect(didDoc.Id).To(BeEquivalentTo(did)) Expect(didDoc.Authentication).To(HaveLen(1)) - Expect(didDoc.Authentication[0]).To(BeEquivalentTo(keyId)) + Expect(didDoc.Authentication[0]).To(BeEquivalentTo(keyID)) Expect(didDoc.VerificationMethod).To(HaveLen(1)) - Expect(didDoc.VerificationMethod[0].Id).To(BeEquivalentTo(keyId)) - Expect(didDoc.VerificationMethod[0].Type).To(BeEquivalentTo("Ed25519VerificationKey2020")) + Expect(didDoc.VerificationMethod[0].Id).To(BeEquivalentTo(keyID)) + Expect(didDoc.VerificationMethod[0].VerificationMethodType).To(BeEquivalentTo("Ed25519VerificationKey2018")) Expect(didDoc.VerificationMethod[0].Controller).To(BeEquivalentTo(did)) - Expect(didDoc.VerificationMethod[0].VerificationMaterial).To(BeEquivalentTo("{\"publicKeyMultibase\": \"" + string(newPubKeyMultibase58) + "\"}")) + Expect(didDoc.VerificationMethod[0].VerificationMaterial).To(BeEquivalentTo(newpubKeyBase58)) // Check that DIDDoc is not deactivated Expect(resp.Value.Metadata.Deactivated).To(BeFalse()) - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can deactivate diddoc")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can deactivate diddoc (Ed25519VerificationKey2018)")) // Deactivate the DID Doc payload3 := types.MsgDeactivateDidDocPayload{ Id: did, @@ -126,16 +366,16 @@ var _ = Describe("cheqd cli - positive did", func() { signInputs3 := []cli_types.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyID, PrivKey: newPrivKey, }, } - res3, err := cli.DeactivateDidDoc(tmpDir, payload3, signInputs3, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + res3, err := cli.DeactivateDidDoc(tmpDir, payload3, signInputs3, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res3.Code).To(BeEquivalentTo(0)) - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can query deactivated diddoc")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query deactivated diddoc (Ed25519VerificationKey2018)")) // Query the DID Doc resp2, err := cli.QueryDidDoc(did) diff --git a/tests/integration/cli_resource_negative_test.go b/tests/integration/cli_resource_negative_test.go index 14c4228a9..f1f505806 100644 --- a/tests/integration/cli_resource_negative_test.go +++ b/tests/integration/cli_resource_negative_test.go @@ -10,19 +10,19 @@ import ( "github.com/cheqd/cheqd-node/tests/integration/network" "github.com/cheqd/cheqd-node/tests/integration/testdata" clitypes "github.com/cheqd/cheqd-node/x/did/client/cli" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/cheqd/cheqd-node/x/did/types" resourcecli "github.com/cheqd/cheqd-node/x/resource/client/cli" "github.com/google/uuid" - "github.com/multiformats/go-multibase" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) var _ = Describe("cheqd cli - negative resource", func() { - var collectionId string + var collectionID string var did string var signInputs []clitypes.SignInput - var resourceId string + var resourceID string var resourceName string var tmpDir string @@ -32,24 +32,23 @@ var _ = Describe("cheqd cli - negative resource", func() { tmpDir = GinkgoT().TempDir() // Create a new DID Doc - collectionId = uuid.NewString() - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + collectionId + collectionID = uuid.NewString() + did := "did:cheqd:" + network.DidNamespace + ":" + collectionID keyId := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) payload := types.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -58,17 +57,17 @@ var _ = Describe("cheqd cli - negative resource", func() { signInputs = []clitypes.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, } - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) - // Initialize shared resourceId - resourceId = uuid.NewString() + // Initialize shared resourceID + resourceID = uuid.NewString() resourceName = "TestName" }) @@ -82,7 +81,7 @@ var _ = Describe("cheqd cli - negative resource", func() { Expect(err).To(BeNil()) signInputs2 := []clitypes.SignInput{ { - VerificationMethodId: keyId2, + VerificationMethodID: keyId2, PrivKey: privKey2, }, } @@ -95,160 +94,160 @@ var _ = Describe("cheqd cli - negative resource", func() { Expect(err).To(BeNil()) _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId2, - ResourceId: resourceId, + CollectionID: collectionId2, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot create resource with missing cli arguments")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot create resource with missing cli arguments")) // Fail to create a resource with missing cli arguments // a. missing collection id _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - ResourceId: resourceId, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) // b. missing resource id - works because it is generated by the cli _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, + CollectionID: collectionID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) // c. missing resource name _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) // c. missing resource version - ok // d. missing resource type _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) // e. missing resource file _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) // f. missing sign inputs _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, []clitypes.SignInput{}, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, []clitypes.SignInput{}, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) // g. missing account _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, "", cli.CLI_GAS_PARAMS) + }, signInputs, "", cli.CliGasParams) Expect(err).To(HaveOccurred()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot create resource with sign inputs mismatch")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot create resource with sign inputs mismatch")) // Fail to create a resource with sign inputs mismatch // a. sign inputs mismatch _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs2, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs2, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) // b. non-existing key id _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, }, []clitypes.SignInput{ { - VerificationMethodId: "non-existing-key-id", + VerificationMethodID: "non-existing-key-id", PrivKey: signInputs[0].PrivKey, }, - }, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) // c. non-matching private key _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, }, []clitypes.SignInput{ { - VerificationMethodId: signInputs[0].VerificationMethodId, + VerificationMethodID: signInputs[0].VerificationMethodID, PrivKey: privKey2, }, - }, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) // d. invalid private key _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, }, []clitypes.SignInput{ { - VerificationMethodId: signInputs[0].VerificationMethodId, + VerificationMethodID: signInputs[0].VerificationMethodID, PrivKey: testdata.GenerateByteEntropy(), }, - }, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(HaveOccurred()) // Finally, create the resource res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) @@ -257,7 +256,7 @@ var _ = Describe("cheqd cli - negative resource", func() { collectionId2 := uuid.NewString() resourceId2 := uuid.NewString() - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot query a resource with missing cli arguments")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot query a resource with missing cli arguments")) // Fail to query a resource with missing cli arguments // a. missing collection id, resource id _, err := cli.QueryResource("", "") @@ -271,27 +270,27 @@ var _ = Describe("cheqd cli - negative resource", func() { _, err = cli.QueryResource(collectionId2, "") Expect(err).To(HaveOccurred()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot query a resource with non-existing collection id")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot query a resource with non-existing collection id")) // Fail to query a resource with non-existing collection id - _, err = cli.QueryResource(collectionId2, resourceId) + _, err = cli.QueryResource(collectionId2, resourceID) Expect(err).To(HaveOccurred()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot query a resource with non-existing resource id")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot query a resource with non-existing resource id")) // Fail to query a resource with non-existing resource id - _, err = cli.QueryResource(collectionId, resourceId2) + _, err = cli.QueryResource(collectionID, resourceId2) Expect(err).To(HaveOccurred()) }) It("cannot query resource collection with missing cli arguments, non-existing collection id", func() { collectionId2 := uuid.NewString() - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot query resource collection with missing cli arguments")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot query resource collection with missing cli arguments")) // Fail to query resource collection with missing cli arguments // a. missing collection id _, err := cli.QueryResourceCollection("") Expect(err).To(HaveOccurred()) - AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.PURPLE, "cannot query resource collection with non-existing collection id")) + AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot query resource collection with non-existing collection id")) // Fail to query resource collection with non-existing collection id _, err = cli.QueryResourceCollection(collectionId2) Expect(err).To(HaveOccurred()) diff --git a/tests/integration/cli_resource_pricing_negative_test.go b/tests/integration/cli_resource_pricing_negative_test.go index fa48df6b2..eda790f57 100644 --- a/tests/integration/cli_resource_pricing_negative_test.go +++ b/tests/integration/cli_resource_pricing_negative_test.go @@ -10,12 +10,12 @@ import ( "github.com/cheqd/cheqd-node/tests/integration/network" "github.com/cheqd/cheqd-node/tests/integration/testdata" clitypes "github.com/cheqd/cheqd-node/x/did/client/cli" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" didtypes "github.com/cheqd/cheqd-node/x/did/types" resourcecli "github.com/cheqd/cheqd-node/x/resource/client/cli" resourcetypes "github.com/cheqd/cheqd-node/x/resource/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/google/uuid" - "github.com/multiformats/go-multibase" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -40,7 +40,7 @@ import ( var _ = Describe("cheqd cli - negative resource pricing", func() { var tmpDir string var feeParams resourcetypes.FeeParams - var collectionId string + var collectionID string var signInputs []clitypes.SignInput BeforeEach(func() { @@ -53,24 +53,23 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { Expect(err).To(BeNil()) // Create a new DID Doc - collectionId = uuid.NewString() - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + collectionId + collectionID = uuid.NewString() + did := "did:cheqd:" + network.DidNamespace + ":" + collectionID keyId := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) didPayload := didtypes.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*didtypes.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -79,20 +78,20 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { signInputs = []clitypes.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, } // Submit the DID Doc - resp, err := cli.CreateDidDoc(tmpDir, didPayload, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + resp, err := cli.CreateDidDoc(tmpDir, didPayload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) }) It("should not succeed in create resource json message - case: fixed fee, invalid denom", func() { By("preparing the create resource json message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -102,8 +101,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the json resource message with invalid denom") invalidTax := sdk.NewCoin("invalid", sdk.NewInt(feeParams.Json.Amount.Int64())) res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -115,7 +114,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not succeed in create resource image message - case: fixed fee, invalid denom", func() { By("preparing the create resource image message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -125,8 +124,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the image resource message with invalid denom") invalidTax := sdk.NewCoin("invalid", sdk.NewInt(feeParams.Image.Amount.Int64())) res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -138,7 +137,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not succeed in create resource default message - case: fixed fee, invalid denom", func() { By("preparing the create resource default message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -148,8 +147,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the default resource message with invalid denom") invalidTax := sdk.NewCoin("invalid", sdk.NewInt(feeParams.Default.Amount.Int64())) res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -161,7 +160,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not fail in create resource json message - case: fixed fee, lower amount than required", func() { By("preparing the create resource json message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -171,8 +170,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the json resource message with lower amount than required") lowerTax := sdk.NewCoin(feeParams.Json.Denom, sdk.NewInt(feeParams.Json.Amount.Int64()-1)) res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -184,7 +183,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not fail in create resource image message - case: fixed fee, lower amount than required", func() { By("preparing the create resource image message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -194,8 +193,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the image resource message with lower amount than required") lowerTax := sdk.NewCoin(feeParams.Image.Denom, sdk.NewInt(feeParams.Image.Amount.Int64()-1)) res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -207,7 +206,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not fail in create resource default message - case: fixed fee, lower amount than required", func() { By("preparing the create resource default message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -217,8 +216,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the default resource message with lower amount than required") lowerTax := sdk.NewCoin(feeParams.Default.Denom, sdk.NewInt(feeParams.Default.Amount.Int64()-1)) res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -230,7 +229,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not succeed in create resource json message - case: fixed fee, insufficient funds", func() { By("preparing the create resource json message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -240,8 +239,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the json resource message with insufficient funds") tax := feeParams.Json res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -253,7 +252,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not succeed in create resource image message - case: fixed fee, insufficient funds", func() { By("preparing the create resource image message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -263,8 +262,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the image resource message with insufficient funds") tax := feeParams.Image res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -276,7 +275,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not succeed in create resource default message - case: fixed fee, insufficient funds", func() { By("preparing the create resource default message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -286,8 +285,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the default resource message with insufficient funds") tax := feeParams.Default res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -299,7 +298,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not succeed in create resource json - case: gas auto, insufficient funds", func() { By("preparing the create resource json message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -308,20 +307,20 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the json resource message with insufficient funds") res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_3, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_3, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(5)) }) It("should not succeed in create resource image - case: gas auto, insufficient funds", func() { By("preparing the create resource image message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -330,20 +329,20 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the image resource message with insufficient funds") res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_3, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_3, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(5)) }) It("should not succeed in create resource default - case: gas auto, insufficient funds", func() { By("preparing the create resource default message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -352,20 +351,20 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { By("submitting the default resource message with insufficient funds") res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_3, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_3, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(5)) }) It("should not charge more than tax in create resource json message - case: fixed fee", func() { By("preparing the create resource json message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -380,8 +379,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { tax := feeParams.Json doubleTax := sdk.NewCoin(resourcetypes.BaseMinimalDenom, tax.Amount.Mul(sdk.NewInt(2))) _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -399,7 +398,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not charge more than tax in create resource image message - case: fixed fee", func() { By("preparing the create resource image message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -414,8 +413,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { tax := feeParams.Image doubleTax := sdk.NewCoin(resourcetypes.BaseMinimalDenom, tax.Amount.Mul(sdk.NewInt(2))) _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -433,7 +432,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { It("should not charge more than tax in create resource default message - case: fixed fee", func() { By("preparing the create resource default message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -448,8 +447,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { tax := feeParams.Default doubleTax := sdk.NewCoin(resourcetypes.BaseMinimalDenom, tax.Amount.Mul(sdk.NewInt(2))) _, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, diff --git a/tests/integration/cli_resource_pricing_test.go b/tests/integration/cli_resource_pricing_test.go index 0ba726f55..c5628ea5a 100644 --- a/tests/integration/cli_resource_pricing_test.go +++ b/tests/integration/cli_resource_pricing_test.go @@ -10,11 +10,11 @@ import ( "github.com/cheqd/cheqd-node/tests/integration/network" "github.com/cheqd/cheqd-node/tests/integration/testdata" clitypes "github.com/cheqd/cheqd-node/x/did/client/cli" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" didtypes "github.com/cheqd/cheqd-node/x/did/types" resourcecli "github.com/cheqd/cheqd-node/x/resource/client/cli" resourcetypes "github.com/cheqd/cheqd-node/x/resource/types" "github.com/google/uuid" - "github.com/multiformats/go-multibase" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -22,7 +22,7 @@ import ( var _ = Describe("cheqd cli - positive resource pricing", func() { var tmpDir string var feeParams resourcetypes.FeeParams - var collectionId string + var collectionID string var signInputs []clitypes.SignInput BeforeEach(func() { @@ -35,24 +35,23 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { Expect(err).To(BeNil()) // Create a new DID Doc - collectionId = uuid.NewString() - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + collectionId + collectionID = uuid.NewString() + did := "did:cheqd:" + network.DidNamespace + ":" + collectionID keyId := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) didPayload := didtypes.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*didtypes.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -61,20 +60,20 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { signInputs = []clitypes.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, } // Submit the DID Doc - resp, err := cli.CreateDidDoc(tmpDir, didPayload, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + resp, err := cli.CreateDidDoc(tmpDir, didPayload, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) }) It("should tax json resource message - case: fixed fee", func() { By("preparing the json resource message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -89,8 +88,8 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting the json resource message") tax := feeParams.Json res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -150,7 +149,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { It("should tax json resource message - case: gas auto", func() { By("preparing the json resource message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -164,13 +163,13 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting the json resource message") res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -226,7 +225,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { It("should tax image resource message - case: fixed fee", func() { By("preparing the image resource message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -241,8 +240,8 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting the image resource message") tax := feeParams.Image res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -302,7 +301,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { It("should tax image resource message - case: gas auto", func() { By("preparing the image resource message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -316,13 +315,13 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting the image resource message") res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -378,7 +377,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { It("should tax default resource message - case: fixed fee", func() { By("preparing the default resource message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -393,8 +392,8 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting the default resource message") tax := feeParams.Default res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, @@ -454,7 +453,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { It("should tax default resource message - case: gas auto", func() { By("preparing the default resource message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -468,13 +467,13 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting the default resource message") res, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_4, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_4, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -530,7 +529,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { It("should tax create resource json message with feegrant - case: fixed fee", func() { By("preparing the create resource json message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -538,7 +537,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { Expect(err).To(BeNil()) By("creating a feegrant") - res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -552,13 +551,13 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting a create resource json message") resp, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CLI_GAS_PARAMS)) + }, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CliGasParams)) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -580,13 +579,13 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { Expect(diff.IsZero()).To(BeTrue()) By("revoking the feegrant") - res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) }) It("should tax create resource image with feegrant - case: fixed fee", func() { By("preparing the create resource image message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -594,7 +593,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { Expect(err).To(BeNil()) By("creating a feegrant") - res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -608,13 +607,13 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting a create resource image message") resp, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CLI_GAS_PARAMS)) + }, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CliGasParams)) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -636,13 +635,13 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { Expect(diff.IsZero()).To(BeTrue()) By("revoking the feegrant") - res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) }) It("should tax create resource default with feegrant - case: fixed fee", func() { By("preparing the create resource default message") - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -650,7 +649,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { Expect(err).To(BeNil()) By("creating a feegrant") - res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err := cli.GrantFees(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -664,13 +663,13 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { By("submitting a create resource default message") resp, err := cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CLI_GAS_PARAMS)) + }, signInputs, testdata.BASE_ACCOUNT_1, helpers.GenerateFeeGranter(testdata.BASE_ACCOUNT_4_ADDR, cli.CliGasParams)) Expect(err).To(BeNil()) Expect(resp.Code).To(BeEquivalentTo(0)) @@ -692,7 +691,7 @@ var _ = Describe("cheqd cli - positive resource pricing", func() { Expect(diff.IsZero()).To(BeTrue()) By("revoking the feegrant") - res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CLI_GAS_PARAMS) + res, err = cli.RevokeFeeGrant(testdata.BASE_ACCOUNT_4_ADDR, testdata.BASE_ACCOUNT_1_ADDR, cli.CliGasParams) Expect(err).To(BeNil()) }) }) diff --git a/tests/integration/cli_resource_test.go b/tests/integration/cli_resource_test.go index 1a3741306..cd6abf80f 100644 --- a/tests/integration/cli_resource_test.go +++ b/tests/integration/cli_resource_test.go @@ -10,10 +10,10 @@ import ( "github.com/cheqd/cheqd-node/tests/integration/network" "github.com/cheqd/cheqd-node/tests/integration/testdata" clitypes "github.com/cheqd/cheqd-node/x/did/client/cli" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/cheqd/cheqd-node/x/did/types" resourcecli "github.com/cheqd/cheqd-node/x/resource/client/cli" "github.com/google/uuid" - "github.com/multiformats/go-multibase" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -26,26 +26,25 @@ var _ = Describe("cheqd cli - positive resource", func() { }) It("can create diddoc, create resource, query it, query all resource versions of the same resource name, query resource collection", func() { - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can create diddoc")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can create diddoc")) // Create a new DID Doc - collectionId := uuid.NewString() - did := "did:cheqd:" + network.DID_NAMESPACE + ":" + collectionId + collectionID := uuid.NewString() + did := "did:cheqd:" + network.DidNamespace + ":" + collectionID keyId := did + "#key1" pubKey, privKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - pubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + publicKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) payload := types.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: "Ed25519VerificationKey2020", - Controller: did, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(pubKeyMultibase58) + "\"}", + Id: keyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: did, + VerificationMaterial: publicKeyMultibase, }, }, Authentication: []string{keyId}, @@ -54,19 +53,19 @@ var _ = Describe("cheqd cli - positive resource", func() { signInputs := []clitypes.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyId, PrivKey: privKey, }, } - res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) // Create a new Resource - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can create resource")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can create resource")) - resourceId := uuid.NewString() + resourceID := uuid.NewString() resourceName := "TestResource" resourceVersion := "1.0" resourceType := "TestType" @@ -74,35 +73,35 @@ var _ = Describe("cheqd cli - positive resource", func() { Expect(err).To(BeNil()) res, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: resourceId, + CollectionID: collectionID, + ResourceID: resourceID, ResourceName: resourceName, ResourceVersion: resourceVersion, ResourceType: resourceType, ResourceFile: resourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can query resource")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query resource")) // Query the Resource - res2, err := cli.QueryResource(collectionId, resourceId) + res2, err := cli.QueryResource(collectionID, resourceID) Expect(err).To(BeNil()) - Expect(res2.Resource.Metadata.CollectionId).To(BeEquivalentTo(collectionId)) - Expect(res2.Resource.Metadata.Id).To(BeEquivalentTo(resourceId)) + Expect(res2.Resource.Metadata.CollectionId).To(BeEquivalentTo(collectionID)) + Expect(res2.Resource.Metadata.Id).To(BeEquivalentTo(resourceID)) Expect(res2.Resource.Metadata.Name).To(BeEquivalentTo(resourceName)) Expect(res2.Resource.Metadata.ResourceType).To(BeEquivalentTo(resourceType)) Expect(res2.Resource.Metadata.MediaType).To(Equal("application/json")) Expect(res2.Resource.Resource.Data).To(BeEquivalentTo(testdata.JSON_FILE_CONTENT)) - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can query resource metadata")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query resource metadata")) // Query the Resource Metadata - res3, err := cli.QueryResourceMetadata(collectionId, resourceId) + res3, err := cli.QueryResourceMetadata(collectionID, resourceID) Expect(err).To(BeNil()) - Expect(res3.Resource.CollectionId).To(BeEquivalentTo(collectionId)) - Expect(res3.Resource.Id).To(BeEquivalentTo(resourceId)) + Expect(res3.Resource.CollectionId).To(BeEquivalentTo(collectionID)) + Expect(res3.Resource.Id).To(BeEquivalentTo(resourceID)) Expect(res3.Resource.Name).To(BeEquivalentTo(resourceName)) Expect(res3.Resource.ResourceType).To(BeEquivalentTo(resourceType)) Expect(res3.Resource.MediaType).To(Equal("application/json")) @@ -116,35 +115,34 @@ var _ = Describe("cheqd cli - positive resource", func() { Expect(err).To(BeNil()) res, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: collectionId, - ResourceId: nextResourceId, + CollectionID: collectionID, + ResourceID: nextResourceId, ResourceName: nextResourceName, ResourceVersion: nextResourceVersion, ResourceType: nextResourceType, ResourceFile: nextResourceFile, - }, signInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, signInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) // Create a second DID Doc secondCollectionId := uuid.NewString() - secondDid := "did:cheqd:" + network.DID_NAMESPACE + ":" + secondCollectionId + secondDid := "did:cheqd:" + network.DidNamespace + ":" + secondCollectionId secondKeyId := secondDid + "#key1" secondPubKey, secondPrivKey, err := ed25519.GenerateKey(nil) Expect(err).To(BeNil()) - secondPubKeyMultibase58, err := multibase.Encode(multibase.Base58BTC, secondPubKey) - Expect(err).To(BeNil()) + secondpubKeyMultibase := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(secondPubKey) secondPayload := types.MsgCreateDidDocPayload{ Id: secondDid, VerificationMethod: []*types.VerificationMethod{ { - Id: secondKeyId, - Type: "Ed25519VerificationKey2020", - Controller: secondDid, - VerificationMaterial: "{\"publicKeyMultibase\": \"" + string(secondPubKeyMultibase58) + "\"}", + Id: secondKeyId, + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: secondDid, + VerificationMaterial: secondpubKeyMultibase, }, }, Authentication: []string{secondKeyId}, @@ -153,12 +151,12 @@ var _ = Describe("cheqd cli - positive resource", func() { secondSignInputs := []clitypes.SignInput{ { - VerificationMethodId: secondKeyId, + VerificationMethodID: secondKeyId, PrivKey: secondPrivKey, }, } - res, err = cli.CreateDidDoc(tmpDir, secondPayload, secondSignInputs, testdata.BASE_ACCOUNT_2, cli.CLI_GAS_PARAMS) + res, err = cli.CreateDidDoc(tmpDir, secondPayload, secondSignInputs, testdata.BASE_ACCOUNT_2, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) @@ -171,24 +169,24 @@ var _ = Describe("cheqd cli - positive resource", func() { Expect(err).To(BeNil()) res, err = cli.CreateResource(tmpDir, resourcecli.CreateResourceOptions{ - CollectionId: secondCollectionId, - ResourceId: secondResourceId, + CollectionID: secondCollectionId, + ResourceID: secondResourceId, ResourceName: secondResourceName, ResourceVersion: secondResourceVersion, ResourceType: secondResourceType, ResourceFile: secondResourceFile, - }, secondSignInputs, testdata.BASE_ACCOUNT_1, cli.CLI_GAS_PARAMS) + }, secondSignInputs, testdata.BASE_ACCOUNT_1, cli.CliGasParams) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) - AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.GREEN, "can query resource collection")) + AddReportEntry("Integration", fmt.Sprintf("%sPositive: %s", cli.Green, "can query resource collection")) // Query Resource Collection - res4, err := cli.QueryResourceCollection(collectionId) + res4, err := cli.QueryResourceCollection(collectionID) Expect(err).To(BeNil()) Expect(len(res4.Resources)).To(Equal(2)) - Expect(res4.Resources[0].CollectionId).To(Equal(collectionId)) - Expect(res4.Resources[1].CollectionId).To(Equal(collectionId)) - Expect([]string{res4.Resources[0].Id, res4.Resources[1].Id}).To(ContainElements(resourceId, nextResourceId)) + Expect(res4.Resources[0].CollectionId).To(Equal(collectionID)) + Expect(res4.Resources[1].CollectionId).To(Equal(collectionID)) + Expect([]string{res4.Resources[0].Id, res4.Resources[1].Id}).To(ContainElements(resourceID, nextResourceId)) // Query second Resource Collection res5, err := cli.QueryResourceCollection(secondCollectionId) diff --git a/tests/integration/helpers/io.go b/tests/integration/helpers/io.go index 323331012..a0df8ee41 100644 --- a/tests/integration/helpers/io.go +++ b/tests/integration/helpers/io.go @@ -11,7 +11,7 @@ import ( func WriteTmpFile(tmpDir string, content []byte) (string, error) { name := uuid.NewString() file := path.Join(tmpDir, name) - err := os.WriteFile(file, []byte(content), fs.ModePerm) + err := os.WriteFile(file, content, fs.ModePerm) if err != nil { return "", err } diff --git a/tests/integration/network/config.go b/tests/integration/network/config.go index c6afc071a..9b1b7a954 100644 --- a/tests/integration/network/config.go +++ b/tests/integration/network/config.go @@ -1,6 +1,6 @@ package network const ( - CHAIN_ID = "cheqd" - DID_NAMESPACE = "testnet" + ChainID = "cheqd" + DidNamespace = "testnet" ) diff --git a/tests/legacy/ibc-defi/hermes/hermes.Dockerfile b/tests/legacy/ibc-defi/hermes/hermes.Dockerfile deleted file mode 100644 index 7bd40b3fd..000000000 --- a/tests/legacy/ibc-defi/hermes/hermes.Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -##### Build container ##### - -FROM rust:buster as builder - -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends \ - curl \ - protobuf-compiler \ - libprotobuf-dev \ - wget \ - git - -WORKDIR /app - -RUN git clone --depth 1 --branch v0.15.0 https://github.com/informalsystems/ibc-rs - -WORKDIR /app/ibc-rs - -RUN cargo build --release --bin hermes - - -##### Run container ##### - -FROM debian:buster - -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends \ - libssl-dev \ - nano \ - curl \ - wget \ - netcat - -# Node binary -COPY --from=builder /app/ibc-rs/target/release/hermes /bin - -ARG USER=hermes -ARG GROUP=hermes - -ARG HOME=/home/$USER - -# User -RUN groupadd --system --gid 1000 $USER && \ - useradd --system --create-home --home-dir $HOME --shell /bin/bash --gid $GROUP --uid 1000 $USER - -WORKDIR $HOME - -RUN chown -R $USER $HOME -USER $USER - -ENTRYPOINT [ "hermes" ] diff --git a/tests/legacy/ibc-defi/osmosis/osmosis.Dockerfile b/tests/legacy/ibc-defi/osmosis/osmosis.Dockerfile deleted file mode 100644 index b0a21b4c1..000000000 --- a/tests/legacy/ibc-defi/osmosis/osmosis.Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM debian:buster - -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends \ - nano \ - curl \ - wget \ - netcat - -# Node binary -COPY --from=osmolabs/osmosis:10 /bin/osmosisd /bin/osmosisd - -ARG USER=osmosis -ARG GROUP=osmosis - -ARG HOME=/home/$USER - -# User -RUN groupadd --system --gid 1000 $USER && \ - useradd --system --create-home --home-dir $HOME --shell /bin/bash --gid $GROUP --uid 1000 $USER - -WORKDIR $HOME - -RUN chown -R $USER $HOME -USER $USER - - -ENTRYPOINT [ "osmosisd", "start" ] diff --git a/tests/upgrade/integration/cli/config.go b/tests/upgrade/integration/cli/config.go index e8a71adbf..02c7b9448 100644 --- a/tests/upgrade/integration/cli/config.go +++ b/tests/upgrade/integration/cli/config.go @@ -7,45 +7,45 @@ import ( ) const ( - CLI_BINARY_NAME = integrationcli.CLI_BINARY_NAME - GREEN = integrationcli.GREEN - PURPLE = integrationcli.PURPLE + CLIBinaryName = integrationcli.CliBinaryName + Green = integrationcli.Green + Purple = integrationcli.Purple ) const ( - CLI_BINARY_NAME_PREVIOUS = CLI_BINARY_NAME + "-previous" - CLI_BINARY_NAME_NEXT = CLI_BINARY_NAME + "-next" + CLIBinaryNamePrevious = CLIBinaryName + "-previous" + CLIBinaryNameNext = CLIBinaryName + "-next" ) const ( - KEYRING_BACKEND = integrationcli.KEYRING_BACKEND - OUTPUT_FORMAT = integrationcli.OUTPUT_FORMAT - GAS = integrationcli.GAS - GAS_ADJUSTMENT = integrationcli.GAS_ADJUSTMENT - GAS_PRICES = integrationcli.GAS_PRICES + KeyringBackend = integrationcli.KeyringBackend + OutputFormat = integrationcli.OutputFormat + Gas = integrationcli.Gas + GasAdjustment = integrationcli.GasAdjustment + GasPrices = integrationcli.GasPrices - BOOTSTRAP_PERIOD = 20 - BOOTSTRAP_HEIGHT = 1 - VOTING_PERIOD int64 = 10 - EXPECTED_BLOCK_SECONDS int64 = 1 - EXTRA_BLOCKS int64 = 5 - UPGRADE_NAME = cheqdapp.UpgradeName - DEPOSIT_AMOUNT = "10000000ncheq" - NETWORK_CONFIG_DIR = "network-config" - KEYRING_DIR = "keyring-test" + BootstrapPeriod = 20 + BootstrapHeight = 1 + VotingPeriod int64 = 10 + ExpectedBlockSeconds int64 = 1 + ExtraBlocks int64 = 5 + UpgradeName = cheqdapp.UpgradeName + DepositAmount = "10000000ncheq" + NetworkConfigDir = "network-config" + KeyringDir = "keyring-test" ) var ( - TX_PARAMS = []string{ - "--gas", GAS, - "--gas-adjustment", GAS_ADJUSTMENT, - "--gas-prices", GAS_PRICES, - "--keyring-backend", KEYRING_BACKEND, - "--chain-id", integrationnetwork.CHAIN_ID, + TXParams = []string{ + "--gas", Gas, + "--gas-adjustment", GasAdjustment, + "--gas-prices", GasPrices, + "--keyring-backend", KeyringBackend, + "--chain-id", integrationnetwork.ChainID, "-y", } - QUERY_PARAMS = []string{ - "--chain-id", integrationnetwork.CHAIN_ID, - "--output", OUTPUT_FORMAT, + QueryParamsConst = []string{ + "--chain-id", integrationnetwork.ChainID, + "--output", OutputFormat, } ) diff --git a/tests/upgrade/integration/cli/docker.go b/tests/upgrade/integration/cli/docker.go index d9c6ea203..b3405eb10 100644 --- a/tests/upgrade/integration/cli/docker.go +++ b/tests/upgrade/integration/cli/docker.go @@ -9,51 +9,51 @@ import ( ) const ( - DOCKER_LOCALNET_PATH = "../../../docker/localnet" - DOCKER_COMPOSE_FILE = "docker-compose.yml" - DOCKER_COMPOSE_ENV_ML = "mainnet-latest.env" - DOCKER_COMPOSE_ENV_BL = "build-latest.env" - DOCKER = "docker" - DOCKER_COMPOSE = "compose" - DOCKER_HOME = "/home/cheqd" - DOCKER_USER = "cheqd" - DOCKER_USER_GROUP = "cheqd" - OPERATOR0 = "operator-0" - OPERATOR1 = "operator-1" - OPERATOR2 = "operator-2" - OPERATOR3 = "operator-3" - VALIDATOR0 = "validator-0" - VALIDATOR1 = "validator-1" - VALIDATOR2 = "validator-2" - VALIDATOR3 = "validator-3" - VALIDATORS = 4 + DockerLocalnetPath = "../../../docker/localnet" + DockerComposeFile = "docker-compose.yml" + DockerComposeEnvML = "mainnet-latest.env" + DockerComposeEnvBL = "build-latest.env" + Docker = "docker" + DockerCompose = "compose" + DockerHome = "/home/cheqd" + DockerUser = "cheqd" + DockerUserGroup = "cheqd" + Operator0 = "operator-0" + Operator1 = "operator-1" + Operator2 = "operator-2" + Operator3 = "operator-3" + Validator0 = "validator-0" + Validator1 = "validator-1" + Validator2 = "validator-2" + Validator3 = "validator-3" + ValidatorsCount = 4 ) -type OperatorAccount map[string]string +type OperatorAccountType map[string]string -var OperatorAccounts OperatorAccount = OperatorAccount{ - VALIDATOR0: OPERATOR0, - VALIDATOR1: OPERATOR1, - VALIDATOR2: OPERATOR2, - VALIDATOR3: OPERATOR3, +var OperatorAccounts = OperatorAccountType{ + Validator0: Operator0, + Validator1: Operator1, + Validator2: Operator2, + Validator3: Operator3, } -var ValidatorNodes = []string{VALIDATOR0, VALIDATOR1, VALIDATOR2, VALIDATOR3} +var ValidatorNodes = []string{Validator0, Validator1, Validator2, Validator3} var ( - DOCKER_COMPOSE_LATEST_ARGS = []string{ - "-f", filepath.Join(DOCKER_LOCALNET_PATH, DOCKER_COMPOSE_FILE), - "--env-file", filepath.Join(DOCKER_LOCALNET_PATH, DOCKER_COMPOSE_ENV_ML), + DockerComposeLatestArgs = []string{ + "-f", filepath.Join(DockerLocalnetPath, DockerComposeFile), + "--env-file", filepath.Join(DockerLocalnetPath, DockerComposeEnvML), } - DOCKER_COMPOSE_BUILD_ARGS = []string{ - "-f", filepath.Join(DOCKER_LOCALNET_PATH, DOCKER_COMPOSE_FILE), - "--env-file", filepath.Join(DOCKER_LOCALNET_PATH, DOCKER_COMPOSE_ENV_BL), + DockerComposeBuildArgs = []string{ + "-f", filepath.Join(DockerLocalnetPath, DockerComposeFile), + "--env-file", filepath.Join(DockerLocalnetPath, DockerComposeEnvBL), } ) func LocalnetExec(envArgs []string, args ...string) (string, error) { - args = append(append([]string{DOCKER_COMPOSE}, envArgs...), args...) - cmd := exec.Command(DOCKER, args...) + args = append(append([]string{DockerCompose}, envArgs...), args...) + cmd := exec.Command(Docker, args...) out, err := cmd.CombinedOutput() if err != nil { return string(out), sdkerrors.Wrap(err, string(out)) @@ -63,19 +63,19 @@ func LocalnetExec(envArgs []string, args ...string) (string, error) { func LocalnetExecExec(container string, args ...string) (string, error) { args = append([]string{"exec", container}, args...) - return LocalnetExec(DOCKER_COMPOSE_LATEST_ARGS, args...) + return LocalnetExec(DockerComposeLatestArgs, args...) } func LocalnetExecUp() (string, error) { - return LocalnetExec(DOCKER_COMPOSE_LATEST_ARGS, "up", "--detach", "--no-build") + return LocalnetExec(DockerComposeLatestArgs, "up", "--detach", "--no-build") } func LocalnetExecDown() (string, error) { - return LocalnetExec(DOCKER_COMPOSE_LATEST_ARGS, "down") + return LocalnetExec(DockerComposeLatestArgs, "down") } func LocalnetExecCopyAbsoluteWithPermissions(path string, destination string, container string) (string, error) { - _, err := LocalnetExec(DOCKER_COMPOSE_LATEST_ARGS, "cp", path, filepath.Join(container+":"+destination)) + _, err := LocalnetExec(DockerComposeLatestArgs, "cp", path, container+":"+destination) if err != nil { fmt.Println("Error copying file to container: ", err) return "", err @@ -84,5 +84,5 @@ func LocalnetExecCopyAbsoluteWithPermissions(path string, destination string, co } func LocalnetExecRestorePermissions(path string, container string) (string, error) { - return LocalnetExec(DOCKER_COMPOSE_LATEST_ARGS, "exec", "-it", "--user", "root", container, "chown", "-R", DOCKER_USER+":"+DOCKER_USER_GROUP, path) + return LocalnetExec(DockerComposeLatestArgs, "exec", "-it", "--user", "root", container, "chown", "-R", DockerUser+":"+DockerUserGroup, path) } diff --git a/tests/upgrade/integration/cli/helpers.go b/tests/upgrade/integration/cli/helpers.go index 208fd0feb..66038d017 100644 --- a/tests/upgrade/integration/cli/helpers.go +++ b/tests/upgrade/integration/cli/helpers.go @@ -93,7 +93,7 @@ func GetCurrentBlockHeight(container string, binary string) (int64, error) { } func GetVotingEndHeight(currentHeight int64) (int64, error) { - return currentHeight + VOTING_PERIOD/EXPECTED_BLOCK_SECONDS + EXTRA_BLOCKS, nil + return currentHeight + VotingPeriod/ExpectedBlockSeconds + ExtraBlocks, nil } func CalculateUpgradeHeight(container string, binary string) (int64, int64, error) { @@ -105,7 +105,7 @@ func CalculateUpgradeHeight(container string, binary string) (int64, int64, erro if err != nil { return 0, 0, err } - return currentHeight + VOTING_PERIOD/EXPECTED_BLOCK_SECONDS + EXTRA_BLOCKS*2, votingEndHeight, nil + return currentHeight + VotingPeriod/ExpectedBlockSeconds + ExtraBlocks*2, votingEndHeight, nil } // Added to wait for the upgrade to be applied. @@ -203,10 +203,11 @@ func TrimExtraLineOffset(input string, offset int) string { func MakeCodecWithExtendedRegistry() codec.Codec { interfaceRegistry := types.NewInterfaceRegistry() + // TODO: Remove nolint after cheqd-node release v1.x is successful // Register the interfaces from the cosmos-sdk codebase. interfaceRegistry.RegisterImplementations( (*govtypesv1beta1.Content)(nil), - // nolint: staticcheck + //nolint: staticcheck &upgradetypes.SoftwareUpgradeProposal{}, ¶mproposal.ParameterChangeProposal{}, ) diff --git a/tests/upgrade/integration/cli/query.go b/tests/upgrade/integration/cli/query.go index e0a17b2a0..3255799db 100644 --- a/tests/upgrade/integration/cli/query.go +++ b/tests/upgrade/integration/cli/query.go @@ -20,7 +20,7 @@ func Query(container string, binary string, module, query string, queryArgs ...s } args = append(args, queryArgs...) - args = append(args, QUERY_PARAMS...) + args = append(args, QueryParamsConst...) return LocalnetExecExec(container, args...) } @@ -28,9 +28,9 @@ func Query(container string, binary string, module, query string, queryArgs ...s func QueryModuleVersionMap(container string) (upgradetypes.QueryModuleVersionsResponse, error) { fmt.Println("Querying module version map from", container) args := append([]string{ - CLI_BINARY_NAME, + CLIBinaryName, "query", "upgrade", "module_versions", - }, QUERY_PARAMS...) + }, QueryParamsConst...) out, err := LocalnetExecExec(container, args...) if err != nil { @@ -52,9 +52,9 @@ func QueryModuleVersionMap(container string) (upgradetypes.QueryModuleVersionsRe func QueryParams(container, subspace, key string) (paramproposal.ParamChange, error) { fmt.Println("Querying params from", container) args := append([]string{ - CLI_BINARY_NAME, + CLIBinaryName, "query", "params", "subspace", subspace, key, - }, QUERY_PARAMS...) + }, QueryParamsConst...) out, err := LocalnetExecExec(container, args...) if err != nil { @@ -108,9 +108,9 @@ func QueryResourceFeeParams(container, subspace, key string) (resourcetypes.FeeP func QueryProposalLegacy(container, id string) (govtypesv1beta1.Proposal, error) { fmt.Println("Querying proposal from", container) args := append([]string{ - CLI_BINARY_NAME, + CLIBinaryName, "query", "gov", "proposal", id, - }, QUERY_PARAMS...) + }, QueryParamsConst...) out, err := LocalnetExecExec(container, args...) if err != nil { @@ -131,9 +131,9 @@ func QueryProposalLegacy(container, id string) (govtypesv1beta1.Proposal, error) func QueryProposal(container, id string) (govtypesv1.Proposal, error) { fmt.Println("Querying proposal from", container) args := append([]string{ - CLI_BINARY_NAME, + CLIBinaryName, "query", "gov", "proposal", id, - }, QUERY_PARAMS...) + }, QueryParamsConst...) out, err := LocalnetExecExec(container, args...) if err != nil { diff --git a/tests/upgrade/integration/cli/query_did.go b/tests/upgrade/integration/cli/query_did.go index 8bf2f0075..a3bee9060 100644 --- a/tests/upgrade/integration/cli/query_did.go +++ b/tests/upgrade/integration/cli/query_did.go @@ -7,7 +7,7 @@ import ( ) func QueryDidLegacy(did string, container string) (didtypesv1.QueryGetDidResponse, error) { - res, err := Query(container, CLI_BINARY_NAME, "cheqd", "did", did) + res, err := Query(container, CLIBinaryName, "cheqd", "did", did) if err != nil { return didtypesv1.QueryGetDidResponse{}, err } @@ -21,16 +21,16 @@ func QueryDidLegacy(did string, container string) (didtypesv1.QueryGetDidRespons return resp, nil } -func QueryDid(did string, container string) (didtypesv2.QueryGetDidDocResponse, error) { - res, err := Query(container, CLI_BINARY_NAME, "cheqd", "did-document", did) +func QueryDid(did string, container string) (didtypesv2.QueryDidDocResponse, error) { + res, err := Query(container, CLIBinaryName, "cheqd", "did-document", did) if err != nil { - return didtypesv2.QueryGetDidDocResponse{}, err + return didtypesv2.QueryDidDocResponse{}, err } - var resp didtypesv2.QueryGetDidDocResponse + var resp didtypesv2.QueryDidDocResponse err = integrationhelpers.Codec.UnmarshalJSON([]byte(res), &resp) if err != nil { - return didtypesv2.QueryGetDidDocResponse{}, err + return didtypesv2.QueryDidDocResponse{}, err } return resp, nil diff --git a/tests/upgrade/integration/cli/query_resource.go b/tests/upgrade/integration/cli/query_resource.go index 0e2fb629c..c4c56c21b 100644 --- a/tests/upgrade/integration/cli/query_resource.go +++ b/tests/upgrade/integration/cli/query_resource.go @@ -6,31 +6,31 @@ import ( resourcetypesv1 "github.com/cheqd/cheqd-node/x/resource/types/v1" ) -func QueryResourceLegacy(collectionId string, resourceId string, container string) (resourcetypesv1.QueryGetResourceResponse, error) { - res, err := Query(container, CLI_BINARY_NAME, "resource", "resource", collectionId, resourceId) +func QueryResourceLegacy(collectionID string, resourceID string, container string) (resourcetypesv1.QueryResourceResponse, error) { + res, err := Query(container, CLIBinaryName, "resource", "resource", collectionID, resourceID) if err != nil { - return resourcetypesv1.QueryGetResourceResponse{}, err + return resourcetypesv1.QueryResourceResponse{}, err } - var resp resourcetypesv1.QueryGetResourceResponse + var resp resourcetypesv1.QueryResourceResponse err = integrationhelpers.Codec.UnmarshalJSON([]byte(res), &resp) if err != nil { - return resourcetypesv1.QueryGetResourceResponse{}, err + return resourcetypesv1.QueryResourceResponse{}, err } return resp, nil } -func QueryResource(collectionId string, resourceId string, container string) (resourcetypesv2.QueryGetResourceResponse, error) { - res, err := Query(container, CLI_BINARY_NAME, "resource", "resource", collectionId, resourceId) +func QueryResource(collectionID string, resourceID string, container string) (resourcetypesv2.QueryResourceResponse, error) { + res, err := Query(container, CLIBinaryName, "resource", "resource", collectionID, resourceID) if err != nil { - return resourcetypesv2.QueryGetResourceResponse{}, err + return resourcetypesv2.QueryResourceResponse{}, err } - var resp resourcetypesv2.QueryGetResourceResponse + var resp resourcetypesv2.QueryResourceResponse err = integrationhelpers.Codec.UnmarshalJSON([]byte(res), &resp) if err != nil { - return resourcetypesv2.QueryGetResourceResponse{}, err + return resourcetypesv2.QueryResourceResponse{}, err } return resp, nil diff --git a/tests/upgrade/integration/cli/tx.go b/tests/upgrade/integration/cli/tx.go index b60eae0e6..aa027a697 100644 --- a/tests/upgrade/integration/cli/tx.go +++ b/tests/upgrade/integration/cli/tx.go @@ -18,7 +18,7 @@ func Tx(container string, binary string, module, tx, from string, txArgs ...stri } // Common params - args = append(args, TX_PARAMS...) + args = append(args, TXParams...) // Cosmos account args = append(args, "--from", from) @@ -47,10 +47,10 @@ func Tx(container string, binary string, module, tx, from string, txArgs ...stri func SubmitParamChangeProposal(container string, pathToDir ...string) (sdk.TxResponse, error) { fmt.Println("Submitting param change proposal from", container) args := append([]string{ - CLI_BINARY_NAME, + CLIBinaryName, "tx", "gov", "submit-legacy-proposal", "param-change", filepath.Join(pathToDir...), "--from", OperatorAccounts[container], - }, TX_PARAMS...) + }, TXParams...) out, err := LocalnetExecExec(container, args...) if err != nil { @@ -76,15 +76,15 @@ func SubmitParamChangeProposal(container string, pathToDir ...string) (sdk.TxRes func SubmitUpgradeProposal(upgradeHeight int64, container string) (sdk.TxResponse, error) { fmt.Println("Submitting upgrade proposal from", container) args := append([]string{ - CLI_BINARY_NAME, + CLIBinaryName, "tx", "gov", "submit-proposal", "software-upgrade", - UPGRADE_NAME, + UpgradeName, "--title", "Upgrade Title", "--description", "Upgrade Description", "--upgrade-height", strconv.FormatInt(upgradeHeight, 10), "--upgrade-info", "Upgrade Info", "--from", OperatorAccounts[container], - }, TX_PARAMS...) + }, TXParams...) out, err := LocalnetExecExec(container, args...) if err != nil { @@ -107,10 +107,10 @@ func SubmitUpgradeProposal(upgradeHeight int64, container string) (sdk.TxRespons func DepositGov(container string) (sdk.TxResponse, error) { fmt.Println("Depositing from", container) args := append([]string{ - CLI_BINARY_NAME, - "tx", "gov", "deposit", "1", DEPOSIT_AMOUNT, + CLIBinaryName, + "tx", "gov", "deposit", "1", DepositAmount, "--from", OperatorAccounts[container], - }, TX_PARAMS...) + }, TXParams...) out, err := LocalnetExecExec(container, args...) if err != nil { @@ -132,10 +132,10 @@ func DepositGov(container string) (sdk.TxResponse, error) { func VoteProposal(container, id, option string) (sdk.TxResponse, error) { fmt.Println("Voting from", container) args := append([]string{ - CLI_BINARY_NAME, + CLIBinaryName, "tx", "gov", "vote", id, option, "--from", OperatorAccounts[container], - }, TX_PARAMS...) + }, TXParams...) out, err := LocalnetExecExec(container, args...) if err != nil { diff --git a/tests/upgrade/integration/cli/tx_did.go b/tests/upgrade/integration/cli/tx_did.go index dd1ff2055..d7672210b 100644 --- a/tests/upgrade/integration/cli/tx_did.go +++ b/tests/upgrade/integration/cli/tx_did.go @@ -13,35 +13,35 @@ import ( ) func CreateDidLegacy(payload didtypesv1.MsgCreateDidPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { - payloadJson, err := integrationhelpers.Codec.MarshalJSON(&payload) + payloadJSON, err := integrationhelpers.Codec.MarshalJSON(&payload) if err != nil { return sdk.TxResponse{}, err } - args := []string{string(payloadJson)} + args := []string{string(payloadJSON)} for _, signInput := range signInputs { - args = append(args, signInput.VerificationMethodId) + args = append(args, signInput.VerificationMethodID) args = append(args, base64.StdEncoding.EncodeToString(signInput.PrivKey)) } - return Tx(container, CLI_BINARY_NAME, "cheqd", "create-did", OperatorAccounts[container], args...) + return Tx(container, CLIBinaryName, "cheqd", "create-did", OperatorAccounts[container], args...) } func CreateDid(payload didtypesv2.MsgCreateDidDocPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { - innerPayloadJson := integrationhelpers.Codec.MustMarshalJSON(&payload) + innerPayloadJSON := integrationhelpers.Codec.MustMarshalJSON(&payload) outerPayload := cli.PayloadWithSignInputs{ - Payload: innerPayloadJson, + Payload: innerPayloadJSON, SignInputs: signInputs, } - outerPayloadJson, err := json.Marshal(&outerPayload) + outerPayloadJSON, err := json.Marshal(&outerPayload) if err != nil { return sdk.TxResponse{}, err } - out, err := LocalnetExecExec(container, "/bin/bash", "-c", "echo '"+string(outerPayloadJson)+"' > payload.json") + out, err := LocalnetExecExec(container, "/bin/bash", "-c", "echo '"+string(outerPayloadJSON)+"' > payload.json") if err != nil { return sdk.TxResponse{}, err } @@ -50,39 +50,39 @@ func CreateDid(payload didtypesv2.MsgCreateDidDocPayload, signInputs []cli.SignI args := []string{string("payload.json")} - return Tx(container, CLI_BINARY_NAME, "cheqd", "create-did", OperatorAccounts[container], args...) + return Tx(container, CLIBinaryName, "cheqd", "create-did", OperatorAccounts[container], args...) } func UpdateDidLegacy(payload didtypesv1.MsgUpdateDidPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { - payloadJson, err := integrationhelpers.Codec.MarshalJSON(&payload) + payloadJSON, err := integrationhelpers.Codec.MarshalJSON(&payload) if err != nil { return sdk.TxResponse{}, err } - args := []string{string(payloadJson)} + args := []string{string(payloadJSON)} for _, signInput := range signInputs { - args = append(args, signInput.VerificationMethodId) + args = append(args, signInput.VerificationMethodID) args = append(args, base64.StdEncoding.EncodeToString(signInput.PrivKey)) } - return Tx(container, CLI_BINARY_NAME, "cheqd", "update-did", OperatorAccounts[container], args...) + return Tx(container, CLIBinaryName, "cheqd", "update-did", OperatorAccounts[container], args...) } func UpdateDid(payload didtypesv2.MsgUpdateDidDocPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { - innerPayloadJson := integrationhelpers.Codec.MustMarshalJSON(&payload) + innerPayloadJSON := integrationhelpers.Codec.MustMarshalJSON(&payload) outerPayload := cli.PayloadWithSignInputs{ - Payload: innerPayloadJson, + Payload: innerPayloadJSON, SignInputs: signInputs, } - outerPayloadJson, err := json.Marshal(&outerPayload) + outerPayloadJSON, err := json.Marshal(&outerPayload) if err != nil { return sdk.TxResponse{}, err } - out, err := LocalnetExecExec(container, "/bin/bash", "-c", "echo '"+string(outerPayloadJson)+"' > payload.json") + out, err := LocalnetExecExec(container, "/bin/bash", "-c", "echo '"+string(outerPayloadJSON)+"' > payload.json") if err != nil { return sdk.TxResponse{}, err } @@ -91,39 +91,39 @@ func UpdateDid(payload didtypesv2.MsgUpdateDidDocPayload, signInputs []cli.SignI args := []string{string("payload.json")} - return Tx(container, CLI_BINARY_NAME, "cheqd", "update-did", OperatorAccounts[container], args...) + return Tx(container, CLIBinaryName, "cheqd", "update-did", OperatorAccounts[container], args...) } func DeactivateDidLegacy(payload didtypesv1.MsgDeactivateDidPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { - payloadJson, err := integrationhelpers.Codec.MarshalJSON(&payload) + payloadJSON, err := integrationhelpers.Codec.MarshalJSON(&payload) if err != nil { return sdk.TxResponse{}, err } - args := []string{string(payloadJson)} + args := []string{string(payloadJSON)} for _, signInput := range signInputs { - args = append(args, signInput.VerificationMethodId) + args = append(args, signInput.VerificationMethodID) args = append(args, base64.StdEncoding.EncodeToString(signInput.PrivKey)) } - return Tx(container, CLI_BINARY_NAME, "cheqd", "deactivate-did", OperatorAccounts[container], args...) + return Tx(container, CLIBinaryName, "cheqd", "deactivate-did", OperatorAccounts[container], args...) } func DeactivateDid(payload didtypesv2.MsgDeactivateDidDocPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { - innerPayloadJson := integrationhelpers.Codec.MustMarshalJSON(&payload) + innerPayloadJSON := integrationhelpers.Codec.MustMarshalJSON(&payload) outerPayload := cli.PayloadWithSignInputs{ - Payload: innerPayloadJson, + Payload: innerPayloadJSON, SignInputs: signInputs, } - outerPayloadJson, err := json.Marshal(&outerPayload) + outerPayloadJSON, err := json.Marshal(&outerPayload) if err != nil { return sdk.TxResponse{}, err } - out, err := LocalnetExecExec(container, "/bin/bash", "-c", "echo '"+string(outerPayloadJson)+"' > payload.json") + out, err := LocalnetExecExec(container, "/bin/bash", "-c", "echo '"+string(outerPayloadJSON)+"' > payload.json") if err != nil { return sdk.TxResponse{}, err } @@ -132,5 +132,5 @@ func DeactivateDid(payload didtypesv2.MsgDeactivateDidDocPayload, signInputs []c args := []string{string("payload.json")} - return Tx(container, CLI_BINARY_NAME, "cheqd", "deactivate-did", OperatorAccounts[container], args...) + return Tx(container, CLIBinaryName, "cheqd", "deactivate-did", OperatorAccounts[container], args...) } diff --git a/tests/upgrade/integration/cli/tx_resource.go b/tests/upgrade/integration/cli/tx_resource.go index c9d97a742..c67d8c25f 100644 --- a/tests/upgrade/integration/cli/tx_resource.go +++ b/tests/upgrade/integration/cli/tx_resource.go @@ -13,8 +13,8 @@ import ( ) type CreateResourceOptions struct { - CollectionId string `json:"collection_id"` - ResourceId string `json:"resource_id"` + CollectionID string `json:"collection_id"` + ResourceID string `json:"resource_id"` ResourceName string `json:"resource_name"` ResourceVersion string `json:"resource_version"` ResourceType string `json:"resource_type"` @@ -22,21 +22,21 @@ type CreateResourceOptions struct { AlsoKnownAs []*types.AlternativeUri `json:"also_known_as"` } -func CreateResourceLegacy(collectionId string, resourceId string, resourceName string, resourceType string, resourceFile string, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { +func CreateResourceLegacy(collectionID string, resourceID string, resourceName string, resourceType string, resourceFile string, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { args := []string{ - "--collection-id", collectionId, - "--resource-id", resourceId, + "--collection-id", collectionID, + "--resource-id", resourceID, "--resource-name", resourceName, "--resource-type", resourceType, "--resource-file", resourceFile, } for _, signInput := range signInputs { - args = append(args, signInput.VerificationMethodId) + args = append(args, signInput.VerificationMethodID) args = append(args, base64.StdEncoding.EncodeToString(signInput.PrivKey)) } - return Tx(container, CLI_BINARY_NAME, "resource", "create-resource", OperatorAccounts[container], args...) + return Tx(container, CLIBinaryName, "resource", "create-resource", OperatorAccounts[container], args...) } func CreateResource(msg types.MsgCreateResourcePayload, resourceFile string, signInputs []cli.SignInput, container string) (sdk.TxResponse, error) { @@ -44,8 +44,8 @@ func CreateResource(msg types.MsgCreateResourcePayload, resourceFile string, sig payloadFileName := "payload.json" resourceOptions := CreateResourceOptions{ - CollectionId: msg.CollectionId, - ResourceId: msg.Id, + CollectionID: msg.CollectionId, + ResourceID: msg.Id, ResourceName: msg.Name, ResourceVersion: msg.Version, ResourceType: msg.ResourceType, @@ -53,22 +53,22 @@ func CreateResource(msg types.MsgCreateResourcePayload, resourceFile string, sig AlsoKnownAs: msg.AlsoKnownAs, } - payloadJson, err := json.Marshal(&resourceOptions) + payloadJSON, err := json.Marshal(&resourceOptions) if err != nil { return sdk.TxResponse{}, err } payloadWithSignInputs := cli.PayloadWithSignInputs{ - Payload: payloadJson, + Payload: payloadJSON, SignInputs: signInputs, } - payloadWithSignInputsJson, err := json.Marshal(&payloadWithSignInputs) + payloadWithSignInputsJSON, err := json.Marshal(&payloadWithSignInputs) if err != nil { return sdk.TxResponse{}, err } - _, err = LocalnetExecExec(container, "/bin/bash", "-c", "echo '"+string(payloadWithSignInputsJson)+"' > "+payloadFileName) + _, err = LocalnetExecExec(container, "/bin/bash", "-c", "echo '"+string(payloadWithSignInputsJSON)+"' > "+payloadFileName) if err != nil { return sdk.TxResponse{}, err } @@ -78,5 +78,5 @@ func CreateResource(msg types.MsgCreateResourcePayload, resourceFile string, sig return sdk.TxResponse{}, err } - return Tx(container, CLI_BINARY_NAME, "resource", "create", OperatorAccounts[container], payloadFileName) + return Tx(container, CLIBinaryName, "resource", "create", OperatorAccounts[container], payloadFileName) } diff --git a/tests/upgrade/integration/config.go b/tests/upgrade/integration/config.go index 026d2b416..fcba98b0e 100644 --- a/tests/upgrade/integration/config.go +++ b/tests/upgrade/integration/config.go @@ -1,6 +1,6 @@ package integration const ( - GENERATED_JSON_DIR = "generated" - PROPOSAL_JSON_DIR = "proposal" + GeneratedJSONDir = "generated" + ProposalJSONDir = "proposal" ) diff --git a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_indy_16.json b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_indy_16.json index d72f9f6d0..d9e220b8b 100644 --- a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_indy_16.json +++ b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_indy_16.json @@ -11,21 +11,21 @@ "verification_method": [ { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg", - "verification_material": "{\"publicKeyMultibase\":\"zBNy7xYrzNb25mbVFP5hVZXwJZ7RD16yJSoya82qe3Jra\"}" + "verification_material": "z6MkpqEAYo7Ri8WYt6Kx4efLQdVJNgh4QzDf8ptVxJoexXdx" }, { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg", - "verification_material": "{\"publicKeyMultibase\":\"zC4mnpocVYbywi32srkHzRdy7LEXQG4TM8YtCTPXWnza1\"}" + "verification_material": "z6MkqX2qR3rvt9UQpXsaYKFqGjX79ooFfwhhpZo8HfVXiDMP" }, { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg", - "verification_material": "{\"publicKeyMultibase\":\"zC1CAqqp2tQooisYtTh1oULGzKyRNQbsUtyqoh2neWPta\"}" + "verification_material": "z6MkqTTDS64UDxJGqNPb9FyeKRpz9YhDpV7qazkjXJkfRcfx" } ], "authentication": [ @@ -45,14 +45,14 @@ "service": [ { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] }, { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#service-2", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-2" ] @@ -61,5 +61,5 @@ "also_known_as": [ "alias-3" ] - } + } } \ No newline at end of file diff --git a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_indy_32.json b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_indy_32.json index fe3abf03d..58f05c605 100644 --- a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_indy_32.json +++ b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_indy_32.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b", - "verification_material": "{\"publicKeyMultibase\":\"zEZ673G4y1tzG7ceqH9frgj2hJj14EiDjho3BwC9hcuz8\"}" + "verification_material": "z6Mkt1M9dWKQMSUjE7VXxidhXpah8JGuebU6Pox7mU7iY8mW" }, { "id": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b", - "verification_material": "{\"publicKeyMultibase\":\"z9uXTvgTyWZjr79CVgkgdzRSzApn7x4asDDMqDDro8D3k\"}" + "verification_material": "z6MkoMnWWviQr7EKDe3CNKeUqWzyzQ3yMwqDuEGm3Vpp3Rq8" }, { "id": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b", - "verification_material": "{\"publicKeyMultibase\":\"zCnaC3GEjg3dmGPGo3svUw8Lytu3HWJGpTVsVXnBUQJca\"}" + "verification_material": "z6MkrEqEdWVB1b8ENt7VjStKnDtyiUK8vBXB9WnRN49VKXPx" }, { "id": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b", - "verification_material": "{\"publicKeyMultibase\":\"z6yL88rhPLU4nFAUGLv1VLiTTXnV4At64PPJwCrEHjTw\"}" + "verification_material": "z6MkeZENiP78isxXtk1AwusrLSGTH74LU48SkQJEmUpFCxFK" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:Nqoxg85PKyr9nPstjTpg5b#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_lowcase.json b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_lowcase.json index 1b3392f40..9cf3b8454 100644 --- a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_lowcase.json +++ b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_lowcase.json @@ -12,27 +12,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554", - "verification_material": "{\"publicKeyMultibase\":\"z6nExc7qoYEoDd2DRrMpBv5ShXHYZQL3LTi2twgTm79bL\"}" + "verification_material": "z6MkkEW1CN6EsnHgjX48Xvn2mAzhLrpQpDHh9iwpmxRn2NNi" }, { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554", - "verification_material": "{\"publicKeyMultibase\":\"z8GnprPBEuoBvYqJD4RbUhoFSrZMzH6rffRvCmNzEBxDT\"}" + "verification_material": "z6Mkmj3sSdRgFLgPfL8ujzZKYtoSg8dqgz72MSq8bexF7Azq" }, { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554", - "verification_material": "{\"publicKeyMultibase\":\"z8iREaP6YKkK77MxojoyAgcnuJAC9reQq6mMJuxxCK523\"}" + "verification_material": "z6MknAgHAdLyfHoaDroWRNw1XiLu7jU1GXfBnnGEkEvDEHoR" }, { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554", - "verification_material": "{\"publicKeyMultibase\":\"z4GCBhVhbx2ZgF1hMT2Zt3f9x17LqeR4jb83QXehsMCvt\"}" + "verification_material": "z6MkhiTEHjx3Ha49MWY48bXitkhwpgch4JK6H8xLMvftGRiG" } ], "authentication": [ @@ -43,14 +43,14 @@ "service": [ { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] }, { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#service-2", - "type": "type-2", + "serviceType": "type-2", "service_endpoint": [ "endpoint-2" ] diff --git a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_mixed.json b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_mixed.json index a8ac22412..fb45f05b4 100644 --- a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_mixed.json +++ b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_mixed.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04", - "verification_material": "{\"publicKeyMultibase\":\"z2Ebg35RKmCM4SKYBkNNiHqbK5ypdAUcjsKyLum1zpCr4\"}" + "verification_material": "z6MkfgridKfm6jqXYpNtRwLZ8w9JuZ6UaMs6ZLtGk2z1jRdS" }, { "id": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04", - "verification_material": "{\"publicKeyMultibase\":\"z2j417oT5Pyha2XKK4xYsgBv8u5pFk7HFDzbCbRUgZfc6\"}" + "verification_material": "z6MkgBK3i3hWjXC392A1kXWiXHU8if679zXbv1W8RhShUtPU" }, { "id": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04", - "verification_material": "{\"publicKeyMultibase\":\"z7THeYhdHGDHnVrffBsuXyoRKKyBZgwNjX4PYL25cEk1L\"}" + "verification_material": "z6MkkuYh8wsibknFcMWMsSsNptyK9YTR6pd6D5JUAJ3d9xni" }, { "id": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04", - "verification_material": "{\"publicKeyMultibase\":\"zYnoDoX5wcCKEq6ZRRkS42jigYTSEn8DNvDnWmQadtsJ\"}" + "verification_material": "z6Mkf13qp3mXH9gnMKwG6ziGu8HiW7jHefNa4w8iM3NbZ7eg" } ], "assertion_method": [ @@ -46,21 +46,21 @@ "service": [ { "id": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] }, { "id": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04#service-2", - "type": "type-2", + "serviceType": "type-2", "service_endpoint": [ "endpoint-2" ] }, { "id": "did:cheqd:testnet:85d9e742-be4d-59e8-9b10-5449db2e2d04#service-3", - "type": "type-3", + "serviceType": "type-3", "service_endpoint": [ "endpoint-3" ] diff --git a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_uppercase.json b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_uppercase.json index 0c54b7ba2..b911b59d3 100644 --- a/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_uppercase.json +++ b/tests/upgrade/integration/generated/post/query - diddoc/diddoc_uuid_uppercase.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4", - "verification_material": "{\"publicKeyMultibase\":\"z3RFgcpLEM8oRi2DoK3B1FCSTAfCBKjZvBkzuxcBV4TNM\"}" + "verification_material": "z6MkgsWjD4afggHtpX4Vzc8r6HzSzEU2jcpGsmuqnt9Vyg9j" }, { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4", - "verification_material": "{\"publicKeyMultibase\":\"z7JQKofgkaFFpjqJAKNWtFSKVv8kkLHhvErcNx7A6VL8p\"}" + "verification_material": "z6MkkkfNPuwBunkHrL8rzwUj6XsVji2bkAxGvsXJnP87QYvC" }, { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4", - "verification_material": "{\"publicKeyMultibase\":\"z9X6yXQoNcdZD1zvpuWpicviFnqMvwaziuGbcRnBAVY3y\"}" + "verification_material": "z6MknyN27f3oxB3g8VmXb5nZU2GFcQdnMUF5bHWYG49BQkqM" }, { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4", - "verification_material": "{\"publicKeyMultibase\":\"zHkQBWRFoUUizMNscNNGQhMhtt2zMK6UV4YFJ9aeBfZbj\"}" + "verification_material": "z6MkwCfE6fWEp2DTTsiK3wEFYTFthcGCiyiqkZADyrcCanP7" } ], "authentication": [ @@ -55,7 +55,7 @@ "service": [ { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/integration/generated/post/query - module-version-map/v1.json b/tests/upgrade/integration/generated/post/query - module-version-map/v1.json index c9379d945..665c63bb5 100644 --- a/tests/upgrade/integration/generated/post/query - module-version-map/v1.json +++ b/tests/upgrade/integration/generated/post/query - module-version-map/v1.json @@ -59,7 +59,7 @@ }, { "name": "interchainaccounts", - "version": 1 + "version": 2 }, { "name": "mint", diff --git a/tests/upgrade/integration/generated/post/update - diddoc/diddoc_indy_16.json b/tests/upgrade/integration/generated/post/update - diddoc/diddoc_indy_16.json index 6b0227919..1c9c7dbc8 100644 --- a/tests/upgrade/integration/generated/post/update - diddoc/diddoc_indy_16.json +++ b/tests/upgrade/integration/generated/post/update - diddoc/diddoc_indy_16.json @@ -11,21 +11,21 @@ "verification_method": [ { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg", - "verification_material": "{\"publicKeyMultibase\":\"zBNy7xYrzNb25mbVFP5hVZXwJZ7RD16yJSoya82qe3Jra\"}" + "verification_material": "z6MkpqEAYo7Ri8WYt6Kx4efLQdVJNgh4QzDf8ptVxJoexXdx" }, { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg", - "verification_material": "{\"publicKeyMultibase\":\"zC4mnpocVYbywi32srkHzRdy7LEXQG4TM8YtCTPXWnza1\"}" + "verification_material": "z6MkqX2qR3rvt9UQpXsaYKFqGjX79ooFfwhhpZo8HfVXiDMP" }, { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg", - "verification_material": "{\"publicKeyMultibase\":\"zC1CAqqp2tQooisYtTh1oULGzKyRNQbsUtyqoh2neWPta\"}" + "verification_material": "z6MkqTTDS64UDxJGqNPb9FyeKRpz9YhDpV7qazkjXJkfRcfx" } ], "authentication": [ @@ -45,14 +45,14 @@ "service": [ { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] }, { "id": "did:cheqd:testnet:5rjaLzcffhGUH4nt4fyfAg#service-2", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-2" ] diff --git a/tests/upgrade/integration/generated/post/update - diddoc/diddoc_uuid_lowcase.json b/tests/upgrade/integration/generated/post/update - diddoc/diddoc_uuid_lowcase.json index e0980ec47..5c3d835b3 100644 --- a/tests/upgrade/integration/generated/post/update - diddoc/diddoc_uuid_lowcase.json +++ b/tests/upgrade/integration/generated/post/update - diddoc/diddoc_uuid_lowcase.json @@ -12,27 +12,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554", - "verification_material": "{\"publicKeyMultibase\":\"z6nExc7qoYEoDd2DRrMpBv5ShXHYZQL3LTi2twgTm79bL\"}" + "verification_material": "z6MkkEW1CN6EsnHgjX48Xvn2mAzhLrpQpDHh9iwpmxRn2NNi" }, { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554", - "verification_material": "{\"publicKeyMultibase\":\"z8GnprPBEuoBvYqJD4RbUhoFSrZMzH6rffRvCmNzEBxDT\"}" + "verification_material": "z6Mkmj3sSdRgFLgPfL8ujzZKYtoSg8dqgz72MSq8bexF7Azq" }, { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554", - "verification_material": "{\"publicKeyMultibase\":\"z8iREaP6YKkK77MxojoyAgcnuJAC9reQq6mMJuxxCK523\"}" + "verification_material": "z6MknAgHAdLyfHoaDroWRNw1XiLu7jU1GXfBnnGEkEvDEHoR" }, { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554", - "verification_material": "{\"publicKeyMultibase\":\"z4GCBhVhbx2ZgF1hMT2Zt3f9x17LqeR4jb83QXehsMCvt\"}" + "verification_material": "z6MkhiTEHjx3Ha49MWY48bXitkhwpgch4JK6H8xLMvftGRiG" } ], "authentication": [ @@ -43,14 +43,14 @@ "service": [ { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] }, { "id": "did:cheqd:testnet:2e5ca092-8264-47c7-9216-8b36e01e5554#service-2", - "type": "type-2", + "serviceType": "type-2", "service_endpoint": [ "endpoint-2" ] diff --git a/tests/upgrade/integration/generated/post/update - diddoc/diddoc_uuid_uppercase.json b/tests/upgrade/integration/generated/post/update - diddoc/diddoc_uuid_uppercase.json index b999a40b5..9da847232 100644 --- a/tests/upgrade/integration/generated/post/update - diddoc/diddoc_uuid_uppercase.json +++ b/tests/upgrade/integration/generated/post/update - diddoc/diddoc_uuid_uppercase.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4", - "verification_material": "{\"publicKeyMultibase\":\"z3RFgcpLEM8oRi2DoK3B1FCSTAfCBKjZvBkzuxcBV4TNM\"}" + "verification_material": "z6MkgsWjD4afggHtpX4Vzc8r6HzSzEU2jcpGsmuqnt9Vyg9j" }, { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4", - "verification_material": "{\"publicKeyMultibase\":\"z7JQKofgkaFFpjqJAKNWtFSKVv8kkLHhvErcNx7A6VL8p\"}" + "verification_material": "z6MkkkfNPuwBunkHrL8rzwUj6XsVji2bkAxGvsXJnP87QYvC" }, { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4", - "verification_material": "{\"publicKeyMultibase\":\"z9X6yXQoNcdZD1zvpuWpicviFnqMvwaziuGbcRnBAVY3y\"}" + "verification_material": "z6MknyN27f3oxB3g8VmXb5nZU2GFcQdnMUF5bHWYG49BQkqM" }, { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4", - "verification_material": "{\"publicKeyMultibase\":\"zHkQBWRFoUUizMNscNNGQhMhtt2zMK6UV4YFJ9aeBfZbj\"}" + "verification_material": "z6MkwCfE6fWEp2DTTsiK3wEFYTFthcGCiyiqkZADyrcCanP7" } ], "authentication": [ @@ -55,7 +55,7 @@ "service": [ { "id": "did:cheqd:testnet:91e5f0cf-5f1e-5c19-97d3-d313e84033b4#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/integration/generated/pre/create - diddoc/diddoc_uuid_uppercase.json b/tests/upgrade/integration/generated/pre/create - diddoc/diddoc_uuid_uppercase.json index d15a161ae..96f5587e9 100644 --- a/tests/upgrade/integration/generated/pre/create - diddoc/diddoc_uuid_uppercase.json +++ b/tests/upgrade/integration/generated/pre/create - diddoc/diddoc_uuid_uppercase.json @@ -13,24 +13,28 @@ "id": "did:cheqd:testnet:45465F44-A45C-4B91-8C21-9AF6C0E33137#key-1", "type": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:45465F44-A45C-4B91-8C21-9AF6C0E33137", + "public_key_jwk": [], "public_key_multibase": "z3RFgcpLEM8oRi2DoK3B1FCSTAfCBKjZvBkzuxcBV4TNM" }, { "id": "did:cheqd:testnet:45465F44-A45C-4B91-8C21-9AF6C0E33137#key-2", "type": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:45465F44-A45C-4B91-8C21-9AF6C0E33137", + "public_key_jwk": [], "public_key_multibase": "z7JQKofgkaFFpjqJAKNWtFSKVv8kkLHhvErcNx7A6VL8p" }, { "id": "did:cheqd:testnet:45465F44-A45C-4B91-8C21-9AF6C0E33137#key-3", "type": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:45465F44-A45C-4B91-8C21-9AF6C0E33137", + "public_key_jwk": [], "public_key_multibase": "z9X6yXQoNcdZD1zvpuWpicviFnqMvwaziuGbcRnBAVY3y" }, { "id": "did:cheqd:testnet:45465F44-A45C-4B91-8C21-9AF6C0E33137#key-4", "type": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:45465F44-A45C-4B91-8C21-9AF6C0E33137", + "public_key_jwk": [], "public_key_multibase": "zHkQBWRFoUUizMNscNNGQhMhtt2zMK6UV4YFJ9aeBfZbj" } ], diff --git a/tests/upgrade/integration/helpers.go b/tests/upgrade/integration/helpers.go index b9312fe9a..799f245ca 100644 --- a/tests/upgrade/integration/helpers.go +++ b/tests/upgrade/integration/helpers.go @@ -21,6 +21,6 @@ func GetFile(path string) string { return split[len(split)-1] } -func CreateTestJson(dir string, content []byte) (string, error) { +func CreateTestJSON(dir string, content []byte) (string, error) { return helpers.WriteTmpFile(dir, content) } diff --git a/tests/upgrade/integration/network/config.go b/tests/upgrade/integration/network/config.go index e787ea0c2..b4360aaac 100644 --- a/tests/upgrade/integration/network/config.go +++ b/tests/upgrade/integration/network/config.go @@ -5,6 +5,6 @@ import ( ) const ( - CHAIN_ID = integrationnetwork.CHAIN_ID - DID_NAMESPACE = integrationnetwork.DID_NAMESPACE + ChainID = integrationnetwork.ChainID + DidNamespace = integrationnetwork.DidNamespace ) diff --git a/tests/upgrade/integration/param_change_proposal_test.go b/tests/upgrade/integration/param_change_proposal_test.go index 593430a8a..d78eaf20c 100644 --- a/tests/upgrade/integration/param_change_proposal_test.go +++ b/tests/upgrade/integration/param_change_proposal_test.go @@ -16,142 +16,142 @@ import ( var _ = Describe("Upgrade - Fee parameter change proposal", func() { It("should wait for node catching up", func() { By("pinging the node status until catching up is flagged as false") - err := cli.WaitForCaughtUp(cli.VALIDATOR0, cli.CLI_BINARY_NAME, cli.VOTING_PERIOD*6) + err := cli.WaitForCaughtUp(cli.Validator0, cli.CLIBinaryName, cli.VotingPeriod*6) Expect(err).To(BeNil()) }) It("should submit a parameter change proposal for did module", func() { By("passing the proposal file to the container") - _, err := cli.LocalnetExecCopyAbsoluteWithPermissions(filepath.Join(GENERATED_JSON_DIR, "proposal", "existing", "param_change_did.json"), cli.DOCKER_HOME, cli.VALIDATOR0) + _, err := cli.LocalnetExecCopyAbsoluteWithPermissions(filepath.Join(GeneratedJSONDir, "proposal", "existing", "param_change_did.json"), cli.DockerHome, cli.Validator0) Expect(err).To(BeNil()) By("sending a SubmitParamChangeProposal transaction from `validator0` container") - res, err := cli.SubmitParamChangeProposal(cli.VALIDATOR0, "param_change_did.json") + res, err := cli.SubmitParamChangeProposal(cli.Validator0, "param_change_did.json") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the parameter change proposal from `validator0` container", func() { By("sending a VoteProposal transaction from `validator0` container") - res, err := cli.VoteProposal(cli.VALIDATOR0, "2", "yes") + res, err := cli.VoteProposal(cli.Validator0, "2", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the parameter change proposal from `validator1` container", func() { By("sending a VoteProposal transaction from `validator1` container") - res, err := cli.VoteProposal(cli.VALIDATOR1, "2", "yes") + res, err := cli.VoteProposal(cli.Validator1, "2", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the parameter change proposal from `validator2` container", func() { By("sending a VoteProposal transaction from `validator2` container") - res, err := cli.VoteProposal(cli.VALIDATOR2, "2", "yes") + res, err := cli.VoteProposal(cli.Validator2, "2", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the parameter change proposal from `validator3` container", func() { By("sending a VoteProposal transaction from `validator3` container") - res, err := cli.VoteProposal(cli.VALIDATOR3, "2", "yes") + res, err := cli.VoteProposal(cli.Validator3, "2", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should wait for the proposal to pass", func() { By("getting the current block height") - currentHeight, err := cli.GetCurrentBlockHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME) + currentHeight, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CLIBinaryName) Expect(err).To(BeNil()) By("waiting for the proposal to pass") - err = cli.WaitForChainHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME, currentHeight+20, cli.VOTING_PERIOD*3) + err = cli.WaitForChainHeight(cli.Validator0, cli.CLIBinaryName, currentHeight+20, cli.VotingPeriod*3) Expect(err).To(BeNil()) }) It("should check the proposal status to ensure it has passed", func() { By("sending a QueryProposal query from `validator0` container") - proposal, err := cli.QueryProposal(cli.VALIDATOR0, "2") + proposal, err := cli.QueryProposal(cli.Validator0, "2") Expect(err).To(BeNil()) Expect(proposal.Status).To(BeEquivalentTo(govtypesv1.StatusPassed)) }) It("should validate the param change result with the expected outcome", func() { By("sending a QueryParams query from `validator0` container") - feeParams, err := cli.QueryDidFeeParams(cli.VALIDATOR0, didtypes.ModuleName, string(didtypes.ParamStoreKeyFeeParams)) + feeParams, err := cli.QueryDidFeeParams(cli.Validator0, didtypes.ModuleName, string(didtypes.ParamStoreKeyFeeParams)) Expect(err).To(BeNil()) By("checking against the expected fee params") var expectedFeeParams didtypes.FeeParams - _, err = Loader(filepath.Join(GENERATED_JSON_DIR, "proposal", "expected", "param_change_did.json"), &expectedFeeParams) + _, err = Loader(filepath.Join(GeneratedJSONDir, "proposal", "expected", "param_change_did.json"), &expectedFeeParams) Expect(err).To(BeNil()) Expect(feeParams).To(Equal(expectedFeeParams)) }) It("should submit a parameter change proposal for resource module", func() { By("passing the proposal file to the container") - _, err := cli.LocalnetExecCopyAbsoluteWithPermissions(filepath.Join(GENERATED_JSON_DIR, "proposal", "existing", "param_change_resource.json"), cli.DOCKER_HOME, cli.VALIDATOR0) + _, err := cli.LocalnetExecCopyAbsoluteWithPermissions(filepath.Join(GeneratedJSONDir, "proposal", "existing", "param_change_resource.json"), cli.DockerHome, cli.Validator0) Expect(err).To(BeNil()) By("sending a SubmitParamChangeProposal transaction from `validator0` container") - res, err := cli.SubmitParamChangeProposal(cli.VALIDATOR0, "param_change_resource.json") + res, err := cli.SubmitParamChangeProposal(cli.Validator0, "param_change_resource.json") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the parameter change proposal from `validator0` container", func() { By("sending a VoteProposal transaction from `validator0` container") - res, err := cli.VoteProposal(cli.VALIDATOR0, "3", "yes") + res, err := cli.VoteProposal(cli.Validator0, "3", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the parameter change proposal from `validator1` container", func() { By("sending a VoteProposal transaction from `validator1` container") - res, err := cli.VoteProposal(cli.VALIDATOR1, "3", "yes") + res, err := cli.VoteProposal(cli.Validator1, "3", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the parameter change proposal from `validator2` container", func() { By("sending a VoteProposal transaction from `validator2` container") - res, err := cli.VoteProposal(cli.VALIDATOR2, "3", "yes") + res, err := cli.VoteProposal(cli.Validator2, "3", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the parameter change proposal from `validator3` container", func() { By("sending a VoteProposal transaction from `validator3` container") - res, err := cli.VoteProposal(cli.VALIDATOR3, "3", "yes") + res, err := cli.VoteProposal(cli.Validator3, "3", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should wait for the proposal to pass", func() { By("getting the current block height") - currentHeight, err := cli.GetCurrentBlockHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME) + currentHeight, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CLIBinaryName) Expect(err).To(BeNil()) By("waiting for the proposal to pass") - err = cli.WaitForChainHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME, currentHeight+20, cli.VOTING_PERIOD*3) + err = cli.WaitForChainHeight(cli.Validator0, cli.CLIBinaryName, currentHeight+20, cli.VotingPeriod*3) Expect(err).To(BeNil()) }) It("should check the proposal status to ensure it has passed", func() { By("sending a QueryProposal query from `validator0` container") - proposal, err := cli.QueryProposal(cli.VALIDATOR0, "3") + proposal, err := cli.QueryProposal(cli.Validator0, "3") Expect(err).To(BeNil()) Expect(proposal.Status).To(BeEquivalentTo(govtypesv1.StatusPassed)) }) It("should validate the param change result with the expected outcome", func() { By("sending a QueryParams query from `validator0` container") - feeParams, err := cli.QueryResourceFeeParams(cli.VALIDATOR0, resourcetypes.ModuleName, string(resourcetypes.ParamStoreKeyFeeParams)) + feeParams, err := cli.QueryResourceFeeParams(cli.Validator0, resourcetypes.ModuleName, string(resourcetypes.ParamStoreKeyFeeParams)) Expect(err).To(BeNil()) By("checking against the expected fee params") var expectedFeeParams resourcetypes.FeeParams - _, err = Loader(filepath.Join(GENERATED_JSON_DIR, "proposal", "expected", "param_change_resource.json"), &expectedFeeParams) + _, err = Loader(filepath.Join(GeneratedJSONDir, "proposal", "expected", "param_change_resource.json"), &expectedFeeParams) Expect(err).To(BeNil()) Expect(feeParams).To(Equal(expectedFeeParams)) }) diff --git a/tests/upgrade/integration/post_test.go b/tests/upgrade/integration/post_test.go index 628d17d9d..fb7ae55cf 100644 --- a/tests/upgrade/integration/post_test.go +++ b/tests/upgrade/integration/post_test.go @@ -19,28 +19,28 @@ var _ = Describe("Upgrade - Post", func() { Context("After a software upgrade execution has concluded", func() { It("should wait for node catching up", func() { By("pinging the node status until catching up is flagged as false") - err := cli.WaitForCaughtUp(cli.VALIDATOR0, cli.CLI_BINARY_NAME, cli.VOTING_PERIOD*6) + err := cli.WaitForCaughtUp(cli.Validator0, cli.CLIBinaryName, cli.VotingPeriod*6) Expect(err).To(BeNil()) }) It("should wait for a certain number of blocks to be produced", func() { By("fetching the current chain height") - currentHeight, err := cli.GetCurrentBlockHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME) + currentHeight, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CLIBinaryName) Expect(err).To(BeNil()) By("waiting for 10 blocks to be produced on top, after the upgrade") - err = cli.WaitForChainHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME, currentHeight+10, cli.VOTING_PERIOD*6) + err = cli.WaitForChainHeight(cli.Validator0, cli.CLIBinaryName, currentHeight+10, cli.VotingPeriod*6) Expect(err).To(BeNil()) }) It("should match the expected module version map", func() { By("loading the expected module version map") var expected upgradetypes.QueryModuleVersionsResponse - _, err := Loader(filepath.Join(GENERATED_JSON_DIR, "post", "query - module-version-map", "v1.json"), &expected) + _, err := Loader(filepath.Join(GeneratedJSONDir, "post", "query - module-version-map", "v1.json"), &expected) Expect(err).To(BeNil()) By("matching the expected module version map") - actual, err := cli.QueryModuleVersionMap(cli.VALIDATOR0) + actual, err := cli.QueryModuleVersionMap(cli.Validator0) Expect(err).To(BeNil()) Expect(actual.ModuleVersions).To(Equal(expected.ModuleVersions), "module version map mismatch") @@ -48,7 +48,7 @@ var _ = Describe("Upgrade - Post", func() { It("should load and run existing diddoc payloads - case: update", func() { By("matching the glob pattern for existing diddoc payloads") - DidDocUpdatePayloads, err := RelGlob(GENERATED_JSON_DIR, "post", "update - diddoc", "*.json") + DidDocUpdatePayloads, err := RelGlob(GeneratedJSONDir, "post", "update - diddoc", "*.json") Expect(err).To(BeNil()) for _, payload := range DidDocUpdatePayloads { @@ -63,7 +63,7 @@ var _ = Describe("Upgrade - Post", func() { DidDocUpdateSignInput, err = Loader(payload, &DidDocUpdatePayload) Expect(err).To(BeNil()) - res, err := cli.UpdateDid(DidDocUpdatePayload, DidDocUpdateSignInput, cli.VALIDATOR0) + res, err := cli.UpdateDid(DidDocUpdatePayload, DidDocUpdateSignInput, cli.Validator0) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) } @@ -71,7 +71,7 @@ var _ = Describe("Upgrade - Post", func() { It("should load and run existing diddoc payloads - case: deactivate", func() { By("matching the glob pattern for existing diddoc payloads") - DidDocDeactivatePayloads, err := RelGlob(GENERATED_JSON_DIR, "post", "deactivate - diddoc", "*.json") + DidDocDeactivatePayloads, err := RelGlob(GeneratedJSONDir, "post", "deactivate - diddoc", "*.json") Expect(err).To(BeNil()) for _, payload := range DidDocDeactivatePayloads { @@ -86,7 +86,7 @@ var _ = Describe("Upgrade - Post", func() { DidDocDeactivateSignInput, err = Loader(payload, &DidDocDeacctivatePayload) Expect(err).To(BeNil()) - res, err := cli.DeactivateDid(DidDocDeacctivatePayload, DidDocDeactivateSignInput, cli.VALIDATOR0) + res, err := cli.DeactivateDid(DidDocDeacctivatePayload, DidDocDeactivateSignInput, cli.Validator0) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) } @@ -94,7 +94,7 @@ var _ = Describe("Upgrade - Post", func() { It("should create resources after upgrade", func() { By("matching the glob pattern for resource payloads to create") - ResourcePayloads, err := RelGlob(GENERATED_JSON_DIR, "post", "create - resource", "*.json") + ResourcePayloads, err := RelGlob(GeneratedJSONDir, "post", "create - resource", "*.json") Expect(err).To(BeNil()) for _, payload := range ResourcePayloads { @@ -107,14 +107,14 @@ var _ = Describe("Upgrade - Post", func() { signInputs, err := Loader(payload, &ResourceCreatePayload) Expect(err).To(BeNil()) - ResourceFile, err := CreateTestJson(GinkgoT().TempDir(), ResourceCreatePayload.Data) + ResourceFile, err := CreateTestJSON(GinkgoT().TempDir(), ResourceCreatePayload.Data) Expect(err).To(BeNil()) res, err := cli.CreateResource( ResourceCreatePayload, ResourceFile, signInputs, - cli.VALIDATOR0, + cli.Validator0, ) Expect(err).To(BeNil()) @@ -124,7 +124,7 @@ var _ = Describe("Upgrade - Post", func() { It("should load and run expected diddoc payloads", func() { By("matching the glob pattern for existing diddoc payloads") - ExpectedDidDocUpdateRecords, err := RelGlob(GENERATED_JSON_DIR, "post", "query - diddoc", "*.json") + ExpectedDidDocUpdateRecords, err := RelGlob(GeneratedJSONDir, "post", "query - diddoc", "*.json") Expect(err).To(BeNil()) for _, payload := range ExpectedDidDocUpdateRecords { @@ -137,7 +137,7 @@ var _ = Describe("Upgrade - Post", func() { _, err = Loader(payload, &DidDocUpdateRecord) Expect(err).To(BeNil()) - res, err := cli.QueryDid(DidDocUpdateRecord.Id, cli.VALIDATOR0) + res, err := cli.QueryDid(DidDocUpdateRecord.Id, cli.Validator0) Expect(err).To(BeNil()) if DidDocUpdateRecord.Context == nil { @@ -171,7 +171,7 @@ var _ = Describe("Upgrade - Post", func() { It("should load and run expected resource payloads", func() { By("matching the glob pattern for existing resource payloads") - ExpectedResourceCreateRecords, err := RelGlob(GENERATED_JSON_DIR, "post", "query - resource", "*.json") + ExpectedResourceCreateRecords, err := RelGlob(GeneratedJSONDir, "post", "query - resource", "*.json") Expect(err).To(BeNil()) for _, payload := range ExpectedResourceCreateRecords { @@ -184,7 +184,7 @@ var _ = Describe("Upgrade - Post", func() { _, err = Loader(payload, &ResourceCreateRecord) Expect(err).To(BeNil()) - res, err := cli.QueryResource(ResourceCreateRecord.Metadata.CollectionId, ResourceCreateRecord.Metadata.Id, cli.VALIDATOR0) + res, err := cli.QueryResource(ResourceCreateRecord.Metadata.CollectionId, ResourceCreateRecord.Metadata.Id, cli.Validator0) Expect(err).To(BeNil()) Expect(res.Resource.Metadata.Id).To(Equal(ResourceCreateRecord.Metadata.Id)) diff --git a/tests/upgrade/integration/pre_test.go b/tests/upgrade/integration/pre_test.go index 409d1a925..4576a011f 100644 --- a/tests/upgrade/integration/pre_test.go +++ b/tests/upgrade/integration/pre_test.go @@ -20,7 +20,7 @@ var _ = Describe("Upgrade - Pre", func() { Context("Before a softare upgrade execution is initiated", func() { It("should wait for chain to bootstrap", func() { By("pinging the node status until the dvoting end height is reached") - err := cli.WaitForChainHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME, cli.BOOTSTRAP_HEIGHT, cli.BOOTSTRAP_PERIOD) + err := cli.WaitForChainHeight(cli.Validator0, cli.CLIBinaryName, cli.BootstrapHeight, cli.BootstrapPeriod) Expect(err).To(BeNil()) }) @@ -28,11 +28,11 @@ var _ = Describe("Upgrade - Pre", func() { // It("should match the expected module version map", func() { // By("loading the expected module version map") // var expected upgradetypes.QueryModuleVersionsResponse - // _, err := Loader(filepath.Join(GENERATED_JSON_DIR, "pre", "query - module-version-map", "v069.json"), &expected) + // _, err := Loader(filepath.Join(GeneratedJSONDir, "pre", "query - module-version-map", "v069.json"), &expected) // Expect(err).To(BeNil()) // By("matching the expected module version map") - // actual, err := cli.QueryModuleVersionMap(cli.VALIDATOR0) + // actual, err := cli.QueryModuleVersionMap(cli.Validator0) // Expect(err).To(BeNil()) // Expect(actual.ModuleVersions).To(Equal(expected.ModuleVersions), "module version map mismatch") @@ -40,7 +40,7 @@ var _ = Describe("Upgrade - Pre", func() { It("should load and run existing diddoc payloads - case: create", func() { By("matching the glob pattern for existing diddoc payloads") - ExistingDidDocCreatePayloads, err := RelGlob(GENERATED_JSON_DIR, "pre", "create - diddoc", "*.json") + ExistingDidDocCreatePayloads, err := RelGlob(GeneratedJSONDir, "pre", "create - diddoc", "*.json") Expect(err).To(BeNil()) for _, payload := range ExistingDidDocCreatePayloads { @@ -55,7 +55,7 @@ var _ = Describe("Upgrade - Pre", func() { DidDocCreateSignInput, err = Loader(payload, &DidDocCreatePayload) Expect(err).To(BeNil()) - res, err := cli.CreateDidLegacy(DidDocCreatePayload, DidDocCreateSignInput, cli.VALIDATOR0) + res, err := cli.CreateDidLegacy(DidDocCreatePayload, DidDocCreateSignInput, cli.Validator0) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) } @@ -63,7 +63,7 @@ var _ = Describe("Upgrade - Pre", func() { It("should load and run existing diddoc payloads - case: update", func() { By("matching the glob pattern for existing diddoc payloads") - ExistingDidDocUpdatePayloads, err := RelGlob(GENERATED_JSON_DIR, "pre", "update - diddoc", "*.json") + ExistingDidDocUpdatePayloads, err := RelGlob(GeneratedJSONDir, "pre", "update - diddoc", "*.json") Expect(err).To(BeNil()) for _, payload := range ExistingDidDocUpdatePayloads { @@ -78,13 +78,13 @@ var _ = Describe("Upgrade - Pre", func() { DidDocUpdateSignInput, err = Loader(payload, &DidDocUpdatePayload) Expect(err).To(BeNil()) - resp, err := cli.QueryDidLegacy(DidDocUpdatePayload.Id, cli.VALIDATOR0) + resp, err := cli.QueryDidLegacy(DidDocUpdatePayload.Id, cli.Validator0) Expect(err).To(BeNil()) Expect(resp.Did.Id).To(BeEquivalentTo(DidDocUpdatePayload.Id)) DidDocUpdatePayload.VersionId = resp.Metadata.VersionId - res, err := cli.UpdateDidLegacy(DidDocUpdatePayload, DidDocUpdateSignInput, cli.VALIDATOR0) + res, err := cli.UpdateDidLegacy(DidDocUpdatePayload, DidDocUpdateSignInput, cli.Validator0) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) } @@ -92,7 +92,7 @@ var _ = Describe("Upgrade - Pre", func() { It("should load and run existing resource payloads - case: create", func() { By("matching the glob pattern for existing resource payloads") - ExistingResourceCreatePayloads, err := RelGlob(GENERATED_JSON_DIR, "pre", "create - resource", "*.json") + ExistingResourceCreatePayloads, err := RelGlob(GeneratedJSONDir, "pre", "create - resource", "*.json") Expect(err).To(BeNil()) for _, payload := range ExistingResourceCreatePayloads { @@ -107,9 +107,9 @@ var _ = Describe("Upgrade - Pre", func() { Expect(err).To(BeNil()) By("copying the existing resource file to the container") - ResourceFile, err := CreateTestJson(GinkgoT().TempDir(), ResourceCreatePayload.Data) + ResourceFile, err := CreateTestJSON(GinkgoT().TempDir(), ResourceCreatePayload.Data) Expect(err).To(BeNil()) - _, err = cli.LocalnetExecCopyAbsoluteWithPermissions(ResourceFile, cli.DOCKER_HOME, cli.VALIDATOR0) + _, err = cli.LocalnetExecCopyAbsoluteWithPermissions(ResourceFile, cli.DockerHome, cli.Validator0) Expect(err).To(BeNil()) // TODO: Add resource file. Right now, it is not possible to create a resource without a file. So we need to copy a file to the container home directory. @@ -120,7 +120,7 @@ var _ = Describe("Upgrade - Pre", func() { ResourceCreatePayload.ResourceType, filepath.Base(ResourceFile), ResourceCreateSignInput, - cli.VALIDATOR0) + cli.Validator0) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) } @@ -132,7 +132,7 @@ var _ = Describe("Upgrade - Pre", func() { It("should calculate the upgrade height", func() { By("getting the current block height and calculating the voting end height") var err error - UPGRADE_HEIGHT, VOTING_END_HEIGHT, err = cli.CalculateUpgradeHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME) + UPGRADE_HEIGHT, VOTING_END_HEIGHT, err = cli.CalculateUpgradeHeight(cli.Validator0, cli.CLIBinaryName) Expect(err).To(BeNil()) fmt.Printf("Upgrade height: %d\n", UPGRADE_HEIGHT) fmt.Printf("Voting end height: %d\n", VOTING_END_HEIGHT) @@ -140,62 +140,62 @@ var _ = Describe("Upgrade - Pre", func() { It("should submit a software upgrade proposal", func() { By("sending a SubmitUpgradeProposal transaction from `validator0` container") - res, err := cli.SubmitUpgradeProposal(UPGRADE_HEIGHT, cli.VALIDATOR0) + res, err := cli.SubmitUpgradeProposal(UPGRADE_HEIGHT, cli.Validator0) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should deposit tokens for the software upgrade proposal", func() { By("sending a DepositGov transaction from `validator0` container") - res, err := cli.DepositGov(cli.VALIDATOR0) + res, err := cli.DepositGov(cli.Validator0) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the software upgrade proposal from `validator0` container", func() { By("sending a VoteProposal transaction from `validator0` container") - res, err := cli.VoteProposal(cli.VALIDATOR0, "1", "yes") + res, err := cli.VoteProposal(cli.Validator0, "1", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the software upgrade proposal from `validator1` container", func() { By("sending a VoteProposal transaction from `validator1` container") - res, err := cli.VoteProposal(cli.VALIDATOR1, "1", "yes") + res, err := cli.VoteProposal(cli.Validator1, "1", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the software upgrade proposal from `validator2` container", func() { By("sending a VoteProposal transaction from `validator2` container") - res, err := cli.VoteProposal(cli.VALIDATOR2, "1", "yes") + res, err := cli.VoteProposal(cli.Validator2, "1", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should vote for the software upgrade proposal from `validator3` container", func() { By("sending a VoteProposal transaction from `validator3` container") - res, err := cli.VoteProposal(cli.VALIDATOR3, "1", "yes") + res, err := cli.VoteProposal(cli.Validator3, "1", "yes") Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(0)) }) It("should wait for the voting end height to be reached", func() { By("pinging the node status until the voting end height is reached") - err := cli.WaitForChainHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME, VOTING_END_HEIGHT, cli.VOTING_PERIOD) + err := cli.WaitForChainHeight(cli.Validator0, cli.CLIBinaryName, VOTING_END_HEIGHT, cli.VotingPeriod) Expect(err).To(BeNil()) }) It("should query the proposal status to ensure it has passed", func() { By("sending a QueryProposal Msg from `validator0` container") - proposal, err := cli.QueryProposalLegacy(cli.VALIDATOR0, "1") + proposal, err := cli.QueryProposalLegacy(cli.Validator0, "1") Expect(err).To(BeNil()) Expect(proposal.Status).To(BeEquivalentTo(govtypesv1beta1.StatusPassed)) }) It("should wait for the upgrade height to be reached", func() { By("pinging the node status until the upgrade height is reached") - err := cli.WaitForChainHeight(cli.VALIDATOR0, cli.CLI_BINARY_NAME, UPGRADE_HEIGHT, cli.VOTING_PERIOD) + err := cli.WaitForChainHeight(cli.Validator0, cli.CLIBinaryName, UPGRADE_HEIGHT, cli.VotingPeriod) Expect(err).To(BeNil()) }) }) diff --git a/tests/upgrade/unit/generated/payload/checksum/existing/v2/diddoc.json b/tests/upgrade/unit/generated/payload/checksum/existing/v2/diddoc.json index 88ebc219a..ab9b1c224 100644 --- a/tests/upgrade/unit/generated/payload/checksum/existing/v2/diddoc.json +++ b/tests/upgrade/unit/generated/payload/checksum/existing/v2/diddoc.json @@ -8,17 +8,17 @@ "authentication": [ "did:cheqd:testnet:97096fb1-63ea-4f81-b296-8eb5da6ab6eb#key-1" ], - "assertionMethod": [], - "capabilityInvocation": [], - "capabilityDelegation": [], - "keyAgreement": [], - "alsoKnownAs": [], - "verificationMethod": [ + "assertion_method": [], + "capability_invocation": [], + "capability_delegation": [], + "key_agreement": [], + "also_known_as": [], + "verification_method": [ { "id": "did:cheqd:testnet:97096fb1-63ea-4f81-b296-8eb5da6ab6eb#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:97096fb1-63ea-4f81-b296-8eb5da6ab6eb", - "verification_material": "{\"publicKeyMultibase\":\"z6LNquFfzPNhCQ8nbCWSMBQjosLT7ayEqGSYrN2Y1FdmS\"}" + "verification_material": "z6MkjndtVVvRivBfWddHt5QC2WHoguixzrVBxTTnCJW2ArYp" } ], "service": [] diff --git a/tests/upgrade/unit/generated/payload/checksum/expected/v2/diddoc.json b/tests/upgrade/unit/generated/payload/checksum/expected/v2/diddoc.json index 88ebc219a..ab9b1c224 100644 --- a/tests/upgrade/unit/generated/payload/checksum/expected/v2/diddoc.json +++ b/tests/upgrade/unit/generated/payload/checksum/expected/v2/diddoc.json @@ -8,17 +8,17 @@ "authentication": [ "did:cheqd:testnet:97096fb1-63ea-4f81-b296-8eb5da6ab6eb#key-1" ], - "assertionMethod": [], - "capabilityInvocation": [], - "capabilityDelegation": [], - "keyAgreement": [], - "alsoKnownAs": [], - "verificationMethod": [ + "assertion_method": [], + "capability_invocation": [], + "capability_delegation": [], + "key_agreement": [], + "also_known_as": [], + "verification_method": [ { "id": "did:cheqd:testnet:97096fb1-63ea-4f81-b296-8eb5da6ab6eb#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:97096fb1-63ea-4f81-b296-8eb5da6ab6eb", - "verification_material": "{\"publicKeyMultibase\":\"z6LNquFfzPNhCQ8nbCWSMBQjosLT7ayEqGSYrN2Y1FdmS\"}" + "verification_material": "z6MkjndtVVvRivBfWddHt5QC2WHoguixzrVBxTTnCJW2ArYp" } ], "service": [] diff --git a/tests/upgrade/unit/generated/payload/indy_style/existing/v2/diddoc.json b/tests/upgrade/unit/generated/payload/indy_style/existing/v2/diddoc.json index e50895347..48a9d544b 100644 --- a/tests/upgrade/unit/generated/payload/indy_style/existing/v2/diddoc.json +++ b/tests/upgrade/unit/generated/payload/indy_style/existing/v2/diddoc.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:xcWigjiDhDTaBGRX#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:xcWigjiDhDTaBGRX", - "verification_material": "{\"publicKeyMultibase\":\"z4xhmb8vKgCN24a3kRyai5F8eMSgkuqSA8ABPo8mYJSd\"}" + "verification_material": "z6MkeXDkMqPMfDgq8ZQkRzwRZAo8TviYAo5nr957E56nTXE1" }, { "id": "did:cheqd:testnet:xcWigjiDhDTaBGRX#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:xcWigjiDhDTaBGRX", - "verification_material": "{\"publicKeyMultibase\":\"z6L84sd16WVYPQYQ6XXwdPtg2SEkxyj2CrsGGQ3MzkFP5\"}" + "verification_material": "z6MkjnP7TsFXr32rX3EoD6uUEzE2Fp2pPcGZYtBCEKL1fUAT" }, { "id": "did:cheqd:testnet:xcWigjiDhDTaBGRX#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:xcWigjiDhDTaBGRX", - "verification_material": "{\"publicKeyMultibase\":\"zADATkCngJDTbzxhzYtjC8ndzu5wWWbrH8UwQMowfcYDj\"}" + "verification_material": "z6MkofRWLT37dkx57TYhETh2ytBzifDMvV6dpVrLC5ugXm17" }, { "id": "did:cheqd:testnet:xcWigjiDhDTaBGRX#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:xcWigjiDhDTaBGRX", - "verification_material": "{\"publicKeyMultibase\":\"z5PuPVaqjigujtzrwQMZQviJV15gFSTVYkGEifGEGb6Ei\"}" + "verification_material": "z6MkirAS5q6B4EQD1Vhe5vXFmorUpex6rLjuSH9eVYCHWK26" } ], "authentication": [ @@ -62,7 +62,7 @@ "service": [ { "id": "did:cheqd:testnet:xcWigjiDhDTaBGRX#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/indy_style/existing/v2/diddoc_2.json b/tests/upgrade/unit/generated/payload/indy_style/existing/v2/diddoc_2.json index 458d8cec7..81f879fce 100644 --- a/tests/upgrade/unit/generated/payload/indy_style/existing/v2/diddoc_2.json +++ b/tests/upgrade/unit/generated/payload/indy_style/existing/v2/diddoc_2.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2", - "verification_material": "{\"publicKeyMultibase\":\"z96PbHeiZGH3Zc9fVHj5K9hdD8bCqpubLJ9pb4cRpDk2X\"}" + "verification_material": "z6MknYedstxzbpY2ieWByJ39zoBCxAUhEnqgzAjWttPq8xou" }, { "id": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2", - "verification_material": "{\"publicKeyMultibase\":\"zSsYEB2VbVqp8G87RxK9fhjeoy2PGwk3PX1Buqm7hd5w\"}" + "verification_material": "z6Mkeu8apRGvw3LHEkxp7XGzWoHedYJEgpzQ5Xv7k7j8cqsK" }, { "id": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2", - "verification_material": "{\"publicKeyMultibase\":\"z9ksW7J4SJx5W5NgfgakYofpRatvpt4bPvBKkUB9oGhEy\"}" + "verification_material": "z6MkoD8YhYJseVZyBsXNN9iPemNRQUCgHwqkcCEgJT7pBv2M" }, { "id": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2", - "verification_material": "{\"publicKeyMultibase\":\"z7V2MUiykWWkTG2n9dmDTcRTtfyN864DQMv9dVcJWLWYL\"}" + "verification_material": "z6MkkwHQ4yEBr4EvNXcrKLBJTX1tVYdyVwTm3w4ZKtGXFjKi" } ], "authentication": [ @@ -62,7 +62,7 @@ "service": [ { "id": "did:cheqd:testnet:SWFYv4aPjJtxZ1q2#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/indy_style/expected/v2/diddoc.json b/tests/upgrade/unit/generated/payload/indy_style/expected/v2/diddoc.json index 1d6efcdff..31f865bfb 100644 --- a/tests/upgrade/unit/generated/payload/indy_style/expected/v2/diddoc.json +++ b/tests/upgrade/unit/generated/payload/indy_style/expected/v2/diddoc.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC", - "verification_material": "{\"publicKeyMultibase\":\"z4xhmb8vKgCN24a3kRyai5F8eMSgkuqSA8ABPo8mYJSd\"}" + "verification_material": "z6MkeXDkMqPMfDgq8ZQkRzwRZAo8TviYAo5nr957E56nTXE1" }, { "id": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC", - "verification_material": "{\"publicKeyMultibase\":\"z6L84sd16WVYPQYQ6XXwdPtg2SEkxyj2CrsGGQ3MzkFP5\"}" + "verification_material": "z6MkjnP7TsFXr32rX3EoD6uUEzE2Fp2pPcGZYtBCEKL1fUAT" }, { "id": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC", - "verification_material": "{\"publicKeyMultibase\":\"zADATkCngJDTbzxhzYtjC8ndzu5wWWbrH8UwQMowfcYDj\"}" + "verification_material": "z6MkofRWLT37dkx57TYhETh2ytBzifDMvV6dpVrLC5ugXm17" }, { "id": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC", - "verification_material": "{\"publicKeyMultibase\":\"z5PuPVaqjigujtzrwQMZQviJV15gFSTVYkGEifGEGb6Ei\"}" + "verification_material": "z6MkirAS5q6B4EQD1Vhe5vXFmorUpex6rLjuSH9eVYCHWK26" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:7Hty8uGafcEsU7EpJEAPUC#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/indy_style/expected/v2/diddoc_2.json b/tests/upgrade/unit/generated/payload/indy_style/expected/v2/diddoc_2.json index b1d04cad3..5391aa302 100644 --- a/tests/upgrade/unit/generated/payload/indy_style/expected/v2/diddoc_2.json +++ b/tests/upgrade/unit/generated/payload/indy_style/expected/v2/diddoc_2.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg", - "verification_material": "{\"publicKeyMultibase\":\"z96PbHeiZGH3Zc9fVHj5K9hdD8bCqpubLJ9pb4cRpDk2X\"}" + "verification_material": "z6MknYedstxzbpY2ieWByJ39zoBCxAUhEnqgzAjWttPq8xou" }, { "id": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg", - "verification_material": "{\"publicKeyMultibase\":\"zSsYEB2VbVqp8G87RxK9fhjeoy2PGwk3PX1Buqm7hd5w\"}" + "verification_material": "z6Mkeu8apRGvw3LHEkxp7XGzWoHedYJEgpzQ5Xv7k7j8cqsK" }, { "id": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg", - "verification_material": "{\"publicKeyMultibase\":\"z9ksW7J4SJx5W5NgfgakYofpRatvpt4bPvBKkUB9oGhEy\"}" + "verification_material": "z6MkoD8YhYJseVZyBsXNN9iPemNRQUCgHwqkcCEgJT7pBv2M" }, { "id": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg", - "verification_material": "{\"publicKeyMultibase\":\"z7V2MUiykWWkTG2n9dmDTcRTtfyN864DQMv9dVcJWLWYL\"}" + "verification_material": "z6MkkwHQ4yEBr4EvNXcrKLBJTX1tVYdyVwTm3w4ZKtGXFjKi" } ], "authentication": [ @@ -62,7 +62,7 @@ "service": [ { "id": "did:cheqd:testnet:5aayeuitt5VD2VWbL2zopg#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/protobuf/expected/v2/diddoc.json b/tests/upgrade/unit/generated/payload/protobuf/expected/v2/diddoc.json index 9513e91e2..09d8954fd 100644 --- a/tests/upgrade/unit/generated/payload/protobuf/expected/v2/diddoc.json +++ b/tests/upgrade/unit/generated/payload/protobuf/expected/v2/diddoc.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE", - "verification_material": "{\"publicKeyMultibase\":\"z9KXGLghdcmYmHv2tVs9P4GNt6jzGXMtuVWM2cDuUrLD7\"}" + "verification_material": "z6MknmnJvvx4xK3EQQsbBS7DuMvsvKG7wF9GBXFxSVsVmYzV" }, { "id": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE", - "verification_material": "{\"publicKeyMultibase\":\"zARyYq78WYMC8dZAeKT1PLttgfsWMfqXe5PJCDexYM18U\"}" + "verification_material": "z6MkotEbRMNwstgbk41M11yEBzSgVSnD5imzmQD83vvZGDur" }, { "id": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE", - "verification_material": "{\"publicKeyMultibase\":\"z8zy7xEuLkTt6sLivVg7FEdaYyxD9QJMaH3kvPEvMzVP8\"}" + "verification_material": "z6MknTEAYV9n61NZyqZdBF565j8YoXUzpBbvy4frDWtNuiAW" }, { "id": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE", - "verification_material": "{\"publicKeyMultibase\":\"z6RoXXGz8X1y4urbdLD1QHW7fAXc9LBw5AGaLQ3mV1Sj5\"}" + "verification_material": "z6Mkjt4a7XEZrZTY2MSL1myF8bfez6szk5BRrHVGEKjVvfWT" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:GR4bwyhJMubXbHvHTGiYnE#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/protobuf/expected/v2/diddoc_2.json b/tests/upgrade/unit/generated/payload/protobuf/expected/v2/diddoc_2.json index ba45ec640..bd73053bb 100644 --- a/tests/upgrade/unit/generated/payload/protobuf/expected/v2/diddoc_2.json +++ b/tests/upgrade/unit/generated/payload/protobuf/expected/v2/diddoc_2.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez", - "verification_material": "{\"publicKeyMultibase\":\"z79qsUjmJ9xniX5giTtTbd3p9Zsc9yRqGJr4jMvgXUp35\"}" + "verification_material": "z6Mkkc6v4z1jVWHBdaXR9TRSU9N9PSt1PK5czryfCCeYQ2pT" }, { "id": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez", - "verification_material": "{\"publicKeyMultibase\":\"z4USV76ihz482Y2b6p9kLWHvRHGCzyhjoHHHuWG69pAre\"}" + "verification_material": "z6MkhvhXhLy9KbcVeXRoViiBMPUR6qUrPaz9yJCqLY4AjPe2" }, { "id": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez", - "verification_material": "{\"publicKeyMultibase\":\"z2AmSeQdDHgV8iadh1hhbz7rAN2wca8TVtKgUn9Ka1AMY\"}" + "verification_material": "z6Mkfd2VEesedDybq5UPhGfSqDQABcDTz1hraLbQcRHavP8v" }, { "id": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez", - "verification_material": "{\"publicKeyMultibase\":\"z4N61VYXb7PCWMh1j7qqyGmHSThnCNFMmCRGnkqeBgnww\"}" + "verification_material": "z6MkhpM45nn2SvgyUBrRoQop7rqSHH43n8c7tSBib7cCc1jK" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:7RPNZSCSaQXTdYwFmQy6ez#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_lowcase.json b/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_lowcase.json index 379cc91b6..cc38c72ef 100644 --- a/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_lowcase.json +++ b/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_lowcase.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"zHYqCstG3zdLyWGut3SCSSZiVdQttTiNG3u3cSSR1eDvz\"}" + "verification_material": "z6Mkw16FU8WVLAqScmkaj1AHHfGVSzAjsbccjuxYGiP2ZSiN" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"zDcoCVPoUgMjRWmd4ZrfGAZ51L7oF35upoKCX77qRpqUT\"}" + "verification_material": "z6Mks54F5e3v1uDtdGTmFRd71ed19h56SyABVL7SwPoSk4Fq" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"z2RaG3VJ1YMgyDYyAmYcJeKcMsk89UxfoLnyg1peJbhdv\"}" + "verification_material": "z6MkfsqJdjYSsuBSL3osT7a9VRAMhKPztqvA2otbr6cKWvRJ" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"z9Wx6sWnw2ZGEB5m95K7tPr7SkqvfwBdXe5ZmUTyqmKmt\"}" + "verification_material": "z6MknyD9Tm3NN6khHabqkt5jEwfSaRCXM4stL6UhJjwrgYZG" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_mixed.json b/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_mixed.json index 2906c7f1c..8e0dcb6f9 100644 --- a/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_mixed.json +++ b/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_mixed.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d", - "verification_material": "{\"publicKeyMultibase\":\"z4SnGy1Nbodwk2FNfv9Z8gmyXjae7ix72ApgvvUX94qkq\"}" + "verification_material": "z6Mkhu3KZFd39BSD8kDNbiWyXsXXZ9uy8qMNrqbrkkV9z4YD" }, { "id": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d", - "verification_material": "{\"publicKeyMultibase\":\"zJ26qXuZN7sro7MYpqSWos3Vp5fS3xwSFqsWekiG27zqZ\"}" + "verification_material": "z6MkwUMt89ooTRMGDrPXX1Uei93ouEhuNpgcXtRaazE33Dcw" }, { "id": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d", - "verification_material": "{\"publicKeyMultibase\":\"zECXMsD8gGKZprAL2CLLkr1HxgaPpVjGj84ytZUgP9XzP\"}" + "verification_material": "z6MksenQTTP7bs4HxfAisuJbh6qxW9ffucX5p5tpPkeQ4kmm" }, { "id": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d", - "verification_material": "{\"publicKeyMultibase\":\"zGtRwRLg1cMyMFHJdFiTJoXtrvjF8QvkUcfhQv9e2FUzh\"}" + "verification_material": "z6MkvLgz1avSwuTpMn9KwHR9edSrkJWypozqJgcLkRc3Ahn5" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:C1594E93-dEd6-4244-9CC4-74af38dab09d#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_upper.json b/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_upper.json index c2ade000f..1bf03c3f9 100644 --- a/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_upper.json +++ b/tests/upgrade/unit/generated/payload/uuid/existing/v2/diddoc_upper.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC", - "verification_material": "{\"publicKeyMultibase\":\"z6hCYB6ZJfqvGrgfkgGdTZBtXUjz4bQ7qagksUNjJRBfF\"}" + "verification_material": "z6Mkk9TamLok1PQjyBWTMqbJQHSXJKFv1HNCGhfoJehKLQSd" }, { "id": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC", - "verification_material": "{\"publicKeyMultibase\":\"zDRCh14rhKcEbtjNnBivYyWZ6LSmqhpq8Mw6gdCdsWkHn\"}" + "verification_material": "z6MkrsTjbK78f9j51EDUsHtPpc76A23h7i5V3x1cTUbtRy5A" }, { "id": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC", - "verification_material": "{\"publicKeyMultibase\":\"zEQwmVajyBLpKAubk46o9xz9zD8JZd3YJhZFF5qw9oxYk\"}" + "verification_material": "z6MkssCp5pzQWtJnHQSSjfkzp5hz2haR2vnfPaAAv7uAjBL8" }, { "id": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC", - "verification_material": "{\"publicKeyMultibase\":\"zGq9JEc6vdA6TVWNmC2YqN9fdRVyincfDHNNykRrLRzgr\"}" + "verification_material": "z6MkvHQLprMMxhavc1DTsbWgDFDdF5FaCVuZyPHuahpMMDUE" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:FDFECBD2-A84A-4FB2-B634-E3FDB00F2ABC#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_lowcase.json b/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_lowcase.json index 379cc91b6..cc38c72ef 100644 --- a/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_lowcase.json +++ b/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_lowcase.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"zHYqCstG3zdLyWGut3SCSSZiVdQttTiNG3u3cSSR1eDvz\"}" + "verification_material": "z6Mkw16FU8WVLAqScmkaj1AHHfGVSzAjsbccjuxYGiP2ZSiN" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"zDcoCVPoUgMjRWmd4ZrfGAZ51L7oF35upoKCX77qRpqUT\"}" + "verification_material": "z6Mks54F5e3v1uDtdGTmFRd71ed19h56SyABVL7SwPoSk4Fq" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"z2RaG3VJ1YMgyDYyAmYcJeKcMsk89UxfoLnyg1peJbhdv\"}" + "verification_material": "z6MkfsqJdjYSsuBSL3osT7a9VRAMhKPztqvA2otbr6cKWvRJ" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"z9Wx6sWnw2ZGEB5m95K7tPr7SkqvfwBdXe5ZmUTyqmKmt\"}" + "verification_material": "z6MknyD9Tm3NN6khHabqkt5jEwfSaRCXM4stL6UhJjwrgYZG" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_mixed.json b/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_mixed.json index e9d9dfe07..3b1c42bd6 100644 --- a/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_mixed.json +++ b/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_mixed.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884", - "verification_material": "{\"publicKeyMultibase\":\"z4SnGy1Nbodwk2FNfv9Z8gmyXjae7ix72ApgvvUX94qkq\"}" + "verification_material": "z6Mkhu3KZFd39BSD8kDNbiWyXsXXZ9uy8qMNrqbrkkV9z4YD" }, { "id": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884", - "verification_material": "{\"publicKeyMultibase\":\"zJ26qXuZN7sro7MYpqSWos3Vp5fS3xwSFqsWekiG27zqZ\"}" + "verification_material": "z6MkwUMt89ooTRMGDrPXX1Uei93ouEhuNpgcXtRaazE33Dcw" }, { "id": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884", - "verification_material": "{\"publicKeyMultibase\":\"zECXMsD8gGKZprAL2CLLkr1HxgaPpVjGj84ytZUgP9XzP\"}" + "verification_material": "z6MksenQTTP7bs4HxfAisuJbh6qxW9ffucX5p5tpPkeQ4kmm" }, { "id": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884", - "verification_material": "{\"publicKeyMultibase\":\"zGtRwRLg1cMyMFHJdFiTJoXtrvjF8QvkUcfhQv9e2FUzh\"}" + "verification_material": "z6MkvLgz1avSwuTpMn9KwHR9edSrkJWypozqJgcLkRc3Ahn5" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:a35d7486-1749-55bf-96d4-683958a9a884#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_upper.json b/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_upper.json index 9f15a970e..c299227cd 100644 --- a/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_upper.json +++ b/tests/upgrade/unit/generated/payload/uuid/expected/v2/diddoc_upper.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808", - "verification_material": "{\"publicKeyMultibase\":\"z6hCYB6ZJfqvGrgfkgGdTZBtXUjz4bQ7qagksUNjJRBfF\"}" + "verification_material": "z6Mkk9TamLok1PQjyBWTMqbJQHSXJKFv1HNCGhfoJehKLQSd" }, { "id": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808", - "verification_material": "{\"publicKeyMultibase\":\"zDRCh14rhKcEbtjNnBivYyWZ6LSmqhpq8Mw6gdCdsWkHn\"}" + "verification_material": "z6MkrsTjbK78f9j51EDUsHtPpc76A23h7i5V3x1cTUbtRy5A" }, { "id": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808", - "verification_material": "{\"publicKeyMultibase\":\"zEQwmVajyBLpKAubk46o9xz9zD8JZd3YJhZFF5qw9oxYk\"}" + "verification_material": "z6MkssCp5pzQWtJnHQSSjfkzp5hz2haR2vnfPaAAv7uAjBL8" }, { "id": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808", - "verification_material": "{\"publicKeyMultibase\":\"zGq9JEc6vdA6TVWNmC2YqN9fdRVyincfDHNNykRrLRzgr\"}" + "verification_material": "z6MkvHQLprMMxhavc1DTsbWgDFDdF5FaCVuZyPHuahpMMDUE" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:d87f512c-cbfc-58d1-b995-f526589ad808#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/version_id/existing/v2/diddoc_hash.json b/tests/upgrade/unit/generated/payload/version_id/existing/v2/diddoc_hash.json index 1627b7c1f..c68a908e0 100644 --- a/tests/upgrade/unit/generated/payload/version_id/existing/v2/diddoc_hash.json +++ b/tests/upgrade/unit/generated/payload/version_id/existing/v2/diddoc_hash.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"zHYqCstG3zdLyWGut3SCSSZiVdQttTiNG3u3cSSR1eDvz\"}" + "verification_material": "z6Mkw16FU8WVLAqScmkaj1AHHfGVSzAjsbccjuxYGiP2ZSiN" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"zDcoCVPoUgMjRWmd4ZrfGAZ51L7oF35upoKCX77qRpqUT\"}" + "verification_material": "z6Mks54F5e3v1uDtdGTmFRd71ed19h56SyABVL7SwPoSk4Fq" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"z2RaG3VJ1YMgyDYyAmYcJeKcMsk89UxfoLnyg1peJbhdv\"}" + "verification_material": "z6MkfsqJdjYSsuBSL3osT7a9VRAMhKPztqvA2otbr6cKWvRJ" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"z9Wx6sWnw2ZGEB5m95K7tPr7SkqvfwBdXe5ZmUTyqmKmt\"}" + "verification_material": "z6MknyD9Tm3NN6khHabqkt5jEwfSaRCXM4stL6UhJjwrgYZG" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/generated/payload/version_id/expected/v2/diddoc_hash.json b/tests/upgrade/unit/generated/payload/version_id/expected/v2/diddoc_hash.json index a4a78b5da..656708ea9 100644 --- a/tests/upgrade/unit/generated/payload/version_id/expected/v2/diddoc_hash.json +++ b/tests/upgrade/unit/generated/payload/version_id/expected/v2/diddoc_hash.json @@ -11,27 +11,27 @@ "verification_method": [ { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-1", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"zHYqCstG3zdLyWGut3SCSSZiVdQttTiNG3u3cSSR1eDvz\"}" + "verification_material": "z6Mkw16FU8WVLAqScmkaj1AHHfGVSzAjsbccjuxYGiP2ZSiN" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-2", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"zDcoCVPoUgMjRWmd4ZrfGAZ51L7oF35upoKCX77qRpqUT\"}" + "verification_material": "z6Mks54F5e3v1uDtdGTmFRd71ed19h56SyABVL7SwPoSk4Fq" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-3", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"z2RaG3VJ1YMgyDYyAmYcJeKcMsk89UxfoLnyg1peJbhdv\"}" + "verification_material": "z6MkfsqJdjYSsuBSL3osT7a9VRAMhKPztqvA2otbr6cKWvRJ" }, { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#key-4", - "type": "Ed25519VerificationKey2020", + "verificationMethodType": "Ed25519VerificationKey2020", "controller": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5", - "verification_material": "{\"publicKeyMultibase\":\"z9Wx6sWnw2ZGEB5m95K7tPr7SkqvfwBdXe5ZmUTyqmKmt\"}" + "verification_material": "z6MknyD9Tm3NN6khHabqkt5jEwfSaRCXM4stL6UhJjwrgYZG" } ], "authentication": [ @@ -58,7 +58,7 @@ "service": [ { "id": "did:cheqd:testnet:e77cc679-ada0-4a71-8738-918f388fcbb5#service-1", - "type": "type-1", + "serviceType": "type-1", "service_endpoint": [ "endpoint-1" ] diff --git a/tests/upgrade/unit/migration_unit_test.go b/tests/upgrade/unit/migration_unit_test.go index c61d3c75d..ba0be2fa7 100644 --- a/tests/upgrade/unit/migration_unit_test.go +++ b/tests/upgrade/unit/migration_unit_test.go @@ -152,7 +152,7 @@ var _ = Describe("Migration - Unit", func() { migrator := NewMigrator( setup, []appmigrations.Migration{ - appmigrations.MigrateDidVersionId, + appmigrations.MigrateDidVersionID, }, *existingDataset, *expectedDataset) diff --git a/tests/upgrade/unit/setup/config.go b/tests/upgrade/unit/setup/config.go index 82c0af2f7..036e573f2 100644 --- a/tests/upgrade/unit/setup/config.go +++ b/tests/upgrade/unit/setup/config.go @@ -3,9 +3,9 @@ package setup import "path/filepath" const ( - GENERATED_JSON_DIR = "generated" + GeneratedJSONDir = "generated" ) func JoinGenerated(path ...string) string { - return filepath.Join(append([]string{GENERATED_JSON_DIR}, path...)...) + return filepath.Join(append([]string{GeneratedJSONDir}, path...)...) } diff --git a/tests/upgrade/unit/setup/dataset.go b/tests/upgrade/unit/setup/dataset.go index 98276a2c6..87d547098 100644 --- a/tests/upgrade/unit/setup/dataset.go +++ b/tests/upgrade/unit/setup/dataset.go @@ -35,9 +35,9 @@ func (d *ExistingDataset) AddDidDocV1(pathToDir, prefix string) error { return err } - for _, path_to_file := range files { + for _, pathToFile := range files { var existingDidDoc didtypesv1.StateValue - err = d.loader.LoadFile(path_to_file, &existingDidDoc, d.setup) + err = d.loader.LoadFile(pathToFile, &existingDidDoc, d.setup) if err != nil { return err } @@ -59,9 +59,9 @@ func (d *ExistingDataset) AddDidDocV2(pathToDir, prefix string) error { return err } - for _, path_to_file := range files { + for _, pathToFile := range files { var existingDidDoc didtypes.DidDocWithMetadata - err = d.loader.LoadFile(path_to_file, &existingDidDoc, d.setup) + err = d.loader.LoadFile(pathToFile, &existingDidDoc, d.setup) if err != nil { return err } @@ -83,9 +83,9 @@ func (d *ExistingDataset) AddResourceV1(pathToDir, prefix string) error { return err } - for _, path_to_file := range files { + for _, pathToFile := range files { var existingResource resourcetypesv1.Resource - err = d.loader.LoadFile(path_to_file, &existingResource, d.setup) + err = d.loader.LoadFile(pathToFile, &existingResource, d.setup) if err != nil { return err } @@ -106,9 +106,9 @@ func (d *ExistingDataset) AddResourceV2(pathToDir, prefix string) error { return err } - for _, path_to_file := range files { + for _, pathToFile := range files { var existingResource resourcetypes.ResourceWithMetadata - err = d.loader.LoadFile(path_to_file, &existingResource, d.setup) + err = d.loader.LoadFile(pathToFile, &existingResource, d.setup) if err != nil { return err } @@ -126,25 +126,33 @@ func (d *ExistingDataset) MustAddResourceV2(pathToDir, prefix string) { func (d *ExistingDataset) FillStore() error { for _, didDoc := range d.DidDocsV1 { + // Needs for getting rid of using the same address inside the loop + didDoc := didDoc err := d.setup.DidKeeperV1.SetDid(&d.setup.SdkCtx, &didDoc) if err != nil { return err } } for _, resource := range d.ResourcesV1 { + // Needs for getting rid of using the same address inside the loop + resource := resource err := d.setup.ResourceKeeperV1.SetResource(&d.setup.SdkCtx, &resource) if err != nil { return err } } - for _, did_doc := range d.DidDocsV2 { - err := d.setup.DidKeeper.AddNewDidDocVersion(&d.setup.SdkCtx, &did_doc) + for _, didDoc := range d.DidDocsV2 { + // Needs for getting rid of using the same address inside the loop + didDoc := didDoc + err := d.setup.DidKeeper.AddNewDidDocVersion(&d.setup.SdkCtx, &didDoc) if err != nil { return err } } for _, resource := range d.ResourcesV2 { + // Needs for getting rid of using the same address inside the loop + resource := resource err := d.setup.ResourceKeeper.SetResource(&d.setup.SdkCtx, &resource) if err != nil { return err @@ -176,9 +184,9 @@ func (d *ExpectedDataset) AddDidDocV2(pathToDir, prefix string) error { return err } - for _, path_to_file := range files { + for _, pathToFile := range files { var expectedDidDoc didtypes.DidDocWithMetadata - err := d.loader.LoadFile(path_to_file, &expectedDidDoc, d.setup) + err := d.loader.LoadFile(pathToFile, &expectedDidDoc, d.setup) if err != nil { return err } @@ -200,9 +208,9 @@ func (d *ExpectedDataset) AddResourceV2(pathToDir, prefix string) error { return err } - for _, path_to_file := range files { + for _, pathToFile := range files { var expectedResource resourcetypes.ResourceWithMetadata - err = d.loader.LoadFile(path_to_file, &expectedResource, d.setup) + err = d.loader.LoadFile(pathToFile, &expectedResource, d.setup) if err != nil { return err } diff --git a/tests/upgrade/unit/setup/loader.go b/tests/upgrade/unit/setup/loader.go index a45a444d9..f88daca89 100644 --- a/tests/upgrade/unit/setup/loader.go +++ b/tests/upgrade/unit/setup/loader.go @@ -19,7 +19,7 @@ type KeyPairBase64 struct { } type SignInput struct { - VerificationMethodId string `json:"verificationMethodId"` + VerificationMethodID string `json:"verificationMethodId"` PrivateKey []byte `json:"privateKey"` } @@ -30,20 +30,20 @@ type DidAndMetadata struct { type ILoader interface { LoadFile(path string, dataChunk any, setup TestSetup) error - GetListOfFiles(path_to_dir, prefix string) ([]string, error) + GetListOfFiles(pathToDir, prefix string) ([]string, error) } type Loader struct{} -func (l Loader) GetListOfFiles(path_to_dir, prefix string) ([]string, error) { - files_to_load := []string{} - err := filepath.Walk(path_to_dir, func(path string, info os.FileInfo, err error) error { +func (l Loader) GetListOfFiles(pathToDir, prefix string) ([]string, error) { + filesToLoad := []string{} + err := filepath.Walk(pathToDir, func(path string, info os.FileInfo, err error) error { if !info.IsDir() && strings.HasPrefix(info.Name(), prefix) { - files_to_load = append(files_to_load, path) + filesToLoad = append(filesToLoad, path) } return nil }) - return files_to_load, err + return filesToLoad, err } func (l Loader) LoadFile( @@ -57,14 +57,14 @@ func (l Loader) LoadFile( } switch dataChunk := dataChunk.(type) { case *didtypesv1.StateValue: - var temp_s DidAndMetadata + var tempS DidAndMetadata var stateValue didtypesv1.StateValue - err = json.Unmarshal(file, &temp_s) + err = json.Unmarshal(file, &tempS) if err != nil { return err } - stateValue, err = didtypesv1.NewStateValue(&temp_s.Data, &temp_s.Metadata) + stateValue, err = didtypesv1.NewStateValue(&tempS.Data, &tempS.Metadata) if err != nil { return err } diff --git a/tests/upgrade/unit/setup/setup.go b/tests/upgrade/unit/setup/setup.go index faf6f9836..886213815 100644 --- a/tests/upgrade/unit/setup/setup.go +++ b/tests/upgrade/unit/setup/setup.go @@ -125,7 +125,7 @@ func Setup() TestSetup { ParamsKeeper: paramsKeeper, } - setup.DidKeeper.SetDidNamespace(&ctx, didsetup.DID_NAMESPACE) // TODO: Think about it + setup.DidKeeper.SetDidNamespace(&ctx, didsetup.DidNamespace) // TODO: Think about it return setup } diff --git a/x/did/client/cli/query_all_diddoc_versions_metadata.go b/x/did/client/cli/query_all_diddoc_versions_metadata.go index 3baa74366..2408279c3 100644 --- a/x/did/client/cli/query_all_diddoc_versions_metadata.go +++ b/x/did/client/cli/query_all_diddoc_versions_metadata.go @@ -20,7 +20,7 @@ func CmdGetAllDidDocVersionsMetadata() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) did := args[0] - params := &types.QueryGetAllDidDocVersionsMetadataRequest{ + params := &types.QueryAllDidDocVersionsMetadataRequest{ Id: did, } diff --git a/x/did/client/cli/query_diddoc.go b/x/did/client/cli/query_diddoc.go index e18d9d106..84f9ca01c 100644 --- a/x/did/client/cli/query_diddoc.go +++ b/x/did/client/cli/query_diddoc.go @@ -20,7 +20,7 @@ func CmdGetDidDoc() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) did := args[0] - params := &types.QueryGetDidDocRequest{ + params := &types.QueryDidDocRequest{ Id: did, } diff --git a/x/did/client/cli/query_diddoc_version.go b/x/did/client/cli/query_diddoc_version.go index 16eee7b89..7c177ef64 100644 --- a/x/did/client/cli/query_diddoc_version.go +++ b/x/did/client/cli/query_diddoc_version.go @@ -20,10 +20,10 @@ func CmdGetDidDocVersion() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) did := args[0] - versionId := args[1] - params := &types.QueryGetDidDocVersionRequest{ + versionID := args[1] + params := &types.QueryDidDocVersionRequest{ Id: did, - Version: versionId, + Version: versionID, } resp, err := queryClient.DidDocVersion(context.Background(), params) diff --git a/x/did/client/cli/tx.go b/x/did/client/cli/tx.go index 65574845a..05ac7af56 100644 --- a/x/did/client/cli/tx.go +++ b/x/did/client/cli/tx.go @@ -20,7 +20,7 @@ type PayloadWithSignInputs struct { } type SignInput struct { - VerificationMethodId string + VerificationMethodID string PrivKey ed25519.PrivateKey } @@ -42,13 +42,13 @@ func GetTxCmd() *cobra.Command { } func SignWithSignInputs(signBytes []byte, signInputs []SignInput) []*types.SignInfo { - var signatures []*types.SignInfo + signatures := make([]*types.SignInfo, 0, len(signInputs)) for _, signInput := range signInputs { signatureBytes := ed25519.Sign(signInput.PrivKey, signBytes) signInfo := types.SignInfo{ - VerificationMethodId: signInput.VerificationMethodId, + VerificationMethodId: signInput.VerificationMethodID, Signature: signatureBytes, } diff --git a/x/did/client/cli/tx_create_diddoc.go b/x/did/client/cli/tx_create_diddoc.go index 06adcc239..182b324ea 100644 --- a/x/did/client/cli/tx_create_diddoc.go +++ b/x/did/client/cli/tx_create_diddoc.go @@ -29,14 +29,14 @@ func CmdCreateDidDoc() *cobra.Command { payloadFile := args[0] - payloadJson, signInputs, err := ReadPayloadWithSignInputsFromFile(payloadFile) + payloadJSON, signInputs, err := ReadPayloadWithSignInputsFromFile(payloadFile) if err != nil { return err } // Unmarshal payload var payload types.MsgCreateDidDocPayload - err = clientCtx.Codec.UnmarshalJSON([]byte(payloadJson), &payload) + err = clientCtx.Codec.UnmarshalJSON([]byte(payloadJSON), &payload) if err != nil { return err } diff --git a/x/did/client/cli/tx_deactivate_diddoc.go b/x/did/client/cli/tx_deactivate_diddoc.go index 26ce140d6..cf2503bcc 100644 --- a/x/did/client/cli/tx_deactivate_diddoc.go +++ b/x/did/client/cli/tx_deactivate_diddoc.go @@ -24,14 +24,14 @@ func CmdDeactivateDidDoc() *cobra.Command { payloadFile := args[0] - payloadJson, signInputs, err := ReadPayloadWithSignInputsFromFile(payloadFile) + payloadJSON, signInputs, err := ReadPayloadWithSignInputsFromFile(payloadFile) if err != nil { return err } // Build payload payload := types.MsgDeactivateDidDocPayload{} - err = clientCtx.Codec.UnmarshalJSON([]byte(payloadJson), &payload) + err = clientCtx.Codec.UnmarshalJSON([]byte(payloadJSON), &payload) if err != nil { return err } diff --git a/x/did/client/cli/tx_update_diddoc.go b/x/did/client/cli/tx_update_diddoc.go index 7ff9a1052..537c35814 100644 --- a/x/did/client/cli/tx_update_diddoc.go +++ b/x/did/client/cli/tx_update_diddoc.go @@ -24,14 +24,14 @@ func CmdUpdateDidDoc() *cobra.Command { payloadFile := args[0] - payloadJson, signInputs, err := ReadPayloadWithSignInputsFromFile(payloadFile) + payloadJSON, signInputs, err := ReadPayloadWithSignInputsFromFile(payloadFile) if err != nil { return err } // Unmarshal payload var payload types.MsgUpdateDidDocPayload - err = clientCtx.Codec.UnmarshalJSON([]byte(payloadJson), &payload) + err = clientCtx.Codec.UnmarshalJSON([]byte(payloadJSON), &payload) if err != nil { return err } diff --git a/x/did/keeper/keeper_config.go b/x/did/keeper/keeper_config.go index 8dcb812c7..751baa316 100644 --- a/x/did/keeper/keeper_config.go +++ b/x/did/keeper/keeper_config.go @@ -2,7 +2,7 @@ package keeper import ( "github.com/cheqd/cheqd-node/x/did/types" - . "github.com/cheqd/cheqd-node/x/did/utils" + "github.com/cheqd/cheqd-node/x/did/utils" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -10,7 +10,7 @@ import ( func (k Keeper) GetDidNamespace(ctx *sdk.Context) string { store := ctx.KVStore(k.storeKey) - key := StrBytes(types.DidNamespaceKey) + key := utils.StrBytes(types.DidNamespaceKey) value := store.Get(key) return string(value) @@ -20,7 +20,7 @@ func (k Keeper) GetDidNamespace(ctx *sdk.Context) string { func (k Keeper) SetDidNamespace(ctx *sdk.Context, namespace string) { store := ctx.KVStore(k.storeKey) - key := StrBytes(types.DidNamespaceKey) + key := utils.StrBytes(types.DidNamespaceKey) value := []byte(namespace) store.Set(key, value) diff --git a/x/did/keeper/keeper_diddoc.go b/x/did/keeper/keeper_diddoc.go index 3e99eafeb..b4331995c 100644 --- a/x/did/keeper/keeper_diddoc.go +++ b/x/did/keeper/keeper_diddoc.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/cheqd/cheqd-node/x/did/types" - . "github.com/cheqd/cheqd-node/x/did/utils" + "github.com/cheqd/cheqd-node/x/did/utils" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -14,7 +14,7 @@ import ( func (k Keeper) GetDidDocCount(ctx *sdk.Context) uint64 { store := ctx.KVStore(k.storeKey) - key := StrBytes(types.DidDocCountKey) + key := utils.StrBytes(types.DidDocCountKey) valueBytes := store.Get(key) // Count doesn't exist: no element @@ -36,7 +36,7 @@ func (k Keeper) GetDidDocCount(ctx *sdk.Context) uint64 { func (k Keeper) SetDidDocCount(ctx *sdk.Context, count uint64) { store := ctx.KVStore(k.storeKey) - key := StrBytes(types.DidDocCountKey) + key := utils.StrBytes(types.DidDocCountKey) valueBytes := []byte(strconv.FormatUint(count, 10)) store.Set(key, valueBytes) @@ -50,12 +50,12 @@ func (k Keeper) AddNewDidDocVersion(ctx *sdk.Context, didDoc *types.DidDocWithMe // Link to the previous version if it exists if k.HasDidDoc(ctx, didDoc.DidDoc.Id) { - latestVersionId, err := k.GetLatestDidDocVersion(ctx, didDoc.DidDoc.Id) + latestVersionID, err := k.GetLatestDidDocVersion(ctx, didDoc.DidDoc.Id) if err != nil { return err } - latestVersion, err := k.GetDidDocVersion(ctx, didDoc.DidDoc.Id, latestVersionId) + latestVersion, err := k.GetDidDocVersion(ctx, didDoc.DidDoc.Id, latestVersionID) if err != nil { return err } @@ -82,12 +82,12 @@ func (k Keeper) AddNewDidDocVersion(ctx *sdk.Context, didDoc *types.DidDocWithMe } func (k Keeper) GetLatestDidDoc(ctx *sdk.Context, did string) (types.DidDocWithMetadata, error) { - latestVersionId, err := k.GetLatestDidDocVersion(ctx, did) + latestVersionID, err := k.GetLatestDidDocVersion(ctx, did) if err != nil { return types.DidDocWithMetadata{}, err } - latestVersion, err := k.GetDidDocVersion(ctx, did, latestVersionId) + latestVersion, err := k.GetDidDocVersion(ctx, did, latestVersionID) if err != nil { return types.DidDocWithMetadata{}, err } @@ -156,7 +156,7 @@ func (k Keeper) SetLatestDidDocVersion(ctx *sdk.Context, did, version string) er store := ctx.KVStore(k.storeKey) key := types.GetLatestDidDocVersionKey(did) - valueBytes := StrBytes(version) + valueBytes := utils.StrBytes(version) store.Set(key, valueBytes) return nil diff --git a/x/did/keeper/msg_server.go b/x/did/keeper/msg_server.go index 27b5c21d0..89672bcbb 100644 --- a/x/did/keeper/msg_server.go +++ b/x/did/keeper/msg_server.go @@ -50,8 +50,8 @@ func MustFindDidDoc(k *Keeper, ctx *sdk.Context, inMemoryDIDDocs map[string]type return res, nil } -func FindVerificationMethod(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.DidDocWithMetadata, didUrl string) (res types.VerificationMethod, found bool, err error) { - did, _, _, _ := utils.MustSplitDIDUrl(didUrl) +func FindVerificationMethod(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.DidDocWithMetadata, didURL string) (res types.VerificationMethod, found bool, err error) { + did, _, _, _ := utils.MustSplitDIDUrl(didURL) didDoc, found, err := FindDidDoc(k, ctx, inMemoryDIDs, did) if err != nil || !found { @@ -59,7 +59,7 @@ func FindVerificationMethod(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string } for _, vm := range didDoc.DidDoc.VerificationMethod { - if vm.Id == didUrl { + if vm.Id == didURL { return *vm, true, nil } } @@ -67,14 +67,14 @@ func FindVerificationMethod(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string return types.VerificationMethod{}, false, nil } -func MustFindVerificationMethod(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.DidDocWithMetadata, didUrl string) (res types.VerificationMethod, err error) { - res, found, err := FindVerificationMethod(k, ctx, inMemoryDIDs, didUrl) +func MustFindVerificationMethod(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.DidDocWithMetadata, didURL string) (res types.VerificationMethod, err error) { + res, found, err := FindVerificationMethod(k, ctx, inMemoryDIDs, didURL) if err != nil { return types.VerificationMethod{}, err } if !found { - return types.VerificationMethod{}, types.ErrVerificationMethodNotFound.Wrap(didUrl) + return types.VerificationMethod{}, types.ErrVerificationMethodNotFound.Wrap(didURL) } return res, nil @@ -114,13 +114,13 @@ func VerifyAllSignersHaveAllValidSignatures(k *Keeper, ctx *sdk.Context, inMemor } // VerifyAllSignersHaveAtLeastOneValidSignature verifies that all signers have at least one valid signature. -// Omit DIDtoBeUpdated and updatedDID if not updating a DID. Otherwise those values will be used to better format error messages. +// Omit didToBeUpdated and updatedDID if not updating a DID. Otherwise those values will be used to better format error messages. func VerifyAllSignersHaveAtLeastOneValidSignature(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.DidDocWithMetadata, - message []byte, signers []string, signatures []*types.SignInfo, DIDToBeUpdated string, updatedDID string, + message []byte, signers []string, signatures []*types.SignInfo, didToBeUpdated string, updatedDID string, ) error { for _, signer := range signers { signaturesBySigner := types.FindSignInfosBySigner(signatures, signer) - signerForErrorMessage := GetSignerIdForErrorMessage(signer, DIDToBeUpdated, updatedDID) + signerForErrorMessage := GetSignerIDForErrorMessage(signer, didToBeUpdated, updatedDID) if len(signaturesBySigner) == 0 { return types.ErrSignatureNotFound.Wrapf("there should be at least one signature by %s", signerForErrorMessage) diff --git a/x/did/keeper/msg_server_update_diddoc.go b/x/did/keeper/msg_server_update_diddoc.go index 2f735d24b..7924d3d8e 100644 --- a/x/did/keeper/msg_server_update_diddoc.go +++ b/x/did/keeper/msg_server_update_diddoc.go @@ -89,20 +89,20 @@ func (k MsgServer) UpdateDidDoc(goCtx context.Context, msg *types.MsgUpdateDidDo }, nil } -func GetSignerIdForErrorMessage(signerId string, existingVersionId string, updatedVersionId string) interface{} { - if signerId == existingVersionId { // oldDid->id - return existingVersionId + " (old version)" +func GetSignerIDForErrorMessage(signerID string, existingVersionID string, updatedVersionID string) interface{} { + if signerID == existingVersionID { // oldDid->id + return existingVersionID + " (old version)" } - if signerId == updatedVersionId { // oldDid->id + UpdatedPrefix - return existingVersionId + " (new version)" + if signerID == updatedVersionID { // oldDid->id + UpdatedPrefix + return existingVersionID + " (new version)" } - return signerId + return signerID } func DuplicateSignatures(signatures []*types.SignInfo, didToDuplicate string, newDid string) []*types.SignInfo { - var result []*types.SignInfo + result := make([]*types.SignInfo, 0, len(signatures)) for _, signature := range signatures { result = append(result, signature) diff --git a/x/did/keeper/querier_all_diddoc_versions_metadata.go b/x/did/keeper/querier_all_diddoc_versions_metadata.go index a4846f7e4..fe9e1e70d 100644 --- a/x/did/keeper/querier_all_diddoc_versions_metadata.go +++ b/x/did/keeper/querier_all_diddoc_versions_metadata.go @@ -10,7 +10,7 @@ import ( func getAllDidDocVersionsMetadata(ctx sdk.Context, id string, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { queryServer := NewQueryServer(keeper) - resp, err := queryServer.AllDidDocVersionsMetadata(sdk.WrapSDKContext(ctx), &types.QueryGetAllDidDocVersionsMetadataRequest{Id: id}) + resp, err := queryServer.AllDidDocVersionsMetadata(sdk.WrapSDKContext(ctx), &types.QueryAllDidDocVersionsMetadataRequest{Id: id}) if err != nil { return nil, err } diff --git a/x/did/keeper/querier_diddoc.go b/x/did/keeper/querier_diddoc.go index b749e85c6..610bd0a3d 100644 --- a/x/did/keeper/querier_diddoc.go +++ b/x/did/keeper/querier_diddoc.go @@ -10,7 +10,7 @@ import ( func getDidDoc(ctx sdk.Context, id string, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { queryServer := NewQueryServer(keeper) - resp, err := queryServer.DidDoc(sdk.WrapSDKContext(ctx), &types.QueryGetDidDocRequest{Id: id}) + resp, err := queryServer.DidDoc(sdk.WrapSDKContext(ctx), &types.QueryDidDocRequest{Id: id}) if err != nil { return nil, err } diff --git a/x/did/keeper/querier_diddoc_version.go b/x/did/keeper/querier_diddoc_version.go index acbd381c3..b61a002f9 100644 --- a/x/did/keeper/querier_diddoc_version.go +++ b/x/did/keeper/querier_diddoc_version.go @@ -10,7 +10,7 @@ import ( func getDidDocVersion(ctx sdk.Context, id, version string, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { queryServer := NewQueryServer(keeper) - resp, err := queryServer.DidDocVersion(sdk.WrapSDKContext(ctx), &types.QueryGetDidDocVersionRequest{Id: id, Version: version}) + resp, err := queryServer.DidDocVersion(sdk.WrapSDKContext(ctx), &types.QueryDidDocVersionRequest{Id: id, Version: version}) if err != nil { return nil, err } diff --git a/x/did/keeper/query_server_all_diddoc_versions_metadata.go b/x/did/keeper/query_server_all_diddoc_versions_metadata.go index 194d4d907..41a8a0d73 100644 --- a/x/did/keeper/query_server_all_diddoc_versions_metadata.go +++ b/x/did/keeper/query_server_all_diddoc_versions_metadata.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/status" ) -func (k Keeper) AllDidDocVersionsMetadata(c context.Context, req *types.QueryGetAllDidDocVersionsMetadataRequest) (*types.QueryGetAllDidDocVersionsMetadataResponse, error) { +func (k Keeper) AllDidDocVersionsMetadata(c context.Context, req *types.QueryAllDidDocVersionsMetadataRequest) (*types.QueryAllDidDocVersionsMetadataResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -23,5 +23,5 @@ func (k Keeper) AllDidDocVersionsMetadata(c context.Context, req *types.QueryGet return nil, err } - return &types.QueryGetAllDidDocVersionsMetadataResponse{Versions: versions}, nil + return &types.QueryAllDidDocVersionsMetadataResponse{Versions: versions}, nil } diff --git a/x/did/keeper/query_server_diddoc.go b/x/did/keeper/query_server_diddoc.go index e7507847e..53c9e1b92 100644 --- a/x/did/keeper/query_server_diddoc.go +++ b/x/did/keeper/query_server_diddoc.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/status" ) -func (k Keeper) DidDoc(c context.Context, req *types.QueryGetDidDocRequest) (*types.QueryGetDidDocResponse, error) { +func (k Keeper) DidDoc(c context.Context, req *types.QueryDidDocRequest) (*types.QueryDidDocResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -23,5 +23,5 @@ func (k Keeper) DidDoc(c context.Context, req *types.QueryGetDidDocRequest) (*ty return nil, err } - return &types.QueryGetDidDocResponse{Value: &didDoc}, nil + return &types.QueryDidDocResponse{Value: &didDoc}, nil } diff --git a/x/did/keeper/query_server_diddoc_version.go b/x/did/keeper/query_server_diddoc_version.go index 617c91694..8e52d3398 100644 --- a/x/did/keeper/query_server_diddoc_version.go +++ b/x/did/keeper/query_server_diddoc_version.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/status" ) -func (k Keeper) DidDocVersion(c context.Context, req *types.QueryGetDidDocVersionRequest) (*types.QueryGetDidDocVersionResponse, error) { +func (k Keeper) DidDocVersion(c context.Context, req *types.QueryDidDocVersionRequest) (*types.QueryDidDocVersionResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -23,5 +23,5 @@ func (k Keeper) DidDocVersion(c context.Context, req *types.QueryGetDidDocVersio return nil, err } - return &types.QueryGetDidDocVersionResponse{Value: &didDoc}, nil + return &types.QueryDidDocVersionResponse{Value: &didDoc}, nil } diff --git a/x/did/module.go b/x/did/module.go index bfb1ff794..1457a472e 100644 --- a/x/did/module.go +++ b/x/did/module.go @@ -15,7 +15,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" - //"github.com/cheqd/cheqd-node/x/did/client/rest" + // "github.com/cheqd/cheqd-node/x/did/client/rest" "github.com/cheqd/cheqd-node/x/did/keeper" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/did/tests/create_diddoc_test.go b/x/did/tests/create_diddoc_test.go index 966b910f1..565c1dd81 100644 --- a/x/did/tests/create_diddoc_test.go +++ b/x/did/tests/create_diddoc_test.go @@ -3,45 +3,44 @@ package tests import ( "fmt" - . "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/google/uuid" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/cheqd/cheqd-node/x/did/tests/setup" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/cheqd/cheqd-node/x/did/types" ) var _ = Describe("Create DID tests", func() { - var setup setup.TestSetup + var setup testsetup.TestSetup BeforeEach(func() { - setup = Setup() + setup = testsetup.Setup() }) It("Valid: Works for simple DIDDoc (Ed25519VerificationKey2020)", func() { - did := GenerateDID(Base58_16bytes) - keypair := GenerateKeyPair() - keyId := did + "#key-1" + did := testsetup.GenerateDID(testsetup.Base58_16bytes) + keypair := testsetup.GenerateKeyPair() + keyID := did + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: did, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair.Public), + Id: keyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair.Public), }, }, VersionId: uuid.NewString(), } - signatures := []SignInput{ + signatures := []testsetup.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyID, Key: keypair.Private, }, } @@ -56,27 +55,62 @@ var _ = Describe("Create DID tests", func() { }) It("Valid: Works for simple DIDDoc (JsonWebKey2020)", func() { - did := GenerateDID(Base58_16bytes) - keypair := GenerateKeyPair() - keyId := did + "#key-1" + did := testsetup.GenerateDID(testsetup.Base58_16bytes) + keypair := testsetup.GenerateKeyPair() + keyID := did + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: did, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: types.JsonWebKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildJsonWebKey2020VerificationMaterial(keypair.Public), + Id: keyID, + VerificationMethodType: types.JSONWebKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateJSONWebKey2020VerificationMaterial(keypair.Public), }, }, VersionId: uuid.NewString(), } - signatures := []SignInput{ + signatures := []testsetup.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyID, + Key: keypair.Private, + }, + } + + _, err := setup.CreateDid(msg, signatures) + Expect(err).To(BeNil()) + + // check + created, err := setup.QueryDidDoc(did) + Expect(err).To(BeNil()) + Expect(msg.ToDidDoc()).To(Equal(*created.Value.DidDoc)) + }) + + It("Valid: Works for simple DIDDoc (Ed25519VerificationKey2018)", func() { + did := testsetup.GenerateDID(testsetup.Base58_16bytes) + keypair := testsetup.GenerateKeyPair() + keyID := did + "#key-1" + + msg := &types.MsgCreateDidDocPayload{ + Id: did, + Authentication: []string{keyID}, + VerificationMethod: []*types.VerificationMethod{ + { + Id: keyID, + VerificationMethodType: types.Ed25519VerificationKey2018Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2018VerificationMaterial(keypair.Public), + }, + }, + VersionId: uuid.NewString(), + } + + signatures := []testsetup.SignInput{ + { + VerificationMethodID: keyID, Key: keypair.Private, }, } @@ -96,26 +130,26 @@ var _ = Describe("Create DID tests", func() { anna := setup.CreateSimpleDid() // Bob - bobDid := GenerateDID(Base58_16bytes) - bobKeypair := GenerateKeyPair() - bobKeyId := bobDid + "#key-1" + bobDid := testsetup.GenerateDID(testsetup.Base58_16bytes) + bobKeypair := testsetup.GenerateKeyPair() + bobKeyID := bobDid + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: bobDid, Controller: []string{alice.Did, anna.Did}, - Authentication: []string{bobKeyId}, + Authentication: []string{bobKeyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: bobKeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: anna.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(bobKeypair.Public), + Id: bobKeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: anna.Did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(bobKeypair.Public), }, }, VersionId: uuid.NewString(), } - signatures := []SignInput{alice.SignInput, anna.SignInput} + signatures := []testsetup.SignInput{alice.SignInput, anna.SignInput} _, err := setup.CreateDid(msg, signatures) Expect(err).To(BeNil()) @@ -127,19 +161,19 @@ var _ = Describe("Create DID tests", func() { }) It("Valid: Works for DIDDoc with all properties", func() { - did := GenerateDID(Base58_16bytes) + did := testsetup.GenerateDID(testsetup.Base58_16bytes) - keypair1 := GenerateKeyPair() - keyId1 := did + "#key-1" + keypair1 := testsetup.GenerateKeyPair() + keyID1 := did + "#key-1" - keypair2 := GenerateKeyPair() - keyId2 := did + "#key-2" + keypair2 := testsetup.GenerateKeyPair() + keyID2 := did + "#key-2" - keypair3 := GenerateKeyPair() - keyId3 := did + "#key-3" + keypair3 := testsetup.GenerateKeyPair() + keyID3 := did + "#key-3" - keypair4 := GenerateKeyPair() - keyId4 := did + "#key-4" + keypair4 := testsetup.GenerateKeyPair() + keyID4 := did + "#key-4" msg := &types.MsgCreateDidDocPayload{ Context: []string{"abc", "def"}, @@ -147,39 +181,39 @@ var _ = Describe("Create DID tests", func() { Controller: []string{did}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId1, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair1.Public), + Id: keyID1, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair1.Public), }, { - Id: keyId2, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair2.Public), + Id: keyID2, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair2.Public), }, { - Id: keyId3, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair3.Public), + Id: keyID3, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair3.Public), }, { - Id: keyId4, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair4.Public), + Id: keyID4, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair4.Public), }, }, - Authentication: []string{keyId1, keyId2}, - AssertionMethod: []string{keyId3}, - CapabilityInvocation: []string{keyId4, keyId1}, - CapabilityDelegation: []string{keyId4, keyId2}, - KeyAgreement: []string{keyId1, keyId2, keyId3, keyId4}, + Authentication: []string{keyID1, keyID2}, + AssertionMethod: []string{keyID3}, + CapabilityInvocation: []string{keyID4, keyID1}, + CapabilityDelegation: []string{keyID4, keyID2}, + KeyAgreement: []string{keyID1, keyID2, keyID3, keyID4}, Service: []*types.Service{ { Id: did + "#service-1", - Type: "type-1", + ServiceType: "type-1", ServiceEndpoint: []string{"endpoint-1"}, }, }, @@ -187,9 +221,9 @@ var _ = Describe("Create DID tests", func() { VersionId: uuid.NewString(), } - signatures := []SignInput{ + signatures := []testsetup.SignInput{ { - VerificationMethodId: keyId1, + VerificationMethodID: keyID1, Key: keypair1.Private, }, } @@ -212,28 +246,28 @@ var _ = Describe("Create DID tests", func() { alice := setup.CreateSimpleDid() // Bob - bobDid := GenerateDID(Base58_16bytes) - bobKeypair := GenerateKeyPair() - bobKeyId := bobDid + "#key-1" + bobDid := testsetup.GenerateDID(testsetup.Base58_16bytes) + bobKeypair := testsetup.GenerateKeyPair() + bobKeyID := bobDid + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: bobDid, Controller: []string{alice.Did, bobDid}, - Authentication: []string{bobKeyId}, + Authentication: []string{bobKeyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: bobKeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: bobDid, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(bobKeypair.Public), + Id: bobKeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: bobDid, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(bobKeypair.Public), }, }, VersionId: uuid.NewString(), } - signatures := []SignInput{ + signatures := []testsetup.SignInput{ { - VerificationMethodId: bobKeyId, + VerificationMethodID: bobKeyID, Key: bobKeypair.Private, }, } @@ -243,90 +277,96 @@ var _ = Describe("Create DID tests", func() { }) It("Not Valid: No signature", func() { - did := GenerateDID(Base58_16bytes) - keypair := GenerateKeyPair() - keyId := did + "#key-1" + did := testsetup.GenerateDID(testsetup.Base58_16bytes) + keypair := testsetup.GenerateKeyPair() + keyID := did + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: did, Controller: []string{did}, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair.Public), + Id: keyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair.Public), }, }, VersionId: uuid.NewString(), } - signatures := []SignInput{} + signatures := []testsetup.SignInput{} _, err := setup.CreateDid(msg, signatures) Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("signer: %s: signature is required but not found", did))) }) It("Not Valid: Controller not found", func() { - did := GenerateDID(Base58_16bytes) - keypair := GenerateKeyPair() - keyId := did + "#key-1" + did := testsetup.GenerateDID(testsetup.Base58_16bytes) + keypair := testsetup.GenerateKeyPair() + keyID := did + "#key-1" - nonExistingDid := GenerateDID(Base58_16bytes) + nonExistingDid := testsetup.GenerateDID(testsetup.Base58_16bytes) msg := &types.MsgCreateDidDocPayload{ Id: did, Controller: []string{nonExistingDid}, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair.Public), + Id: keyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair.Public), }, }, VersionId: uuid.NewString(), } - signatures := []SignInput{} + signatures := []testsetup.SignInput{ + { + VerificationMethodID: keyID, + Key: keypair.Private, + }, + } _, err := setup.CreateDid(msg, signatures) + Expect(err).ToNot(BeNil()) Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("%s: DID Doc not found", nonExistingDid))) }) It("Not Valid: Wrong signature", func() { - did := GenerateDID(Base58_16bytes) - keypair := GenerateKeyPair() - keyId := did + "#key-1" + did := testsetup.GenerateDID(testsetup.Base58_16bytes) + keypair := testsetup.GenerateKeyPair() + keyID := did + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: did, Controller: []string{did}, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair.Public), + Id: keyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair.Public), }, }, VersionId: uuid.NewString(), } - invalidKey := GenerateKeyPair() + invalidKey := testsetup.GenerateKeyPair() - signatures := []SignInput{ + signatures := []testsetup.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyID, Key: invalidKey.Private, }, } _, err := setup.CreateDid(msg, signatures) - Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("method id: %s: invalid signature detected", keyId))) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("method id: %s: invalid signature detected", keyID))) }) It("Not Valid: DID signed by wrong controller", func() { @@ -334,62 +374,62 @@ var _ = Describe("Create DID tests", func() { alice := setup.CreateSimpleDid() // Bob - bobDid := GenerateDID(Base58_16bytes) - bobKeypair := GenerateKeyPair() - bobKeyId := bobDid + "#key-1" + bobDid := testsetup.GenerateDID(testsetup.Base58_16bytes) + bobKeypair := testsetup.GenerateKeyPair() + bobKeyID := bobDid + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: bobDid, Controller: []string{bobDid}, - Authentication: []string{bobKeyId}, + Authentication: []string{bobKeyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: bobKeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: bobDid, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(bobKeypair.Public), + Id: bobKeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: bobDid, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(bobKeypair.Public), }, }, VersionId: uuid.NewString(), } - signatures := []SignInput{alice.SignInput} + signatures := []testsetup.SignInput{alice.SignInput} _, err := setup.CreateDid(msg, signatures) Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("signer: %s: signature is required but not found", bobDid))) }) It("Not Valid: DID signed by invalid verification method", func() { - did := GenerateDID(Base58_16bytes) - keypair := GenerateKeyPair() - keyId := did + "#key-1" + did := testsetup.GenerateDID(testsetup.Base58_16bytes) + keypair := testsetup.GenerateKeyPair() + keyID := did + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: did, Controller: []string{did}, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair.Public), + Id: keyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair.Public), }, }, VersionId: uuid.NewString(), } - invalidKeyId := did + "#key-2" + invalidKeyID := did + "#key-2" - signatures := []SignInput{ + signatures := []testsetup.SignInput{ { - VerificationMethodId: invalidKeyId, + VerificationMethodID: invalidKeyID, Key: keypair.Private, }, } _, err := setup.CreateDid(msg, signatures) - Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("%s: verification method not found", invalidKeyId))) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("%s: verification method not found", invalidKeyID))) }) It("Not Valid: DIDDoc already exists", func() { @@ -398,18 +438,18 @@ var _ = Describe("Create DID tests", func() { msg := &types.MsgCreateDidDocPayload{ Id: alice.Did, - Authentication: []string{alice.KeyId}, + Authentication: []string{alice.KeyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: alice.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, }, } - signatures := []SignInput{alice.SignInput} + signatures := []testsetup.SignInput{alice.SignInput} _, err := setup.CreateDid(msg, signatures) Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("%s: DID Doc exists", alice.Did))) @@ -417,37 +457,37 @@ var _ = Describe("Create DID tests", func() { }) var _ = Describe("Check upper/lower case for DID creation", func() { - var setup setup.TestSetup - var didPrefix string = "did:cheqd:testnet:" + var setup testsetup.TestSetup + didPrefix := "did:cheqd:testnet:" type TestCaseUUIDDidStruct struct { - inputId string - resultId string + inputID string + resultID string } DescribeTable("Check upper/lower case for DID creation", func(testCase TestCaseUUIDDidStruct) { - setup = Setup() - did := testCase.inputId - keypair := GenerateKeyPair() - keyId := did + "#key-1" + setup = testsetup.Setup() + did := testCase.inputID + keypair := testsetup.GenerateKeyPair() + keyID := did + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: did, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keypair.Public), + Id: keyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(keypair.Public), }, }, VersionId: uuid.NewString(), } - signatures := []SignInput{ + signatures := []testsetup.SignInput{ { - VerificationMethodId: keyId, + VerificationMethodID: keyID, Key: keypair.Private, }, } @@ -458,24 +498,24 @@ var _ = Describe("Check upper/lower case for DID creation", func() { // check created, err := setup.QueryDidDoc(did) Expect(err).To(BeNil()) - Expect(created.Value.DidDoc.Id).To(Equal(testCase.resultId)) + Expect(created.Value.DidDoc.Id).To(Equal(testCase.resultID)) }, Entry("Lowercase UUIDs", TestCaseUUIDDidStruct{ - inputId: didPrefix + "a86f9cae-0902-4a7c-a144-96b60ced2fc9", - resultId: didPrefix + "a86f9cae-0902-4a7c-a144-96b60ced2fc9", + inputID: didPrefix + "a86f9cae-0902-4a7c-a144-96b60ced2fc9", + resultID: didPrefix + "a86f9cae-0902-4a7c-a144-96b60ced2fc9", }), Entry("Uppercase UUIDs", TestCaseUUIDDidStruct{ - inputId: didPrefix + "A86F9CAE-0902-4A7C-A144-96B60CED2FC9", - resultId: didPrefix + "a86f9cae-0902-4a7c-a144-96b60ced2fc9", + inputID: didPrefix + "A86F9CAE-0902-4A7C-A144-96B60CED2FC9", + resultID: didPrefix + "a86f9cae-0902-4a7c-a144-96b60ced2fc9", }), Entry("Mixed case UUIDs", TestCaseUUIDDidStruct{ - inputId: didPrefix + "A86F9CAE-0902-4a7c-a144-96b60ced2FC9", - resultId: didPrefix + "a86f9cae-0902-4a7c-a144-96b60ced2fc9", + inputID: didPrefix + "A86F9CAE-0902-4a7c-a144-96b60ced2FC9", + resultID: didPrefix + "a86f9cae-0902-4a7c-a144-96b60ced2fc9", }), Entry("Indy-style IDs", TestCaseUUIDDidStruct{ - inputId: didPrefix + "zABCDEFG123456789abcd", - resultId: didPrefix + "zABCDEFG123456789abcd", + inputID: didPrefix + "zABCDEFG123456789abcd", + resultID: didPrefix + "zABCDEFG123456789abcd", }), ) }) diff --git a/x/did/tests/deactivate_diddoc_test.go b/x/did/tests/deactivate_diddoc_test.go index 842630bc6..e65e28d60 100644 --- a/x/did/tests/deactivate_diddoc_test.go +++ b/x/did/tests/deactivate_diddoc_test.go @@ -3,21 +3,20 @@ package tests import ( "fmt" - . "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/google/uuid" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/cheqd/cheqd-node/x/did/tests/setup" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" "github.com/cheqd/cheqd-node/x/did/types" ) var _ = Describe("Deactivate DID tests", func() { - var setup setup.TestSetup + var setup testsetup.TestSetup BeforeEach(func() { - setup = Setup() + setup = testsetup.Setup() }) It("Valid: Deactivate DID", func() { @@ -28,7 +27,7 @@ var _ = Describe("Deactivate DID tests", func() { VersionId: uuid.NewString(), } - signatures := []SignInput{alice.DidDocInfo.SignInput} + signatures := []testsetup.SignInput{alice.DidDocInfo.SignInput} res, err := setup.DeactivateDidDoc(msg, signatures) Expect(err).To(BeNil()) @@ -45,14 +44,14 @@ var _ = Describe("Deactivate DID tests", func() { When("DID is not found", func() { It("Should return error", func() { - NotFoundDID := GenerateDID(Base58_16bytes) + NotFoundDID := testsetup.GenerateDID(testsetup.Base58_16bytes) msg := &types.MsgDeactivateDidDocPayload{ Id: NotFoundDID, VersionId: uuid.NewString(), } - signatures := []SignInput{} + signatures := []testsetup.SignInput{} _, err := setup.DeactivateDidDoc(msg, signatures) Expect(err).ToNot(BeNil()) @@ -69,7 +68,7 @@ var _ = Describe("Deactivate DID tests", func() { VersionId: uuid.NewString(), } - signatures := []SignInput{alice.DidDocInfo.SignInput} + signatures := []testsetup.SignInput{alice.DidDocInfo.SignInput} res, err := setup.DeactivateDidDoc(msg, signatures) Expect(err).To(BeNil()) @@ -94,7 +93,7 @@ var _ = Describe("Deactivate DID tests", func() { VersionId: uuid.NewString(), } - signatures := []SignInput{bob.DidDocInfo.SignInput} + signatures := []testsetup.SignInput{bob.DidDocInfo.SignInput} _, err := setup.DeactivateDidDoc(msg, signatures) Expect(err).ToNot(BeNil()) diff --git a/x/did/tests/setup/config.go b/x/did/tests/setup/config.go index debef10b7..79436ab9b 100644 --- a/x/did/tests/setup/config.go +++ b/x/did/tests/setup/config.go @@ -1,3 +1,3 @@ package setup -const DID_NAMESPACE = "testnet" +const DidNamespace = "testnet" diff --git a/x/did/tests/setup/setup.go b/x/did/tests/setup/setup.go index 47af1b2b7..5117c7e19 100644 --- a/x/did/tests/setup/setup.go +++ b/x/did/tests/setup/setup.go @@ -80,7 +80,7 @@ func Setup() TestSetup { QueryServer: queryServer, } - setup.Keeper.SetDidNamespace(&ctx, DID_NAMESPACE) + setup.Keeper.SetDidNamespace(&ctx, DidNamespace) return setup } diff --git a/x/did/tests/setup/setup_create_diddoc.go b/x/did/tests/setup/setup_create_diddoc.go index 81949408a..6235098dd 100644 --- a/x/did/tests/setup/setup_create_diddoc.go +++ b/x/did/tests/setup/setup_create_diddoc.go @@ -10,13 +10,13 @@ import ( func (s *TestSetup) CreateDid(payload *types.MsgCreateDidDocPayload, signInputs []SignInput) (*types.MsgCreateDidDocResponse, error) { signBytes := payload.GetSignBytes() - var signatures []*types.SignInfo + signatures := make([]*types.SignInfo, 0, len(signInputs)) for _, input := range signInputs { signature := ed25519.Sign(input.Key, signBytes) signatures = append(signatures, &types.SignInfo{ - VerificationMethodId: input.VerificationMethodId, + VerificationMethodId: input.VerificationMethodID, Signature: signature, }) } @@ -30,42 +30,42 @@ func (s *TestSetup) CreateDid(payload *types.MsgCreateDidDocPayload, signInputs } func (s *TestSetup) BuildDidDocWithCustomDID(did string) DidDocInfo { - _, _, collectionId := utils.MustSplitDID(did) + _, _, collectionID := utils.MustSplitDID(did) keyPair := GenerateKeyPair() - keyId := did + "#key-1" + keyID := did + "#key-1" msg := &types.MsgCreateDidDocPayload{ Id: did, VerificationMethod: []*types.VerificationMethod{ { - Id: keyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(keyPair.Public), + Id: keyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(keyPair.Public), }, }, - Authentication: []string{keyId}, + Authentication: []string{keyID}, VersionId: uuid.NewString(), } signInput := SignInput{ - VerificationMethodId: keyId, + VerificationMethodID: keyID, Key: keyPair.Private, } return DidDocInfo{ Did: did, - CollectionId: collectionId, + CollectionID: collectionID, KeyPair: keyPair, - KeyId: keyId, + KeyID: keyID, Msg: msg, SignInput: signInput, } } -func (s *TestSetup) BuildDidDocWithCustomId(uuid string) DidDocInfo { - did := "did:cheqd:" + DID_NAMESPACE + ":" + uuid +func (s *TestSetup) BuildDidDocWithCustomID(uuid string) DidDocInfo { + did := "did:cheqd:" + DidNamespace + ":" + uuid return s.BuildDidDocWithCustomDID(did) } @@ -82,7 +82,7 @@ func (s *TestSetup) CreateCustomDidDoc(info DidDocInfo) CreatedDidDocInfo { return CreatedDidDocInfo{ DidDocInfo: info, - VersionId: created.Value.Metadata.VersionId, + VersionID: created.Value.Metadata.VersionId, } } @@ -102,6 +102,6 @@ func (s *TestSetup) CreateDidDocWithExternalControllers(controllers []string, si return CreatedDidDocInfo{ DidDocInfo: did, - VersionId: created.Value.Metadata.VersionId, + VersionID: created.Value.Metadata.VersionId, } } diff --git a/x/did/tests/setup/setup_deactivate_diddoc.go b/x/did/tests/setup/setup_deactivate_diddoc.go index fa038b45c..db7493749 100644 --- a/x/did/tests/setup/setup_deactivate_diddoc.go +++ b/x/did/tests/setup/setup_deactivate_diddoc.go @@ -8,13 +8,13 @@ import ( func (s *TestSetup) DeactivateDidDoc(payload *types.MsgDeactivateDidDocPayload, signInputs []SignInput) (*types.MsgDeactivateDidDocResponse, error) { signBytes := payload.GetSignBytes() - var signatures []*types.SignInfo + signatures := make([]*types.SignInfo, 0, len(signInputs)) for _, input := range signInputs { signature := ed25519.Sign(input.Key, signBytes) signatures = append(signatures, &types.SignInfo{ - VerificationMethodId: input.VerificationMethodId, + VerificationMethodId: input.VerificationMethodID, Signature: signature, }) } diff --git a/x/did/tests/setup/setup_query_all_diddoc_versions_matadata.go b/x/did/tests/setup/setup_query_all_diddoc_versions_matadata.go index eb3f4defd..c67bd33f4 100644 --- a/x/did/tests/setup/setup_query_all_diddoc_versions_matadata.go +++ b/x/did/tests/setup/setup_query_all_diddoc_versions_matadata.go @@ -2,8 +2,8 @@ package setup import "github.com/cheqd/cheqd-node/x/did/types" -func (s *TestSetup) QueryAllDidDocVersionsMetadata(did string) (*types.QueryGetAllDidDocVersionsMetadataResponse, error) { - req := &types.QueryGetAllDidDocVersionsMetadataRequest{ +func (s *TestSetup) QueryAllDidDocVersionsMetadata(did string) (*types.QueryAllDidDocVersionsMetadataResponse, error) { + req := &types.QueryAllDidDocVersionsMetadataRequest{ Id: did, } diff --git a/x/did/tests/setup/setup_query_diddoc.go b/x/did/tests/setup/setup_query_diddoc.go index d00b30eeb..f143cb284 100644 --- a/x/did/tests/setup/setup_query_diddoc.go +++ b/x/did/tests/setup/setup_query_diddoc.go @@ -2,8 +2,8 @@ package setup import "github.com/cheqd/cheqd-node/x/did/types" -func (s *TestSetup) QueryDidDoc(did string) (*types.QueryGetDidDocResponse, error) { - req := &types.QueryGetDidDocRequest{ +func (s *TestSetup) QueryDidDoc(did string) (*types.QueryDidDocResponse, error) { + req := &types.QueryDidDocRequest{ Id: did, } diff --git a/x/did/tests/setup/setup_query_diddoc_version.go b/x/did/tests/setup/setup_query_diddoc_version.go index abf6aabc3..f5d2d4af4 100644 --- a/x/did/tests/setup/setup_query_diddoc_version.go +++ b/x/did/tests/setup/setup_query_diddoc_version.go @@ -2,8 +2,8 @@ package setup import "github.com/cheqd/cheqd-node/x/did/types" -func (s *TestSetup) QueryDidDocVersion(did, version string) (*types.QueryGetDidDocVersionResponse, error) { - req := &types.QueryGetDidDocVersionRequest{ +func (s *TestSetup) QueryDidDocVersion(did, version string) (*types.QueryDidDocVersionResponse, error) { + req := &types.QueryDidDocVersionRequest{ Id: did, Version: version, } diff --git a/x/did/tests/setup/setup_update_diddoc.go b/x/did/tests/setup/setup_update_diddoc.go index 9f1de4e4a..831bb3818 100644 --- a/x/did/tests/setup/setup_update_diddoc.go +++ b/x/did/tests/setup/setup_update_diddoc.go @@ -8,13 +8,13 @@ import ( func (s *TestSetup) UpdateDidDoc(payload *types.MsgUpdateDidDocPayload, signInputs []SignInput) (*types.MsgUpdateDidDocResponse, error) { signBytes := payload.GetSignBytes() - var signatures []*types.SignInfo + signatures := make([]*types.SignInfo, 0, len(signInputs)) for _, input := range signInputs { signature := ed25519.Sign(input.Key, signBytes) signatures = append(signatures, &types.SignInfo{ - VerificationMethodId: input.VerificationMethodId, + VerificationMethodId: input.VerificationMethodID, Signature: signature, }) } diff --git a/x/did/tests/setup/types.go b/x/did/tests/setup/types.go index c5b757935..ab9b10a3c 100644 --- a/x/did/tests/setup/types.go +++ b/x/did/tests/setup/types.go @@ -12,20 +12,20 @@ type KeyPair struct { } type SignInput struct { - VerificationMethodId string + VerificationMethodID string Key ed25519.PrivateKey } type DidDocInfo struct { Msg *types.MsgCreateDidDocPayload Did string - CollectionId string + CollectionID string KeyPair KeyPair - KeyId string + KeyID string SignInput SignInput } type CreatedDidDocInfo struct { DidDocInfo - VersionId string + VersionID string } diff --git a/x/did/tests/setup/utils.go b/x/did/tests/setup/utils.go index 5065ab2ec..b8d2914ad 100644 --- a/x/did/tests/setup/utils.go +++ b/x/did/tests/setup/utils.go @@ -7,17 +7,16 @@ import ( mathrand "math/rand" "time" - "github.com/cheqd/cheqd-node/x/did/types" - . "github.com/cheqd/cheqd-node/x/did/utils" "github.com/google/uuid" "github.com/lestrrat-go/jwx/jwk" "github.com/mr-tron/base58" + "github.com/multiformats/go-multibase" ) func randBase58Seq(bytes int) string { b := make([]byte, bytes) - _, err := rand.Read(b) + _, err := mathrand.Read(b) if err != nil { panic(err) } @@ -44,7 +43,7 @@ func randSeq(n int) string { } func GenerateDID(idtype IDType) string { - prefix := "did:cheqd:" + DID_NAMESPACE + ":" + prefix := "did:cheqd:" + DidNamespace + ":" mathrand.Seed(time.Now().UnixNano()) switch idtype { @@ -64,24 +63,27 @@ func GenerateKeyPair() KeyPair { return KeyPair{PrivateKey, PublicKey} } -func BuildEd25519VerificationKey2020VerificationMaterial(publicKey ed25519.PublicKey) string { - return MustEncodeJson(types.Ed25519VerificationKey2020{ - PublicKeyMultibase: MustEncodeMultibaseBase58(publicKey), - }) +func GenerateEd25519VerificationKey2020VerificationMaterial(publicKey ed25519.PublicKey) string { + publicKeyMultibaseBytes := []byte{0xed, 0x01} + publicKeyMultibaseBytes = append(publicKeyMultibaseBytes, publicKey...) + keyStr, _ := multibase.Encode(multibase.Base58BTC, publicKeyMultibaseBytes) + return keyStr } -func BuildJsonWebKey2020VerificationMaterial(publicKey ed25519.PublicKey) string { +func GenerateJSONWebKey2020VerificationMaterial(publicKey ed25519.PublicKey) string { pubKeyJwk, err := jwk.New(publicKey) if err != nil { panic(err) } - pubKeyJwkJson, err := json.Marshal(pubKeyJwk) + pubKeyJwkJSON, err := json.Marshal(pubKeyJwk) if err != nil { panic(err) } - return MustEncodeJson(types.JsonWebKey2020{ - PublicKeyJwk: json.RawMessage(pubKeyJwkJson), - }) + return string(pubKeyJwkJSON) +} + +func GenerateEd25519VerificationKey2018VerificationMaterial(publicKey ed25519.PublicKey) string { + return base58.Encode(publicKey) } diff --git a/x/did/tests/tests_suite_test.go b/x/did/tests/tests_suite_test.go index fb621a35f..d3e28bd9c 100644 --- a/x/did/tests/tests_suite_test.go +++ b/x/did/tests/tests_suite_test.go @@ -9,5 +9,5 @@ import ( func TestTestsGeneral(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Cheqd DID Module") + RunSpecs(t, "DID Module") } diff --git a/x/did/tests/update_diddoc_test.go b/x/did/tests/update_diddoc_test.go index fce9b309a..ebf96647f 100644 --- a/x/did/tests/update_diddoc_test.go +++ b/x/did/tests/update_diddoc_test.go @@ -33,14 +33,14 @@ var _ = Describe("DIDDoc update", func() { Controller: []string{alice.Did}, VerificationMethod: []*types.VerificationMethod{ { - Id: bob.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: bob.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(bob.KeyPair.Public), + Id: bob.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: bob.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(bob.KeyPair.Public), }, }, - Authentication: []string{bob.KeyId}, - AssertionMethod: []string{bob.KeyId}, + Authentication: []string{bob.KeyID}, + AssertionMethod: []string{bob.KeyID}, VersionId: uuid.NewString(), } }) @@ -69,10 +69,10 @@ var _ = Describe("DIDDoc update", func() { Expect(msg.ToDidDoc()).To(Equal(*created.Value.DidDoc)) // query the first version - v1, err := setup.QueryDidDocVersion(bob.Did, bob.VersionId) + v1, err := setup.QueryDidDocVersion(bob.Did, bob.VersionID) Expect(err).To(BeNil()) Expect(*v1.Value.DidDoc).To(Equal(bob.Msg.ToDidDoc())) - Expect(v1.Value.Metadata.VersionId).To(Equal(bob.VersionId)) + Expect(v1.Value.Metadata.VersionId).To(Equal(bob.VersionID)) Expect(v1.Value.Metadata.NextVersionId).To(Equal(msg.VersionId)) // query the second version @@ -80,7 +80,7 @@ var _ = Describe("DIDDoc update", func() { Expect(err).To(BeNil()) Expect(*v2.Value.DidDoc).To(Equal(msg.ToDidDoc())) Expect(v2.Value.Metadata.VersionId).To(Equal(msg.VersionId)) - Expect(v2.Value.Metadata.PreviousVersionId).To(Equal(bob.VersionId)) + Expect(v2.Value.Metadata.PreviousVersionId).To(Equal(bob.VersionID)) // query all versions versions, err := setup.QueryAllDidDocVersionsMetadata(bob.Did) @@ -112,10 +112,10 @@ var _ = Describe("DIDDoc update", func() { Controller: []string{bob.Did}, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: alice.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, }, VersionId: uuid.NewString(), @@ -170,10 +170,10 @@ var _ = Describe("DIDDoc update", func() { Controller: []string{alice.Did, bob.Did}, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: alice.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, }, VersionId: uuid.NewString(), @@ -228,14 +228,14 @@ var _ = Describe("DIDDoc update", func() { Controller: []string{bob.Did}, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: alice.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, }, - Authentication: []string{alice.KeyId}, - AssertionMethod: []string{alice.KeyId}, // Adding new verification method + Authentication: []string{alice.KeyID}, + AssertionMethod: []string{alice.KeyID}, // Adding new verification method VersionId: uuid.NewString(), } }) @@ -267,10 +267,10 @@ var _ = Describe("DIDDoc update", func() { Id: did.Did, VerificationMethod: []*types.VerificationMethod{ { - Id: did.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: did.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(newKeyPair.Public), + Id: did.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: did.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(newKeyPair.Public), }, }, VersionId: uuid.NewString(), @@ -281,7 +281,7 @@ var _ = Describe("DIDDoc update", func() { signatures := []SignInput{ did.SignInput, // Old signature { - VerificationMethodId: did.KeyId, // New signature + VerificationMethodID: did.KeyID, // New signature Key: newKeyPair.Private, }, } @@ -304,7 +304,7 @@ var _ = Describe("DIDDoc update", func() { It("Doesn't work without old signature", func() { signatures := []SignInput{{ - VerificationMethodId: did.KeyId, + VerificationMethodID: did.KeyID, Key: newKeyPair.Private, }} @@ -326,13 +326,13 @@ var _ = Describe("DIDDoc update", func() { Id: alice.Did, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: bob.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: alice.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: bob.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, }, - Authentication: []string{alice.KeyId}, + Authentication: []string{alice.KeyID}, VersionId: uuid.NewString(), } }) @@ -366,24 +366,24 @@ var _ = Describe("DIDDoc update", func() { Describe("Verification method: ID update", func() { var alice CreatedDidDocInfo - var newKeyId string + var newKeyID string var msg *types.MsgUpdateDidDocPayload BeforeEach(func() { alice = setup.CreateSimpleDid() - newKeyId = alice.Did + "#key-2" + newKeyID = alice.Did + "#key-2" msg = &types.MsgUpdateDidDocPayload{ Id: alice.Did, VerificationMethod: []*types.VerificationMethod{ { - Id: newKeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: newKeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, }, - Authentication: []string{alice.KeyId}, + Authentication: []string{alice.KeyID}, VersionId: uuid.NewString(), } }) @@ -398,7 +398,7 @@ var _ = Describe("DIDDoc update", func() { It("Doesn't work without old verification method signature", func() { signatures := []SignInput{ { - VerificationMethodId: newKeyId, + VerificationMethodID: newKeyID, Key: alice.KeyPair.Private, }, } @@ -410,7 +410,7 @@ var _ = Describe("DIDDoc update", func() { It("Works with new and old verification method signature", func() { signatures := []SignInput{ { - VerificationMethodId: newKeyId, + VerificationMethodID: newKeyID, Key: alice.KeyPair.Private, }, alice.SignInput, @@ -428,33 +428,33 @@ var _ = Describe("DIDDoc update", func() { Describe("Verification method: adding a new one", func() { var alice CreatedDidDocInfo - var newKeyId string + var newKeyID string var newKey KeyPair var msg *types.MsgUpdateDidDocPayload BeforeEach(func() { alice = setup.CreateSimpleDid() - newKeyId = alice.Did + "#key-2" + newKeyID = alice.Did + "#key-2" newKey = GenerateKeyPair() msg = &types.MsgUpdateDidDocPayload{ Id: alice.Did, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: alice.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, { - Id: newKeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(newKey.Public), + Id: newKeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(newKey.Public), }, }, - Authentication: []string{alice.KeyId}, + Authentication: []string{alice.KeyID}, VersionId: uuid.NewString(), } }) @@ -476,7 +476,7 @@ var _ = Describe("DIDDoc update", func() { It("Doesn't work with only new verification method signature", func() { signatures := []SignInput{ { - VerificationMethodId: newKeyId, + VerificationMethodID: newKeyID, Key: newKey.Private, }, } @@ -488,7 +488,7 @@ var _ = Describe("DIDDoc update", func() { Describe("Verification method: removing existing", func() { var alice CreatedDidDocInfo - var secondKeyId string + var secondKeyID string var secondKey KeyPair var secondSignInput SignInput var msg *types.MsgUpdateDidDocPayload @@ -496,10 +496,10 @@ var _ = Describe("DIDDoc update", func() { BeforeEach(func() { alice = setup.CreateSimpleDid() - secondKeyId = alice.Did + "#key-2" + secondKeyID = alice.Did + "#key-2" secondKey = GenerateKeyPair() secondSignInput = SignInput{ - VerificationMethodId: secondKeyId, + VerificationMethodID: secondKeyID, Key: secondKey.Private, } @@ -507,19 +507,19 @@ var _ = Describe("DIDDoc update", func() { Id: alice.Did, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: alice.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, { - Id: secondKeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(secondKey.Public), + Id: secondKeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(secondKey.Public), }, }, - Authentication: []string{alice.KeyId}, + Authentication: []string{alice.KeyID}, VersionId: uuid.NewString(), } @@ -530,13 +530,13 @@ var _ = Describe("DIDDoc update", func() { Id: alice.Did, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), + Id: alice.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.KeyPair.Public), }, }, - Authentication: []string{alice.KeyId}, + Authentication: []string{alice.KeyID}, VersionId: uuid.NewString(), } }) @@ -576,13 +576,13 @@ var _ = Describe("DIDDoc update", func() { Id: alice.Did, VerificationMethod: []*types.VerificationMethod{ { - Id: alice.DidDocInfo.KeyId, - Type: types.Ed25519VerificationKey2020{}.Type(), - Controller: alice.DidDocInfo.Did, - VerificationMaterial: BuildEd25519VerificationKey2020VerificationMaterial(alice.DidDocInfo.KeyPair.Public), + Id: alice.DidDocInfo.KeyID, + VerificationMethodType: types.Ed25519VerificationKey2020Type, + Controller: alice.DidDocInfo.Did, + VerificationMaterial: GenerateEd25519VerificationKey2020VerificationMaterial(alice.DidDocInfo.KeyPair.Public), }, }, - Authentication: []string{alice.KeyId}, + Authentication: []string{alice.KeyID}, VersionId: uuid.NewString(), } }) diff --git a/x/did/types/constant_test.go b/x/did/types/constant_test.go index 2c26635ae..99deb2bd4 100644 --- a/x/did/types/constant_test.go +++ b/x/did/types/constant_test.go @@ -5,11 +5,9 @@ import ( ) var ( - ValidTestDID = "did:cheqd:testnet:zABCDEFG123456789abcd" - ValidTestDID2 = "did:cheqd:testnet:zABCDEFG987654321abcd" - InvalidTestDID = "badDid" - ValidEd25519PubKey = "zF1hVGXXK9rmx5HhMTpGnGQJiab9qrFJbQXBRhSmYjQWX" - InvalidEd25519PubKey = "zF1hVGXXK9rmx5HhMTpGnGQJi" + ValidTestDID = "did:cheqd:testnet:zABCDEFG123456789abcd" + ValidTestDID2 = "did:cheqd:testnet:zABCDEFG987654321abcd" + InvalidTestDID = "badDid" ) type TestJWKKey struct { @@ -45,9 +43,21 @@ var ( ) var ( - ValidEd25519VerificationMaterial = "{\"publicKeyMultibase\":\"" + ValidEd25519PubKey + "\"}" - InvalidEd25519VerificationMaterial = "{\"publicKeyMultibase\":\"" + InvalidEd25519PubKey + "\"}" + // bytes in hex: ed01c92d1e8f9cfa03f63be3489accb0c2704bb7da3f2e4e94509d8ff9202d564c12 + ValidEd25519VerificationKey2020VerificationMaterial = "z6MkszZtxCmA2Ce4vUV132PCuLQmwnaDD5mw2L23fGNnsiX3" - ValidJWKKeyVerificationMaterial = "{\"publicKeyJwk\":" + string(ValidPublicKeyJWK) + "}" - InvalidJWKKeyVerificationMaterial = "{\"publicKeyJwk\":" + string(InvalidPublicKeyJWK) + "}" + // bytes in hex: 020076a50fe5e0c3616c1b4d85a308c104a1c99d8d3d92c18c1f4e0179202d564c12 + InvalidEd25519VerificationKey2020VerificationMaterialBadPrefix = "z3dEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf" + + // bytes in hex: ed01c92d1e8f9cfa03f63be3489accb0c2704bb7da3f2e4e94509d8ff9 + InvalidEd25519VerificationKey2020VerificationMaterialBadlength = "zBm3emgJHyjidq7HsZFTx3PCjYHayy7SxisBeVCa4" + + // bytes in hex: 0a04f18e1a12b6af626bde47be47a1800d211712af9e2c0fd43990c7073121ce + ValidEd25519VerificationKey2018VerificationMaterial = "g7T3moSG5mwFvazr5gi8AyUETXTkZ9E6PZxAZVhWN93" + + // bytes in hex: 2c392158b9b3b3935a22ba9dc371211ab58939b39461dcf66aec6d5cd04b9e + InvalidEd25519VerificationKey2018VerificationMaterialBadLength = "g7T3moSG5mwFvazr5gi8AyUETXTkZ9E6PZxAZVhWN9" + + ValidJWK2020VerificationMaterial = string(ValidPublicKeyJWK) + InvalidJWK2020VerificationMaterial = string(InvalidPublicKeyJWK) ) diff --git a/x/did/types/diddoc.pb.go b/x/did/types/diddoc.pb.go index 0ab2e67d9..727d15b64 100644 --- a/x/did/types/diddoc.pb.go +++ b/x/did/types/diddoc.pb.go @@ -5,16 +5,21 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "github.com/cosmos/gogoproto/types" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -22,18 +27,39 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// DidDoc defines a DID Document, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/ type DidDoc struct { - Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` - VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` - Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` - AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` - CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` - CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` - KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` - Service []*Service `protobuf:"bytes,10,rep,name=service,proto3" json:"service,omitempty"` - AlsoKnownAs []string `protobuf:"bytes,11,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 + Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` + // id is the DID of the DID document. + // Format: did:cheqd:: + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // controller is a list of DIDs that are allowed to control the DID document. + Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. + VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. + Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. + AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. + CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. + CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. + KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` + // service is a list of services that can be used to interact with the DID subject. + Service []*Service `protobuf:"bytes,10,rep,name=service,proto3" json:"service,omitempty"` + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. + AlsoKnownAs []string `protobuf:"bytes,11,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` } func (m *DidDoc) Reset() { *m = DidDoc{} } @@ -146,10 +172,20 @@ func (m *DidDoc) GetAlsoKnownAs() []string { return nil } +// VerificationMethod defines a verification method, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#verification-methods type VerificationMethod struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` + // id is the unique identifier of the verification method. + // Format: did:cheqd::# + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // type is the type of the verification method. + // Example: Ed25519VerificationKey2020 + VerificationMethodType string `protobuf:"bytes,2,opt,name=verification_method_type,json=verificationMethodType,proto3" json:"verification_method_type,omitempty"` + // controller is the DID of the controller of the verification method. + // Format: did:cheqd:: + Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` + // verification_material is the public key of the verification method. + // Commonly used verification material types: publicJwk, publicKeyBase58, publicKeyMultibase VerificationMaterial string `protobuf:"bytes,4,opt,name=verification_material,json=verificationMaterial,proto3" json:"verification_material,omitempty"` } @@ -193,9 +229,9 @@ func (m *VerificationMethod) GetId() string { return "" } -func (m *VerificationMethod) GetType() string { +func (m *VerificationMethod) GetVerificationMethodType() string { if m != nil { - return m.Type + return m.VerificationMethodType } return "" } @@ -214,9 +250,17 @@ func (m *VerificationMethod) GetVerificationMaterial() string { return "" } +// Service defines a service, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#services type Service struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // id is the unique identifier of the service. + // Format: did:cheqd::# + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // type is the type of the service. + // Example: LinkedResource + ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + // serviceEndpoint is the endpoint of the service. + // Example: https://example.com/endpoint ServiceEndpoint []string `protobuf:"bytes,3,rep,name=service_endpoint,json=serviceEndpoint,proto3" json:"service_endpoint,omitempty"` } @@ -260,9 +304,9 @@ func (m *Service) GetId() string { return "" } -func (m *Service) GetType() string { +func (m *Service) GetServiceType() string { if m != nil { - return m.Type + return m.ServiceType } return "" } @@ -274,9 +318,13 @@ func (m *Service) GetServiceEndpoint() []string { return nil } +// DidDocWithMetadata defines a DID Document with metadata, as defined in the DID Core specification. +// Contains the DID Document, as well as DID Document metadata. type DidDocWithMetadata struct { - DidDoc *DidDoc `protobuf:"bytes,1,opt,name=did_doc,json=didDoc,proto3" json:"did_doc,omitempty"` - Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + // didDocument is the DID Document. + DidDoc *DidDoc `protobuf:"bytes,1,opt,name=did_doc,json=didDoc,proto3" json:"didDocument"` + // didDocumentMetadata is the DID Document metadata. + Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"didDocumentMetadata"` } func (m *DidDocWithMetadata) Reset() { *m = DidDocWithMetadata{} } @@ -326,12 +374,31 @@ func (m *DidDocWithMetadata) GetMetadata() *Metadata { return nil } +// Metadata defines DID Document metadata, as defined in the DID Core specification. +// Documentation: https://www.w3.org/TR/did-core/#did-document-metadata-properties type Metadata struct { - Created string `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"` - Updated string `protobuf:"bytes,2,opt,name=updated,proto3" json:"updated,omitempty"` - Deactivated bool `protobuf:"varint,3,opt,name=deactivated,proto3" json:"deactivated,omitempty"` - VersionId string `protobuf:"bytes,4,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - NextVersionId string `protobuf:"bytes,5,opt,name=next_version_id,json=nextVersionId,proto3" json:"next_version_id,omitempty"` + // created is the timestamp of the creation of the DID Document. + // Format: RFC3339 + // Example: 2021-03-10T15:16:17Z + Created time.Time `protobuf:"bytes,1,opt,name=created,proto3,stdtime" json:"created"` + // updated is the timestamp of the last update of the DID Document. + // Format: RFC3339 + // Example: 2021-03-10T15:16:17Z + Updated *time.Time `protobuf:"bytes,2,opt,name=updated,proto3,stdtime" json:"updated,omitempty"` + // deactivated is a flag that indicates whether the DID Document is deactivated. + // Default: false + Deactivated bool `protobuf:"varint,3,opt,name=deactivated,proto3" json:"deactivated,omitempty"` + // version_id is the version identifier of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 + VersionId string `protobuf:"bytes,4,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` + // next_version_id is the version identifier of the next version of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 + NextVersionId string `protobuf:"bytes,5,opt,name=next_version_id,json=nextVersionId,proto3" json:"next_version_id,omitempty"` + // previous_version_id is the version identifier of the previous version of the DID Document. + // Format: UUID + // Example: 123e4567-e89b-12d3-a456-426655440000 PreviousVersionId string `protobuf:"bytes,6,opt,name=previous_version_id,json=previousVersionId,proto3" json:"previous_version_id,omitempty"` } @@ -368,18 +435,18 @@ func (m *Metadata) XXX_DiscardUnknown() { var xxx_messageInfo_Metadata proto.InternalMessageInfo -func (m *Metadata) GetCreated() string { +func (m *Metadata) GetCreated() time.Time { if m != nil { return m.Created } - return "" + return time.Time{} } -func (m *Metadata) GetUpdated() string { +func (m *Metadata) GetUpdated() *time.Time { if m != nil { return m.Updated } - return "" + return nil } func (m *Metadata) GetDeactivated() bool { @@ -421,45 +488,52 @@ func init() { func init() { proto.RegisterFile("cheqd/did/v2/diddoc.proto", fileDescriptor_b7b058eff1719454) } var fileDescriptor_b7b058eff1719454 = []byte{ - // 595 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xbd, 0x6e, 0xdb, 0x3c, - 0x14, 0x86, 0xa3, 0x38, 0xf1, 0xcf, 0x51, 0xfe, 0x3e, 0x26, 0xf9, 0xa0, 0x0e, 0x15, 0x0c, 0x15, - 0x68, 0x93, 0x21, 0x32, 0xa0, 0x5c, 0x41, 0x8a, 0x74, 0x08, 0x8a, 0x0c, 0x55, 0x81, 0xb4, 0xe8, - 0x22, 0xd0, 0xe2, 0xa9, 0x4d, 0x58, 0x16, 0x55, 0x89, 0x56, 0xec, 0x8b, 0x28, 0xd0, 0xcb, 0xea, - 0x98, 0xad, 0x1d, 0x3a, 0x14, 0xf6, 0x8d, 0x14, 0xa2, 0x28, 0x55, 0xb6, 0x97, 0x2e, 0xb6, 0xf8, - 0xbe, 0xcf, 0x21, 0x79, 0xce, 0x21, 0x09, 0xcf, 0xc2, 0x31, 0x7e, 0x61, 0x03, 0xc6, 0xd9, 0x20, - 0xf7, 0x8a, 0x3f, 0x26, 0x42, 0x37, 0x49, 0x85, 0x14, 0xe4, 0x40, 0x59, 0x2e, 0xe3, 0xcc, 0xcd, - 0x3d, 0xe7, 0x57, 0x0b, 0xda, 0xb7, 0x9c, 0xdd, 0x8a, 0x90, 0x58, 0xd0, 0x09, 0x45, 0x2c, 0x71, - 0x2e, 0x2d, 0xa3, 0xdf, 0xba, 0xe8, 0xf9, 0xd5, 0x90, 0x1c, 0xc1, 0x2e, 0x67, 0xd6, 0x6e, 0xdf, - 0xb8, 0xe8, 0xf9, 0xbb, 0x9c, 0x11, 0x1b, 0xa0, 0xb0, 0x52, 0x11, 0x45, 0x98, 0x5a, 0x2d, 0x05, - 0x37, 0x14, 0xf2, 0x0e, 0x4e, 0x73, 0x4c, 0xf9, 0x67, 0x1e, 0x52, 0xc9, 0x45, 0x1c, 0x4c, 0x51, - 0x8e, 0x05, 0xb3, 0xf6, 0xfa, 0xad, 0x0b, 0xd3, 0xeb, 0xbb, 0xcd, 0x0d, 0xb8, 0x0f, 0x0d, 0xf0, - 0x5e, 0x71, 0x3e, 0xc9, 0xb7, 0x34, 0xf2, 0x12, 0x8e, 0xe8, 0x4c, 0x8e, 0x31, 0x96, 0x5a, 0xb7, - 0xf6, 0xd5, 0xb2, 0x1b, 0x2a, 0xb9, 0x84, 0x13, 0x9a, 0x65, 0x98, 0x36, 0xd7, 0x6d, 0x2b, 0xf2, - 0xb8, 0xd6, 0xf5, 0x94, 0xd7, 0x70, 0x1e, 0xd2, 0x84, 0x0e, 0x79, 0xc4, 0xe5, 0x22, 0xe0, 0x71, - 0x2e, 0xf4, 0xcc, 0x1d, 0xc5, 0x9f, 0xfd, 0x35, 0xef, 0x6a, 0x6f, 0x23, 0x88, 0x61, 0x84, 0xa3, - 0x32, 0xa8, 0xbb, 0x19, 0x74, 0x5b, 0x7b, 0xe4, 0x05, 0x1c, 0x4e, 0x70, 0x11, 0xd0, 0x51, 0x8a, - 0x38, 0xc5, 0x58, 0x5a, 0x3d, 0x05, 0x1f, 0x4c, 0x70, 0x71, 0x53, 0x69, 0x64, 0x00, 0x9d, 0x0c, - 0xd3, 0x9c, 0x87, 0x68, 0x81, 0x2a, 0xd4, 0xf9, 0x7a, 0xa1, 0xde, 0x97, 0xa6, 0x5f, 0x51, 0xc4, - 0x81, 0x43, 0x1a, 0x65, 0x22, 0x98, 0xc4, 0xe2, 0x31, 0x0e, 0x68, 0x66, 0x99, 0x6a, 0x56, 0xb3, - 0x10, 0xdf, 0x16, 0xda, 0x4d, 0xe6, 0x7c, 0x35, 0x80, 0x6c, 0x57, 0x58, 0x37, 0xd4, 0xa8, 0x1b, - 0x4a, 0x60, 0x4f, 0x2e, 0x12, 0xd4, 0x2d, 0x56, 0xdf, 0x5b, 0x4d, 0x36, 0x36, 0x9a, 0x7c, 0x0d, - 0xe7, 0xeb, 0x4d, 0xa6, 0x12, 0x53, 0x4e, 0x23, 0x6b, 0x4f, 0xa1, 0x67, 0x6b, 0x4d, 0xd4, 0x9e, - 0xf3, 0x11, 0x3a, 0x3a, 0x8f, 0x7f, 0xda, 0xc3, 0x25, 0x9c, 0xe8, 0x6c, 0x03, 0x8c, 0x59, 0x22, - 0x78, 0x2c, 0xf5, 0x71, 0x3b, 0xd6, 0xfa, 0x1b, 0x2d, 0x3b, 0x8f, 0x40, 0xca, 0x73, 0xfc, 0x81, - 0xcb, 0xf1, 0x3d, 0x4a, 0xca, 0xa8, 0xa4, 0xe4, 0x0a, 0x3a, 0x8c, 0xb3, 0x80, 0x89, 0x50, 0xad, - 0x64, 0x7a, 0x67, 0xeb, 0x45, 0x2d, 0x43, 0xfc, 0x36, 0x2b, 0xaf, 0x80, 0x07, 0xdd, 0xa9, 0x0e, - 0x55, 0xfb, 0x30, 0xbd, 0xff, 0xd7, 0xf9, 0x6a, 0x62, 0xbf, 0xe6, 0x9c, 0x1f, 0x06, 0x74, 0xeb, - 0xf5, 0x8a, 0x3b, 0x94, 0x22, 0x95, 0x58, 0x65, 0x56, 0x0d, 0x0b, 0x67, 0x96, 0x30, 0xe5, 0x94, - 0x19, 0x56, 0x43, 0xd2, 0x07, 0x93, 0x21, 0x0d, 0x25, 0xcf, 0x95, 0x5b, 0x54, 0xba, 0xeb, 0x37, - 0x25, 0xf2, 0x1c, 0x20, 0xc7, 0x34, 0x2b, 0xaa, 0xcc, 0x99, 0xae, 0x6f, 0x4f, 0x2b, 0x77, 0xc5, - 0xdd, 0x38, 0x8e, 0x71, 0x2e, 0x83, 0x06, 0xb3, 0xaf, 0x98, 0xc3, 0x42, 0x7e, 0xa8, 0x39, 0x17, - 0x4e, 0x93, 0x14, 0x73, 0x2e, 0x66, 0x59, 0x93, 0x6d, 0x2b, 0xf6, 0xbf, 0xca, 0xaa, 0xf9, 0xd7, - 0x37, 0xdf, 0x97, 0xb6, 0xf1, 0xb4, 0xb4, 0x8d, 0xdf, 0x4b, 0xdb, 0xf8, 0xb6, 0xb2, 0x77, 0x9e, - 0x56, 0xf6, 0xce, 0xcf, 0x95, 0xbd, 0xf3, 0xe9, 0xd5, 0x88, 0xcb, 0xf1, 0x6c, 0xe8, 0x86, 0x62, - 0x3a, 0x28, 0x5f, 0x1a, 0xf5, 0x7b, 0x15, 0x0b, 0x86, 0x83, 0xb9, 0x7a, 0x76, 0x8a, 0xfe, 0x65, - 0xc3, 0xb6, 0x7a, 0x73, 0xae, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x0f, 0xd7, 0x5c, 0x1b, 0x90, - 0x04, 0x00, 0x00, + // 707 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x4e, 0xdb, 0x4a, + 0x18, 0x8d, 0x13, 0xc8, 0xcf, 0x18, 0x08, 0x77, 0x08, 0x5c, 0x5f, 0xa4, 0x9b, 0xe4, 0xe6, 0x4a, + 0x2d, 0x48, 0xad, 0x2d, 0x85, 0x2e, 0xba, 0xaa, 0x44, 0x44, 0x17, 0x08, 0xb1, 0xa8, 0x8b, 0xa8, + 0xd4, 0x8d, 0x35, 0xf1, 0x7c, 0x38, 0x23, 0x12, 0x8f, 0x6b, 0x4f, 0x5c, 0xf2, 0x16, 0xbc, 0x42, + 0x9f, 0xa0, 0x8b, 0xbe, 0x04, 0x4b, 0x96, 0x5d, 0x54, 0xb4, 0x82, 0x1d, 0x4f, 0x51, 0x79, 0x3c, + 0x76, 0x9d, 0xa4, 0x8b, 0x6e, 0x12, 0xcf, 0xf9, 0xce, 0x39, 0xf3, 0x79, 0xce, 0x37, 0x46, 0xff, + 0xb8, 0x23, 0xf8, 0x40, 0x2d, 0xca, 0xa8, 0x15, 0xf7, 0x93, 0x3f, 0xca, 0x5d, 0x33, 0x08, 0xb9, + 0xe0, 0x78, 0x4d, 0x96, 0x4c, 0xca, 0xa8, 0x19, 0xf7, 0x77, 0x5b, 0x1e, 0xf7, 0xb8, 0x2c, 0x58, + 0xc9, 0x53, 0xca, 0xd9, 0xed, 0x78, 0x9c, 0x7b, 0x63, 0xb0, 0xe4, 0x6a, 0x38, 0xbd, 0xb0, 0x04, + 0x9b, 0x40, 0x24, 0xc8, 0x24, 0x48, 0x09, 0xbd, 0x6f, 0x15, 0x54, 0x3d, 0x62, 0xf4, 0x88, 0xbb, + 0xd8, 0x40, 0x35, 0x97, 0xfb, 0x02, 0xae, 0x84, 0xa1, 0x75, 0x2b, 0x7b, 0x0d, 0x3b, 0x5b, 0xe2, + 0x0d, 0x54, 0x66, 0xd4, 0x28, 0x77, 0xb5, 0xbd, 0x86, 0x5d, 0x66, 0x14, 0xb7, 0x11, 0x4a, 0x4a, + 0x21, 0x1f, 0x8f, 0x21, 0x34, 0x2a, 0x92, 0x5c, 0x40, 0xf0, 0x1b, 0xb4, 0x15, 0x43, 0xc8, 0x2e, + 0x98, 0x4b, 0x04, 0xe3, 0xbe, 0x33, 0x01, 0x31, 0xe2, 0xd4, 0x58, 0xe9, 0x56, 0xf6, 0xf4, 0x7e, + 0xd7, 0x2c, 0xf6, 0x6d, 0x9e, 0x17, 0x88, 0xa7, 0x92, 0x67, 0xe3, 0x78, 0x09, 0xc3, 0x4f, 0xd0, + 0x06, 0x99, 0x8a, 0x11, 0xf8, 0x42, 0xe1, 0xc6, 0xaa, 0xdc, 0x76, 0x01, 0xc5, 0xfb, 0x68, 0x93, + 0x44, 0x11, 0x84, 0xc5, 0x7d, 0xab, 0x92, 0xd9, 0xcc, 0x71, 0x65, 0x79, 0x80, 0xb6, 0x5d, 0x12, + 0x90, 0x21, 0x1b, 0x33, 0x31, 0x73, 0x98, 0x1f, 0x73, 0xe5, 0x5c, 0x93, 0xfc, 0xd6, 0xaf, 0xe2, + 0x71, 0x5e, 0x5b, 0x10, 0x51, 0x18, 0x83, 0x97, 0x8a, 0xea, 0x8b, 0xa2, 0xa3, 0xbc, 0x86, 0xff, + 0x47, 0xeb, 0x97, 0x30, 0x73, 0x88, 0x17, 0x02, 0x4c, 0xc0, 0x17, 0x46, 0x43, 0x92, 0xd7, 0x2e, + 0x61, 0x76, 0x98, 0x61, 0xd8, 0x42, 0xb5, 0x08, 0xc2, 0x98, 0xb9, 0x60, 0x20, 0x79, 0x50, 0xdb, + 0xf3, 0x07, 0xf5, 0x36, 0x2d, 0xda, 0x19, 0x0b, 0xf7, 0xd0, 0x3a, 0x19, 0x47, 0xdc, 0xb9, 0xf4, + 0xf9, 0x47, 0xdf, 0x21, 0x91, 0xa1, 0x4b, 0x57, 0x3d, 0x01, 0x4f, 0x12, 0xec, 0x30, 0xea, 0x7d, + 0xd1, 0x10, 0x5e, 0x3e, 0x61, 0x15, 0xa8, 0x96, 0x07, 0xfa, 0x12, 0x19, 0xbf, 0x09, 0xcc, 0x11, + 0xb3, 0x00, 0x54, 0xec, 0x3b, 0xcb, 0x99, 0x9c, 0xcd, 0x02, 0x58, 0x1a, 0x05, 0x6d, 0x61, 0x14, + 0x0e, 0xd0, 0xf6, 0xbc, 0x33, 0x11, 0x10, 0x32, 0x32, 0x36, 0x56, 0x24, 0xb5, 0x35, 0x67, 0xab, + 0x6a, 0x3d, 0x0f, 0xd5, 0xd4, 0xdb, 0x2e, 0x75, 0xfa, 0x1f, 0x5a, 0x53, 0xef, 0x5f, 0xec, 0x4e, + 0x57, 0x98, 0x6c, 0x69, 0x1f, 0x6d, 0x66, 0x14, 0xf0, 0x69, 0xc0, 0x99, 0x2f, 0xd4, 0x8c, 0x36, + 0x15, 0xfe, 0x5a, 0xc1, 0xbd, 0x4f, 0x1a, 0xc2, 0xe9, 0xf4, 0xbf, 0x63, 0x62, 0x74, 0x0a, 0x82, + 0x50, 0x22, 0x08, 0x7e, 0x85, 0x6a, 0x94, 0x51, 0x87, 0x72, 0x57, 0xee, 0xac, 0xf7, 0x5b, 0xf3, + 0x51, 0xa4, 0x92, 0x41, 0xf3, 0xf1, 0xae, 0xa3, 0x53, 0xf9, 0x3c, 0x4d, 0x22, 0xb4, 0xab, 0xe9, + 0x02, 0x9f, 0xa0, 0xfa, 0x44, 0x79, 0xc9, 0x06, 0xf5, 0xfe, 0xce, 0xbc, 0x41, 0xb6, 0xd3, 0xe0, + 0xef, 0xc7, 0xbb, 0xce, 0x56, 0xc1, 0x22, 0x2b, 0xd8, 0xb9, 0x41, 0xef, 0x73, 0x19, 0xd5, 0x8b, + 0x9d, 0xb9, 0x21, 0x10, 0x01, 0x54, 0x75, 0xb6, 0x6b, 0xa6, 0x37, 0xdc, 0xcc, 0x6e, 0xb8, 0x79, + 0x96, 0xdd, 0xf0, 0x41, 0xfd, 0xe6, 0xae, 0x53, 0xba, 0xfe, 0xde, 0xd1, 0xec, 0x4c, 0x94, 0xe8, + 0xa7, 0x01, 0x95, 0xfa, 0xf2, 0x1f, 0xe9, 0xb5, 0x54, 0xaf, 0x44, 0xb8, 0x8b, 0x74, 0x0a, 0xc4, + 0x15, 0x2c, 0x96, 0x1e, 0x49, 0xde, 0x75, 0xbb, 0x08, 0xe1, 0x7f, 0x11, 0x8a, 0x21, 0x8c, 0x92, + 0xac, 0x19, 0x55, 0x29, 0x37, 0x14, 0x72, 0x4c, 0xf1, 0x33, 0xd4, 0xf4, 0xe1, 0x4a, 0x38, 0x05, + 0xce, 0x6a, 0xc2, 0x19, 0xac, 0x24, 0x9b, 0xd9, 0xeb, 0x49, 0xf1, 0x3c, 0x67, 0xbf, 0x40, 0x5b, + 0x41, 0x08, 0x31, 0xe3, 0xd3, 0xa8, 0xa8, 0xa8, 0x16, 0x14, 0x7f, 0x65, 0x84, 0x5c, 0x35, 0x38, + 0xbc, 0xb9, 0x6f, 0x6b, 0xb7, 0xf7, 0x6d, 0xed, 0xc7, 0x7d, 0x5b, 0xbb, 0x7e, 0x68, 0x97, 0x6e, + 0x1f, 0xda, 0xa5, 0xaf, 0x0f, 0xed, 0xd2, 0xfb, 0xa7, 0x1e, 0x13, 0xa3, 0xe9, 0xd0, 0x74, 0xf9, + 0xc4, 0x4a, 0x3f, 0xac, 0xf2, 0xf7, 0xb9, 0xcf, 0x29, 0x58, 0x57, 0xf2, 0x2b, 0x9b, 0x4c, 0x55, + 0x34, 0xac, 0xca, 0xe3, 0x38, 0xf8, 0x19, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xa3, 0x36, 0x8d, 0x7f, + 0x05, 0x00, 0x00, } func (m *DidDoc) Marshal() (dAtA []byte, err error) { @@ -626,10 +700,10 @@ func (m *VerificationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintDiddoc(dAtA, i, uint64(len(m.Type))) + if len(m.VerificationMethodType) > 0 { + i -= len(m.VerificationMethodType) + copy(dAtA[i:], m.VerificationMethodType) + i = encodeVarintDiddoc(dAtA, i, uint64(len(m.VerificationMethodType))) i-- dAtA[i] = 0x12 } @@ -672,10 +746,10 @@ func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x1a } } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintDiddoc(dAtA, i, uint64(len(m.Type))) + if len(m.ServiceType) > 0 { + i -= len(m.ServiceType) + copy(dAtA[i:], m.ServiceType) + i = encodeVarintDiddoc(dAtA, i, uint64(len(m.ServiceType))) i-- dAtA[i] = 0x12 } @@ -787,20 +861,24 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } - if len(m.Updated) > 0 { - i -= len(m.Updated) - copy(dAtA[i:], m.Updated) - i = encodeVarintDiddoc(dAtA, i, uint64(len(m.Updated))) + if m.Updated != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Updated, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Updated):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintDiddoc(dAtA, i, uint64(n3)) i-- dAtA[i] = 0x12 } - if len(m.Created) > 0 { - i -= len(m.Created) - copy(dAtA[i:], m.Created) - i = encodeVarintDiddoc(dAtA, i, uint64(len(m.Created))) - i-- - dAtA[i] = 0xa + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Created, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Created):]) + if err4 != nil { + return 0, err4 } + i -= n4 + i = encodeVarintDiddoc(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -898,7 +976,7 @@ func (m *VerificationMethod) Size() (n int) { if l > 0 { n += 1 + l + sovDiddoc(uint64(l)) } - l = len(m.Type) + l = len(m.VerificationMethodType) if l > 0 { n += 1 + l + sovDiddoc(uint64(l)) } @@ -923,7 +1001,7 @@ func (m *Service) Size() (n int) { if l > 0 { n += 1 + l + sovDiddoc(uint64(l)) } - l = len(m.Type) + l = len(m.ServiceType) if l > 0 { n += 1 + l + sovDiddoc(uint64(l)) } @@ -959,12 +1037,10 @@ func (m *Metadata) Size() (n int) { } var l int _ = l - l = len(m.Created) - if l > 0 { - n += 1 + l + sovDiddoc(uint64(l)) - } - l = len(m.Updated) - if l > 0 { + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Created) + n += 1 + l + sovDiddoc(uint64(l)) + if m.Updated != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Updated) n += 1 + l + sovDiddoc(uint64(l)) } if m.Deactivated { @@ -1460,7 +1536,7 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VerificationMethodType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1488,7 +1564,7 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.VerificationMethodType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -1638,7 +1714,7 @@ func (m *Service) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ServiceType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1666,7 +1742,7 @@ func (m *Service) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.ServiceType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -1876,7 +1952,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDiddoc @@ -1886,29 +1962,30 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthDiddoc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthDiddoc } if postIndex > l { return io.ErrUnexpectedEOF } - m.Created = string(dAtA[iNdEx:postIndex]) + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Created, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Updated", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDiddoc @@ -1918,23 +1995,27 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthDiddoc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthDiddoc } if postIndex > l { return io.ErrUnexpectedEOF } - m.Updated = string(dAtA[iNdEx:postIndex]) + if m.Updated == nil { + m.Updated = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Updated, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 0 { diff --git a/x/did/types/diddoc_diddoc.go b/x/did/types/diddoc_diddoc.go index 9e82449fc..83df2fb88 100644 --- a/x/did/types/diddoc_diddoc.go +++ b/x/did/types/diddoc_diddoc.go @@ -55,11 +55,11 @@ func (didDoc *DidDoc) ReplaceDids(old, new string) { } // Verification relationships - didDoc.Authentication = utils.ReplaceDidInDidUrlList(didDoc.Authentication, old, new) - didDoc.AssertionMethod = utils.ReplaceDidInDidUrlList(didDoc.AssertionMethod, old, new) - didDoc.CapabilityInvocation = utils.ReplaceDidInDidUrlList(didDoc.CapabilityInvocation, old, new) - didDoc.CapabilityDelegation = utils.ReplaceDidInDidUrlList(didDoc.CapabilityDelegation, old, new) - didDoc.KeyAgreement = utils.ReplaceDidInDidUrlList(didDoc.KeyAgreement, old, new) + didDoc.Authentication = utils.ReplaceDidInDidURLList(didDoc.Authentication, old, new) + didDoc.AssertionMethod = utils.ReplaceDidInDidURLList(didDoc.AssertionMethod, old, new) + didDoc.CapabilityInvocation = utils.ReplaceDidInDidURLList(didDoc.CapabilityInvocation, old, new) + didDoc.CapabilityDelegation = utils.ReplaceDidInDidURLList(didDoc.CapabilityDelegation, old, new) + didDoc.KeyAgreement = utils.ReplaceDidInDidURLList(didDoc.KeyAgreement, old, new) } func (didDoc *DidDoc) GetControllersOrSubject() []string { @@ -73,7 +73,7 @@ func (didDoc *DidDoc) GetControllersOrSubject() []string { } func (didDoc *DidDoc) GetVerificationMethodControllers() []string { - var result []string + result := make([]string, 0, len(didDoc.VerificationMethod)) for _, vm := range didDoc.VerificationMethod { result = append(result, vm.Controller) @@ -89,7 +89,7 @@ func (didDoc DidDoc) Validate(allowedNamespaces []string) error { validation.Field(&didDoc.Id, validation.Required, IsDID(allowedNamespaces)), validation.Field(&didDoc.Controller, IsUniqueStrList(), validation.Each(IsDID(allowedNamespaces))), validation.Field(&didDoc.VerificationMethod, - IsUniqueVerificationMethodListByIdRule(), validation.Each(ValidVerificationMethodRule(didDoc.Id, allowedNamespaces)), + IsUniqueVerificationMethodListByIDRule(), validation.Each(ValidVerificationMethodRule(didDoc.Id, allowedNamespaces)), ), validation.Field(&didDoc.Authentication, @@ -108,7 +108,7 @@ func (didDoc DidDoc) Validate(allowedNamespaces []string) error { IsUniqueStrList(), validation.Each(IsDIDUrl(allowedNamespaces, Empty, Empty, Required), HasPrefix(didDoc.Id)), ), - validation.Field(&didDoc.Service, IsUniqueServiceListByIdRule(), validation.Each(ValidServiceRule(didDoc.Id, allowedNamespaces))), + validation.Field(&didDoc.Service, IsUniqueServiceListByIDRule(), validation.Each(ValidServiceRule(didDoc.Id, allowedNamespaces))), validation.Field(&didDoc.AlsoKnownAs, IsUniqueStrList(), validation.Each(IsURI())), ) } diff --git a/x/did/types/diddoc_diddoc_test.go b/x/did/types/diddoc_diddoc_test.go index a29405253..e8f9ac777 100644 --- a/x/did/types/diddoc_diddoc_test.go +++ b/x/did/types/diddoc_diddoc_test.go @@ -34,10 +34,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Id: ValidTestDID, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, }, @@ -52,10 +52,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Id: InvalidTestDID, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, }, @@ -70,10 +70,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Id: ValidTestDID, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, }, @@ -88,10 +88,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Id: ValidTestDID, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "JsonWebKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidJWKKeyVerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "JsonWebKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidJWK2020VerificationMaterial, }, }, }, @@ -105,10 +105,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Id: ValidTestDID, VerificationMethod: []*VerificationMethod{ { - Id: InvalidTestDID, - Type: "JsonWebKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidJWKKeyVerificationMaterial, + Id: InvalidTestDID, + VerificationMethodType: "JsonWebKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidJWK2020VerificationMaterial, }, }, }, @@ -122,10 +122,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Id: ValidTestDID, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "JsonWebKey2020", - Controller: InvalidTestDID, - VerificationMaterial: ValidJWKKeyVerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "JsonWebKey2020", + Controller: InvalidTestDID, + VerificationMaterial: ValidJWK2020VerificationMaterial, }, }, }, @@ -140,10 +140,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Controller: []string{ValidTestDID, ValidTestDID2}, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, }, @@ -159,10 +159,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Controller: []string{ValidTestDID, InvalidTestDID}, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, }, @@ -177,10 +177,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Controller: []string{ValidTestDID}, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, }, @@ -196,10 +196,10 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Controller: []string{ValidTestDID, ValidTestDID}, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, }, @@ -213,16 +213,16 @@ var _ = DescribeTable("DIDDoc Validation tests", func(testCase DIDDocTestCase) { Id: ValidTestDID, VerificationMethod: []*VerificationMethod{ { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, { - Id: fmt.Sprintf("%s#fragment", ValidTestDID), - Type: "Ed25519VerificationKey2020", - Controller: ValidTestDID, - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: fmt.Sprintf("%s#fragment", ValidTestDID), + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: ValidTestDID, + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, }, diff --git a/x/did/types/diddoc_metadata.go b/x/did/types/diddoc_metadata.go index 2ccbae22c..7fe8ccb43 100644 --- a/x/did/types/diddoc_metadata.go +++ b/x/did/types/diddoc_metadata.go @@ -1,18 +1,17 @@ package types import ( - "time" - sdk "github.com/cosmos/cosmos-sdk/types" ) func NewMetadataFromContext(ctx sdk.Context, version string) Metadata { - created := ctx.BlockTime().Format(time.RFC3339) + created := ctx.BlockTime() - return Metadata{Created: created, Updated: created, Deactivated: false, VersionId: version} + return Metadata{Created: created, Deactivated: false, VersionId: version} } func (m *Metadata) Update(ctx sdk.Context, version string) { - m.Updated = ctx.BlockTime().Format(time.RFC3339) + updated := ctx.BlockTime() + m.Updated = &updated m.VersionId = version } diff --git a/x/did/types/diddoc_service.go b/x/did/types/diddoc_service.go index 1d60c0806..950671e52 100644 --- a/x/did/types/diddoc_service.go +++ b/x/did/types/diddoc_service.go @@ -7,10 +7,10 @@ import ( validation "github.com/go-ozzo/ozzo-validation/v4" ) -func NewService(id string, type_ string, serviceEndpoint []string) *Service { +func NewService(id string, serviceType string, serviceEndpoint []string) *Service { return &Service{ Id: id, - Type: type_, + ServiceType: serviceType, ServiceEndpoint: serviceEndpoint, } } @@ -18,7 +18,7 @@ func NewService(id string, type_ string, serviceEndpoint []string) *Service { // ReplaceDids replaces ids in all fields func (s *Service) ReplaceDids(old, new string) { // Id - s.Id = utils.ReplaceDidInDidUrl(s.Id, old, new) + s.Id = utils.ReplaceDidInDidURL(s.Id, old, new) } // Helpers @@ -38,7 +38,7 @@ func GetServiceIds(vms []*Service) []string { func (s Service) Validate(baseDid string, allowedNamespaces []string) error { return validation.ValidateStruct(&s, validation.Field(&s.Id, validation.Required, IsDIDUrl(allowedNamespaces, Empty, Empty, Required), HasPrefix(baseDid)), - validation.Field(&s.Type, validation.Required, validation.Length(1, 255)), + validation.Field(&s.ServiceType, validation.Required, validation.Length(1, 255)), validation.Field(&s.ServiceEndpoint, validation.Each(validation.Required)), ) } @@ -54,7 +54,7 @@ func ValidServiceRule(baseDid string, allowedNamespaces []string) *CustomErrorRu }) } -func IsUniqueServiceListByIdRule() *CustomErrorRule { +func IsUniqueServiceListByIDRule() *CustomErrorRule { return NewCustomErrorRule(func(value interface{}) error { casted, ok := value.([]*Service) if !ok { diff --git a/x/did/types/diddoc_service_test.go b/x/did/types/diddoc_service_test.go index bbbf21358..b851a1548 100644 --- a/x/did/types/diddoc_service_test.go +++ b/x/did/types/diddoc_service_test.go @@ -32,7 +32,7 @@ var _ = Describe("Service tests", func() { TestCaseServiceStruct{ service: &Service{ Id: "did:cheqd:aABCDEFG123456789abcd#service1", - Type: "DIDCommMessaging", + ServiceType: "DIDCommMessaging", ServiceEndpoint: []string{"endpoint1", "endpoint2"}, }, baseDid: "did:cheqd:aABCDEFG123456789abcd", @@ -46,7 +46,7 @@ var _ = Describe("Service tests", func() { TestCaseServiceStruct{ service: &Service{ Id: "did:cheqd:zABCDEFG123456789abcd#service1", - Type: "DIDCommMessaging", + ServiceType: "DIDCommMessaging", ServiceEndpoint: []string{"endpoint"}, }, allowedNamespaces: []string{"mainnet"}, @@ -59,7 +59,7 @@ var _ = Describe("Service tests", func() { TestCaseServiceStruct{ service: &Service{ Id: "did:cheqd:zABCDEFG123456789abcd#service1", - Type: "DIDCommMessaging", + ServiceType: "DIDCommMessaging", ServiceEndpoint: []string{"endpoint"}, }, baseDid: "did:cheqd:zABCDEFG987654321abcd", diff --git a/x/did/types/diddoc_verification_material.go b/x/did/types/diddoc_verification_material.go deleted file mode 100644 index 0b20be8b8..000000000 --- a/x/did/types/diddoc_verification_material.go +++ /dev/null @@ -1,82 +0,0 @@ -package types - -import ( - "encoding/json" - - validation "github.com/go-ozzo/ozzo-validation/v4" -) - -type VerificationMaterial interface { - Type() string - Validate() error -} - -// Ed25519VerificationKey2020 - -type Ed25519VerificationKey2020 struct { - PublicKeyMultibase string `json:"publicKeyMultibase"` -} - -var _ VerificationMaterial = (*Ed25519VerificationKey2020)(nil) - -func (vm Ed25519VerificationKey2020) Type() string { - return "Ed25519VerificationKey2020" -} - -func (vm Ed25519VerificationKey2020) Validate() error { - return validation.ValidateStruct(&vm, - validation.Field(&vm.PublicKeyMultibase, validation.Required, IsMultibase(), IsMultibaseEncodedEd25519PubKey()), - ) -} - -// JsonWebKey2020 - -type JsonWebKey2020 struct { - PublicKeyJwk json.RawMessage `json:"publicKeyJwk"` -} - -var _ VerificationMaterial = (*JsonWebKey2020)(nil) - -func (vm JsonWebKey2020) Type() string { - return "JsonWebKey2020" -} - -func (vm JsonWebKey2020) Validate() error { - return validation.Validate(string(vm.PublicKeyJwk), validation.Required, IsJWK()) -} - -// Validation - -func ValidEd25519VerificationKey2020Rule() *CustomErrorRule { - return NewCustomErrorRule(func(value interface{}) error { - casted, ok := value.(string) - if !ok { - panic("ValidVerificationMethodRule must be only applied on verification methods") - } - - var vm Ed25519VerificationKey2020 - err := json.Unmarshal([]byte(casted), &vm) - if err != nil { - return err - } - - return vm.Validate() - }) -} - -func ValidJsonWebKey2020Rule() *CustomErrorRule { - return NewCustomErrorRule(func(value interface{}) error { - casted, ok := value.(string) - if !ok { - panic("ValidVerificationMethodRule must be only applied on verification methods") - } - - var vm JsonWebKey2020 - err := json.Unmarshal([]byte(casted), &vm) - if err != nil { - return err - } - - return vm.Validate() - }) -} diff --git a/x/did/types/diddoc_verification_material_test.go b/x/did/types/diddoc_verification_material_test.go deleted file mode 100644 index 1168d1bb6..000000000 --- a/x/did/types/diddoc_verification_material_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package types_test - -import ( - . "github.com/cheqd/cheqd-node/x/did/types" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" -) - -type VerificationMaterialTestCase struct { - vm VerificationMaterial - isValid bool - errorMsg string -} - -var _ = DescribeTable("Verification Method material validation tests", func(testCase VerificationMaterialTestCase) { - err := testCase.vm.Validate() - - if testCase.isValid { - Expect(err).To(BeNil()) - } else { - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring(testCase.errorMsg)) - } -}, - - Entry( - "Valid Ed25519VerificationKey2020 verification material", - VerificationMaterialTestCase{ - vm: Ed25519VerificationKey2020{ - PublicKeyMultibase: ValidEd25519PubKey, - }, - isValid: true, - errorMsg: "", - }), - - Entry( - "Valid JsonWebKey2020 verification material", - VerificationMaterialTestCase{ - vm: JsonWebKey2020{ - PublicKeyJwk: ValidPublicKeyJWK, - }, - isValid: true, - errorMsg: "", - }), - - Entry( - "Invalid Ed25519VerificationKey2020 verification material", - VerificationMaterialTestCase{ - vm: Ed25519VerificationKey2020{ - PublicKeyMultibase: InvalidEd25519PubKey, - }, - isValid: false, - errorMsg: "publicKeyMultibase: ed25519: bad public key length: 18", - }), - - Entry( - "Invalid JsonWebKey2020 verification material", - VerificationMaterialTestCase{ - vm: JsonWebKey2020{ - PublicKeyJwk: InvalidPublicKeyJWK, - }, - isValid: false, - errorMsg: "can't parse jwk: failed to parse key", - }), -) diff --git a/x/did/types/diddoc_verification_method.go b/x/did/types/diddoc_verification_method.go index a50eeb510..f6100d771 100644 --- a/x/did/types/diddoc_verification_method.go +++ b/x/did/types/diddoc_verification_method.go @@ -4,28 +4,34 @@ import ( "crypto/ecdsa" "crypto/ed25519" "crypto/rsa" - "encoding/json" "errors" "fmt" "github.com/cheqd/cheqd-node/x/did/utils" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" validation "github.com/go-ozzo/ozzo-validation/v4" "github.com/lestrrat-go/jwx/jwk" + "github.com/mr-tron/base58" "github.com/multiformats/go-multibase" ) +const ( + JSONWebKey2020Type = "JsonWebKey2020" + Ed25519VerificationKey2020Type = "Ed25519VerificationKey2020" + Ed25519VerificationKey2018Type = "Ed25519VerificationKey2018" +) + var SupportedMethodTypes = []string{ - JsonWebKey2020{}.Type(), - Ed25519VerificationKey2020{}.Type(), + JSONWebKey2020Type, + Ed25519VerificationKey2020Type, + Ed25519VerificationKey2018Type, } -func NewVerificationMethod(id string, type_ string, controller string, verificationMaterial string) *VerificationMethod { +func NewVerificationMethod(id string, vmType string, controller string, verificationMaterial string) *VerificationMethod { return &VerificationMethod{ - Id: id, - Type: type_, - Controller: controller, - VerificationMaterial: verificationMaterial, + Id: id, + VerificationMethodType: vmType, + Controller: controller, + VerificationMaterial: verificationMaterial, } } @@ -54,30 +60,20 @@ func GetVerificationMethodIds(vms []*VerificationMethod) []string { func VerifySignature(vm VerificationMethod, message []byte, signature []byte) error { var verificationError error - switch vm.Type { - case Ed25519VerificationKey2020{}.Type(): - var ed25519VerificationKey2020 Ed25519VerificationKey2020 - err := json.Unmarshal([]byte(vm.VerificationMaterial), &ed25519VerificationKey2020) - if err != nil { - return sdkerrors.Wrapf(err, "failed to unmarshal verification material for %s", vm.Id) - } + switch vm.VerificationMethodType { + case Ed25519VerificationKey2020Type: - _, keyBytes, err := multibase.Decode(ed25519VerificationKey2020.PublicKeyMultibase) + _, multibaseBytes, err := multibase.Decode(vm.VerificationMaterial) if err != nil { return err } + keyBytes := utils.GetEd25519VerificationKey2020(multibaseBytes) verificationError = utils.VerifyED25519Signature(keyBytes, message, signature) - case JsonWebKey2020{}.Type(): - var jsonWebKey2020 JsonWebKey2020 - err := json.Unmarshal([]byte(vm.VerificationMaterial), &jsonWebKey2020) - if err != nil { - return sdkerrors.Wrapf(err, "failed to unmarshal verification material for %s", vm.Id) - } - + case JSONWebKey2020Type: var raw interface{} - err = jwk.ParseRawKey([]byte(jsonWebKey2020.PublicKeyJwk), &raw) + err := jwk.ParseRawKey([]byte(vm.VerificationMaterial), &raw) if err != nil { return fmt.Errorf("can't parse jwk: %s", err.Error()) } @@ -93,6 +89,14 @@ func VerifySignature(vm VerificationMethod, message []byte, signature []byte) er panic("unsupported jwk key") // This should have been checked during basic validation } + case Ed25519VerificationKey2018Type: + publicKeyBytes, err := base58.Decode(vm.VerificationMaterial) + if err != nil { + return err + } + + verificationError = utils.VerifyED25519Signature(publicKeyBytes, message, signature) + default: panic("unsupported verification method type") // This should have also been checked during basic validation } @@ -123,21 +127,23 @@ func (vm *VerificationMethod) ReplaceDids(old, new string) { } // Id - vm.Id = utils.ReplaceDidInDidUrl(vm.Id, old, new) + vm.Id = utils.ReplaceDidInDidURL(vm.Id, old, new) } // Validation - func (vm VerificationMethod) Validate(baseDid string, allowedNamespaces []string) error { return validation.ValidateStruct(&vm, validation.Field(&vm.Id, validation.Required, IsDIDUrl(allowedNamespaces, Empty, Empty, Required), HasPrefix(baseDid)), validation.Field(&vm.Controller, validation.Required, IsDID(allowedNamespaces)), - validation.Field(&vm.Type, validation.Required, validation.In(utils.ToInterfaces(SupportedMethodTypes)...)), + validation.Field(&vm.VerificationMethodType, validation.Required, validation.In(utils.ToInterfaces(SupportedMethodTypes)...)), + validation.Field(&vm.VerificationMaterial, + validation.When(vm.VerificationMethodType == Ed25519VerificationKey2020Type, validation.Required, IsMultibaseEd25519VerificationKey2020()), + ), validation.Field(&vm.VerificationMaterial, - validation.When(vm.Type == Ed25519VerificationKey2020{}.Type(), validation.Required, ValidEd25519VerificationKey2020Rule()), + validation.When(vm.VerificationMethodType == Ed25519VerificationKey2018Type, validation.Required, IsBase58Ed25519VerificationKey2018()), ), validation.Field(&vm.VerificationMaterial, - validation.When(vm.Type == JsonWebKey2020{}.Type(), validation.Required, ValidJsonWebKey2020Rule()), + validation.When(vm.VerificationMethodType == JSONWebKey2020Type, validation.Required, IsJWK()), ), ) } @@ -153,7 +159,7 @@ func ValidVerificationMethodRule(baseDid string, allowedNamespaces []string) *Cu }) } -func IsUniqueVerificationMethodListByIdRule() *CustomErrorRule { +func IsUniqueVerificationMethodListByIDRule() *CustomErrorRule { return NewCustomErrorRule(func(value interface{}) error { casted, ok := value.([]*VerificationMethod) if !ok { diff --git a/x/did/types/diddoc_verification_method_test.go b/x/did/types/diddoc_verification_method_test.go index b24c7af13..f142123f5 100644 --- a/x/did/types/diddoc_verification_method_test.go +++ b/x/did/types/diddoc_verification_method_test.go @@ -9,15 +9,15 @@ import ( "crypto/rsa" "encoding/json" - . "github.com/cheqd/cheqd-node/x/did/types" + testsetup "github.com/cheqd/cheqd-node/x/did/tests/setup" + didtypes "github.com/cheqd/cheqd-node/x/did/types" "github.com/lestrrat-go/jwx/jwk" - "github.com/multiformats/go-multibase" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) type VerificationMethodTestCase struct { - vm VerificationMethod + vm didtypes.VerificationMethod baseDid string allowedNamespaces []string isValid bool @@ -34,171 +34,216 @@ var _ = DescribeTable("Verification Method validation tests", func(testCase Veri Expect(err.Error()).To(ContainSubstring(testCase.errorMsg)) } }, - Entry( "Verification method with expected multibase key", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:zABCDEFG123456789abcd#qwe", - Type: "Ed25519VerificationKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: ValidEd25519VerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, isValid: true, errorMsg: "", - }), - + }, + ), Entry( "Verification method with expected jwk key", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:zABCDEFG123456789abcd#rty", - Type: "JsonWebKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: ValidJWKKeyVerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#rty", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidJWK2020VerificationMaterial, }, isValid: true, errorMsg: "", - }), - + }, + ), + Entry( + "Verification method with expected base58 key", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#uio", + VerificationMethodType: "Ed25519VerificationKey2018", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidEd25519VerificationKey2018VerificationMaterial, + }, + isValid: true, + errorMsg: "", + }, + ), Entry( "Id has expected DID as a base", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:zABCDEFG123456789abcd#rty", - Type: "JsonWebKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: ValidJWKKeyVerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#rty", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidJWK2020VerificationMaterial, }, baseDid: "did:cheqd:zABCDEFG123456789abcd", isValid: true, errorMsg: "", - }), - + }, + ), Entry( "Id does not have expected DID as a base", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:zABCDEFG123456789abcd#rty", - Type: "JsonWebKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: ValidJWKKeyVerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#rty", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidJWK2020VerificationMaterial, }, baseDid: "did:cheqd:zABCDEFG987654321abcd", isValid: false, errorMsg: "id: must have prefix: did:cheqd:zABCDEFG987654321abcd.", - }), - + }, + ), Entry( "Namespace is allowed", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:mainnet:zABCDEFG123456789abcd#rty", - Type: "JsonWebKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: ValidJWKKeyVerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:mainnet:zABCDEFG123456789abcd#rty", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidJWK2020VerificationMaterial, }, allowedNamespaces: []string{"mainnet", ""}, isValid: true, - }), + }, + ), Entry( "Namespace is not allowed", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:mainnet:zABCDEFG123456789abcd#rty", - Type: "JsonWebKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: ValidJWKKeyVerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:mainnet:zABCDEFG123456789abcd#rty", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidJWK2020VerificationMaterial, }, allowedNamespaces: []string{"testnet"}, isValid: false, errorMsg: "controller: did namespace must be one of: testnet; id: did namespace must be one of: testnet.", - }), + }, + ), Entry( "JWK key has expected format", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:zABCDEFG123456789abcd#qwe", - Type: "JsonWebKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: ValidJWKKeyVerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidJWK2020VerificationMaterial, }, isValid: true, - }), + }, + ), Entry( "JWK key has unexpected format", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:zABCDEFG123456789abcd#qwe", - Type: "JsonWebKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: InvalidJWKKeyVerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: InvalidJWK2020VerificationMaterial, }, isValid: false, errorMsg: "verification_material: can't parse jwk: failed to parse key", - }), + }, + ), + Entry( + "Ed25519 key 2020 has unexpected format", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: InvalidEd25519VerificationKey2020VerificationMaterialBadlength, + }, + isValid: false, + errorMsg: "verification_material: ed25519: bad public key length: 27", + }, + ), Entry( - "Ed25519 key has unexpected format", + "Ed25519 key 2018 has unexpected format", VerificationMethodTestCase{ - vm: VerificationMethod{ - Id: "did:cheqd:zABCDEFG123456789abcd#qwe", - Type: "Ed25519VerificationKey2020", - Controller: "did:cheqd:zABCDEFG987654321abcd", - VerificationMaterial: InvalidEd25519VerificationMaterial, + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "Ed25519VerificationKey2018", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: InvalidEd25519VerificationKey2018VerificationMaterialBadLength, }, isValid: false, - errorMsg: "verification_material: (publicKeyMultibase: ed25519: bad public key length: 18.)", - }), + errorMsg: "verification_material: ed25519: bad public key length: 31", + }, + ), ) var _ = Describe("Validation ed25519 Signature in verification method", func() { var pubKey ed25519.PublicKey var privKey ed25519.PrivateKey + var signature []byte var err error message := "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " + "tempor incididunt ut labore et dolore magna aliqua." msgBytes := []byte(message) - var signature []byte pubKey, privKey, err = ed25519.GenerateKey(rand.Reader) Expect(err).To(BeNil()) signature = ed25519.Sign(privKey, msgBytes) - Context("when ed25519 key is placed", func() { + Context("when ed25519 key 2020 representation is placed", func() { It("is valid", func() { - pubKeyStr, err := multibase.Encode(multibase.Base58BTC, pubKey) - Expect(err).To(BeNil()) + pubKeyStr := testsetup.GenerateEd25519VerificationKey2020VerificationMaterial(pubKey) - vm := VerificationMethod{ - Id: "", - Type: "Ed25519VerificationKey2020", - Controller: "", - VerificationMaterial: "{\"publicKeyMultibase\": \"" + pubKeyStr + "\"}", + vm := didtypes.VerificationMethod{ + Id: "", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "", + VerificationMaterial: pubKeyStr, } - err = VerifySignature(vm, msgBytes, signature) + err = didtypes.VerifySignature(vm, msgBytes, signature) Expect(err).To(BeNil()) }) }) - Context("when with the same env but JWK is placed", func() { + Context("when JWK 2020 representation is placed", func() { It("is valid", func() { - jwk_, err := jwk.New(pubKey) + jwkKey, err := jwk.New(pubKey) Expect(err).To(BeNil()) - json_, err := json.MarshalIndent(jwk_, "", " ") + jsonPayload, err := json.MarshalIndent(jwkKey, "", " ") Expect(err).To(BeNil()) - vm2 := VerificationMethod{ - Id: "", - Type: "JsonWebKey2020", - Controller: "", - VerificationMaterial: "{\"publicKeyJwk\": " + string(json_) + "}", + vm2 := didtypes.VerificationMethod{ + Id: "", + VerificationMethodType: "JsonWebKey2020", + Controller: "", + VerificationMaterial: string(jsonPayload), } - err = VerifySignature(vm2, msgBytes, signature) + err = didtypes.VerifySignature(vm2, msgBytes, signature) + Expect(err).To(BeNil()) + }) + }) + + Context("when ed25519 key 2018 representation is placed", func() { + It("is valid", func() { + pubKeyStr := testsetup.GenerateEd25519VerificationKey2018VerificationMaterial(pubKey) + + vm := didtypes.VerificationMethod{ + Id: "", + VerificationMethodType: "Ed25519VerificationKey2018", + Controller: "", + VerificationMaterial: pubKeyStr, + } + + err = didtypes.VerifySignature(vm, msgBytes, signature) Expect(err).To(BeNil()) }) }) @@ -224,20 +269,20 @@ var _ = Describe("Validation ECDSA Signature in verification method", func() { signature, err := ecdsa.SignASN1(rand.Reader, privKey, msgDigest) Expect(err).To(BeNil()) - jwk_, err := jwk.New(pubKey) + jwkKey, err := jwk.New(pubKey) Expect(err).To(BeNil()) - json_, err := json.MarshalIndent(jwk_, "", " ") + jsonPayload, err := json.MarshalIndent(jwkKey, "", " ") Expect(err).To(BeNil()) - vm := VerificationMethod{ - Id: "", - Type: "JsonWebKey2020", - Controller: "", - VerificationMaterial: "{\"publicKeyJwk\": " + string(json_) + "}", + vm := didtypes.VerificationMethod{ + Id: "", + VerificationMethodType: "JsonWebKey2020", + Controller: "", + VerificationMaterial: string(jsonPayload), } - err = VerifySignature(vm, msgBytes, signature) + err = didtypes.VerifySignature(vm, msgBytes, signature) Expect(err).To(BeNil()) }) }) @@ -262,21 +307,124 @@ var _ = Describe("Validation RSA Signature in verification method", func() { signature, err := rsa.SignPSS(rand.Reader, privKey, crypto.SHA256, msgDigest, nil) Expect(err).To(BeNil()) - jwk_, err := jwk.New(pubKey) + jwkKey, err := jwk.New(pubKey) Expect(err).To(BeNil()) - json_, err := json.Marshal(jwk_) + jsonPayload, err := json.Marshal(jwkKey) Expect(err).To(BeNil()) - vm2 := VerificationMethod{ - Id: "", - Type: "JsonWebKey2020", - Controller: "", - VerificationMaterial: "{\"publicKeyJwk\": " + string(json_) + "}", + vm2 := didtypes.VerificationMethod{ + Id: "", + VerificationMethodType: "JsonWebKey2020", + Controller: "", + VerificationMaterial: string(jsonPayload), } - err = VerifySignature(vm2, msgBytes, signature) + err = didtypes.VerifySignature(vm2, msgBytes, signature) Expect(err).To(BeNil()) }) }) }) + +var _ = DescribeTable("Verification Method material validation tests", func(testCase VerificationMethodTestCase) { + err := testCase.vm.Validate(testCase.baseDid, testCase.allowedNamespaces) + + if testCase.isValid { + Expect(err).To(BeNil()) + } else { + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(testCase.errorMsg)) + } +}, + Entry( + "Valid Ed25519VerificationKey2020 verification material", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, + }, + isValid: true, + errorMsg: "", + }, + ), + Entry( + "Valid JsonWebKey2020 verification material", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidJWK2020VerificationMaterial, + }, + isValid: true, + errorMsg: "", + }, + ), + Entry( + "Valid Ed25519VerificationKey2018 verification material", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "Ed25519VerificationKey2018", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: ValidEd25519VerificationKey2018VerificationMaterial, + }, + isValid: true, + errorMsg: "", + }, + ), + Entry( + "Invalid Ed25519VerificationKey2020 verification material", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: InvalidEd25519VerificationKey2020VerificationMaterialBadlength, + }, + isValid: false, + errorMsg: "", + }, + ), + Entry( + "Invalid Ed25519VerificationKey2020 verification material", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: InvalidEd25519VerificationKey2020VerificationMaterialBadPrefix, + }, + isValid: false, + errorMsg: "verification_material: invalid two-byte prefix for Ed25519VerificationKey2020. expected: 0xed01 actual: 0x0200", + }, + ), + Entry( + "Invalid JsonWebKey2020 verification material", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "JsonWebKey2020", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: InvalidJWK2020VerificationMaterial, + }, + isValid: false, + errorMsg: "can't parse jwk: failed to parse key", + }, + ), + Entry( + "Invalid Ed25519VerificationKey2018 verification material", + VerificationMethodTestCase{ + vm: didtypes.VerificationMethod{ + Id: "did:cheqd:zABCDEFG123456789abcd#qwe", + VerificationMethodType: "Ed25519VerificationKey2018", + Controller: "did:cheqd:zABCDEFG987654321abcd", + VerificationMaterial: InvalidEd25519VerificationKey2018VerificationMaterialBadLength, + }, + isValid: false, + errorMsg: "ed25519: bad public key length: 31", + }, + ), +) diff --git a/x/did/types/fee.pb.go b/x/did/types/fee.pb.go index 7a07d6307..6fef4db44 100644 --- a/x/did/types/fee.pb.go +++ b/x/did/types/fee.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -26,13 +26,24 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// FeeParams defines the parameters for the `did` module fixed fee. +// FeeParams defines the parameters for the cheqd DID module fixed fee type FeeParams struct { - // Tx types define the fixed fee each for the `did` module. - CreateDid types.Coin `protobuf:"bytes,1,opt,name=create_did,json=createDid,proto3" json:"create_did"` - UpdateDid types.Coin `protobuf:"bytes,2,opt,name=update_did,json=updateDid,proto3" json:"update_did"` - DeactivateDid types.Coin `protobuf:"bytes,3,opt,name=deactivate_did,json=deactivateDid,proto3" json:"deactivate_did"` - BurnFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=burn_factor,json=burnFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"burn_factor"` + // Fixed fee for creating a DID + // + // Default: 50 CHEQ or 50000000000ncheq + CreateDid types.Coin `protobuf:"bytes,1,opt,name=create_did,json=createDid,proto3" json:"create_did"` + // Fixed fee for updating a DID + // + // Default: 25 CHEQ or 25000000000ncheq + UpdateDid types.Coin `protobuf:"bytes,2,opt,name=update_did,json=updateDid,proto3" json:"update_did"` + // Fixed fee for deactivating a DID + // + // Default: 10 CHEQ or 10000000000ncheq + DeactivateDid types.Coin `protobuf:"bytes,3,opt,name=deactivate_did,json=deactivateDid,proto3" json:"deactivate_did"` + // Percentage of the fixed fee that will be burned + // + // Default: 0.5 (50%) + BurnFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=burn_factor,json=burnFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"burn_factor"` } func (m *FeeParams) Reset() { *m = FeeParams{} } @@ -96,28 +107,28 @@ func init() { func init() { proto.RegisterFile("cheqd/did/v2/fee.proto", fileDescriptor_b0cfbae270deaac7) } var fileDescriptor_b0cfbae270deaac7 = []byte{ - // 329 bytes of a gzipped FileDescriptorProto + // 331 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x3f, 0x4f, 0x3a, 0x31, 0x18, 0xc7, 0xaf, 0xfc, 0xc8, 0x2f, 0xa1, 0xa8, 0x03, 0x31, 0x06, 0x18, 0x0a, 0x71, 0x50, 0x16, 0xda, 0x80, 0xab, 0x71, 0x40, 0x64, 0x36, 0x8c, 0x26, 0x86, 0xf4, 0xda, 0x07, 0x68, 0x0c, 0x57, 0xbc, 0x2b, 0x17, 0x7d, 0x17, 0xbe, 0x0c, 0x67, 0xe3, 0x8b, 0x60, 0x24, 0x4e, 0xc6, 0x81, 0x98, - 0xbb, 0x37, 0x62, 0xda, 0x1e, 0xd1, 0x91, 0xa5, 0xff, 0xbe, 0xcf, 0xe7, 0xf3, 0x24, 0x7d, 0xf0, - 0x89, 0x98, 0xc3, 0xa3, 0x64, 0x52, 0x49, 0x96, 0xf6, 0xd9, 0x14, 0x80, 0x2e, 0x63, 0x6d, 0x74, - 0xed, 0xc0, 0xbd, 0x53, 0xa9, 0x24, 0x4d, 0xfb, 0xcd, 0xe3, 0x99, 0x9e, 0x69, 0x17, 0x30, 0x7b, - 0xf2, 0x35, 0x4d, 0x22, 0x74, 0xb2, 0xd0, 0x09, 0x0b, 0x79, 0x02, 0x2c, 0xed, 0x85, 0x60, 0x78, - 0x8f, 0x09, 0xad, 0xa2, 0x22, 0x6f, 0xf8, 0x7c, 0xe2, 0x41, 0x7f, 0xf1, 0xd1, 0xe9, 0x5b, 0x09, - 0x57, 0x46, 0x00, 0xb7, 0x3c, 0xe6, 0x8b, 0xa4, 0x76, 0x85, 0xb1, 0x88, 0x81, 0x1b, 0x98, 0x48, - 0x25, 0xeb, 0xa8, 0x8d, 0x3a, 0xd5, 0x7e, 0x83, 0x16, 0x80, 0xb5, 0xd3, 0xc2, 0x4e, 0xaf, 0xb5, - 0x8a, 0x06, 0xe5, 0xf5, 0xb6, 0x15, 0x8c, 0x2b, 0x1e, 0x19, 0x2a, 0x69, 0xf9, 0xd5, 0x52, 0xee, - 0xf8, 0xd2, 0x9e, 0xbc, 0x47, 0x2c, 0x3f, 0xc2, 0x47, 0x12, 0xb8, 0x30, 0x2a, 0xdd, 0x39, 0xfe, - 0xed, 0xe7, 0x38, 0xfc, 0xc5, 0xac, 0xe7, 0x1e, 0x57, 0xc3, 0x55, 0x1c, 0x4d, 0xa6, 0x5c, 0x18, - 0x1d, 0xd7, 0xcb, 0x6d, 0xd4, 0xa9, 0x0c, 0x2e, 0x6d, 0xe5, 0xd7, 0xb6, 0x75, 0x36, 0x53, 0x66, - 0xbe, 0x0a, 0xa9, 0xd0, 0x8b, 0xe2, 0x2f, 0x8a, 0xad, 0x9b, 0xc8, 0x07, 0x66, 0x9e, 0x97, 0x90, - 0xd0, 0x21, 0x88, 0x8f, 0xf7, 0x2e, 0x2e, 0xba, 0x0e, 0x41, 0x8c, 0xb1, 0x15, 0x8e, 0x9c, 0x6f, - 0x70, 0xf3, 0x9a, 0x11, 0xb4, 0xce, 0x08, 0xda, 0x64, 0x04, 0x7d, 0x67, 0x04, 0xbd, 0xe4, 0x24, - 0xd8, 0xe4, 0x24, 0xf8, 0xcc, 0x49, 0x70, 0x77, 0xfe, 0xd7, 0xef, 0x86, 0xea, 0xd6, 0x6e, 0xa4, - 0x25, 0xb0, 0x27, 0x37, 0x61, 0xd7, 0x24, 0xfc, 0xef, 0x46, 0x70, 0xf1, 0x13, 0x00, 0x00, 0xff, - 0xff, 0x40, 0x17, 0x37, 0x98, 0xfb, 0x01, 0x00, 0x00, + 0xbb, 0x37, 0x62, 0xda, 0x1e, 0xd1, 0x91, 0xe5, 0xee, 0x9e, 0x3f, 0x9f, 0xcf, 0x37, 0xb9, 0x07, + 0x9f, 0x88, 0x39, 0x3c, 0x4a, 0x26, 0x95, 0x64, 0x69, 0x9f, 0x4d, 0x01, 0xe8, 0x32, 0xd6, 0x46, + 0xd7, 0x0e, 0x5c, 0x9f, 0x4a, 0x25, 0x69, 0xda, 0x6f, 0x12, 0xa1, 0x93, 0x85, 0x4e, 0x58, 0xc8, + 0x13, 0x60, 0x69, 0x2f, 0x04, 0xc3, 0x7b, 0x4c, 0x68, 0x15, 0xf9, 0xed, 0x66, 0xc3, 0xcf, 0x27, + 0xae, 0x62, 0xbe, 0x28, 0x46, 0xc7, 0x33, 0x3d, 0xd3, 0xbe, 0x6f, 0xbf, 0x7c, 0xf7, 0xf4, 0xad, + 0x84, 0x2b, 0x23, 0x80, 0x5b, 0x1e, 0xf3, 0x45, 0x52, 0xbb, 0xc2, 0x58, 0xc4, 0xc0, 0x0d, 0x4c, + 0xa4, 0x92, 0x75, 0xd4, 0x46, 0x9d, 0x6a, 0xbf, 0x41, 0x0b, 0x8d, 0xcd, 0xa4, 0x45, 0x26, 0xbd, + 0xd6, 0x2a, 0x1a, 0x94, 0xd7, 0xdb, 0x56, 0x30, 0xae, 0x78, 0x64, 0xa8, 0xa4, 0xe5, 0x57, 0x4b, + 0xb9, 0xe3, 0x4b, 0x7b, 0xf2, 0x1e, 0xb1, 0xfc, 0x08, 0x1f, 0x49, 0xe0, 0xc2, 0xa8, 0x74, 0xe7, + 0xf8, 0xb7, 0x9f, 0xe3, 0xf0, 0x17, 0xb3, 0x9e, 0x7b, 0x5c, 0x0d, 0x57, 0x71, 0x34, 0x99, 0x72, + 0x61, 0x74, 0x5c, 0x2f, 0xb7, 0x51, 0xa7, 0x32, 0xb8, 0xb4, 0x9b, 0x5f, 0xdb, 0xd6, 0xd9, 0x4c, + 0x99, 0xf9, 0x2a, 0xa4, 0x42, 0x2f, 0x8a, 0x3f, 0x54, 0xbc, 0xba, 0x89, 0x7c, 0x60, 0xe6, 0x79, + 0x09, 0x09, 0x1d, 0x82, 0xf8, 0x78, 0xef, 0xe2, 0x22, 0x75, 0x08, 0x62, 0x8c, 0xad, 0x70, 0xe4, + 0x7c, 0x83, 0x9b, 0xd7, 0x8c, 0xa0, 0x75, 0x46, 0xd0, 0x26, 0x23, 0xe8, 0x3b, 0x23, 0xe8, 0x25, + 0x27, 0xc1, 0x26, 0x27, 0xc1, 0x67, 0x4e, 0x82, 0xbb, 0xf3, 0xbf, 0x7e, 0x77, 0x54, 0xf7, 0xec, + 0x46, 0x5a, 0x02, 0x7b, 0x72, 0x17, 0x76, 0x21, 0xe1, 0x7f, 0x77, 0x82, 0x8b, 0x9f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x2f, 0x93, 0x46, 0x88, 0xfb, 0x01, 0x00, 0x00, } func (this *FeeParams) Equal(that interface{}) bool { diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index f804adc08..9c711780b 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -22,9 +22,13 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// DidDocVersionSet contains all versions of DID Documents and their metadata for a given DID. +// The latest version of the DID Document set is stored in the latest_version field. type DidDocVersionSet struct { - LatestVersion string `protobuf:"bytes,1,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` - DidDocs []*DidDocWithMetadata `protobuf:"bytes,2,rep,name=did_docs,json=didDocs,proto3" json:"did_docs,omitempty"` + // Latest version of the DID Document set + LatestVersion string `protobuf:"bytes,1,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` + // All versions of the DID Document set + DidDocs []*DidDocWithMetadata `protobuf:"bytes,2,rep,name=did_docs,json=didDocs,proto3" json:"did_docs,omitempty"` } func (m *DidDocVersionSet) Reset() { *m = DidDocVersionSet{} } @@ -74,10 +78,16 @@ func (m *DidDocVersionSet) GetDidDocs() []*DidDocWithMetadata { return nil } +// GenesisState defines the cheqd DID module's genesis state. type GenesisState struct { - DidNamespace string `protobuf:"bytes,1,opt,name=did_namespace,json=didNamespace,proto3" json:"did_namespace,omitempty"` - VersionSets []*DidDocVersionSet `protobuf:"bytes,2,rep,name=version_sets,json=versionSets,proto3" json:"version_sets,omitempty"` - FeeParams *FeeParams `protobuf:"bytes,3,opt,name=fee_params,json=feeParams,proto3" json:"fee_params,omitempty"` + // Namespace for the DID module + // Example: mainnet, testnet, local + DidNamespace string `protobuf:"bytes,1,opt,name=did_namespace,json=didNamespace,proto3" json:"did_namespace,omitempty"` + // All DID Document version sets (contains all versions of all DID Documents) + VersionSets []*DidDocVersionSet `protobuf:"bytes,2,rep,name=version_sets,json=versionSets,proto3" json:"version_sets,omitempty"` + // Fee parameters for the DID module + // Defines fixed fees and burn percentage for each DID operation type (create, update, delete) + FeeParams *FeeParams `protobuf:"bytes,3,opt,name=fee_params,json=feeParams,proto3" json:"fee_params,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index 9b57071cf..9564a18d4 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -28,22 +29,31 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type QueryGetDidDocRequest struct { +// QueryDidDocRequest is the request type for the Query/DidDoc method +type QueryDidDocRequest struct { + // DID unique identifier of the DID Document to fetch. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *QueryGetDidDocRequest) Reset() { *m = QueryGetDidDocRequest{} } -func (m *QueryGetDidDocRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetDidDocRequest) ProtoMessage() {} -func (*QueryGetDidDocRequest) Descriptor() ([]byte, []int) { +func (m *QueryDidDocRequest) Reset() { *m = QueryDidDocRequest{} } +func (m *QueryDidDocRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDidDocRequest) ProtoMessage() {} +func (*QueryDidDocRequest) Descriptor() ([]byte, []int) { return fileDescriptor_8d818263856d0dc9, []int{0} } -func (m *QueryGetDidDocRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryDidDocRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetDidDocRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDidDocRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetDidDocRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDidDocRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -53,41 +63,45 @@ func (m *QueryGetDidDocRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *QueryGetDidDocRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetDidDocRequest.Merge(m, src) +func (m *QueryDidDocRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDidDocRequest.Merge(m, src) } -func (m *QueryGetDidDocRequest) XXX_Size() int { +func (m *QueryDidDocRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetDidDocRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetDidDocRequest.DiscardUnknown(m) +func (m *QueryDidDocRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDidDocRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetDidDocRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryDidDocRequest proto.InternalMessageInfo -func (m *QueryGetDidDocRequest) GetId() string { +func (m *QueryDidDocRequest) GetId() string { if m != nil { return m.Id } return "" } -type QueryGetDidDocResponse struct { +// QueryDidDocResponse is the response type for the Query/DidDoc method +type QueryDidDocResponse struct { + // Successful resolution of the DID Document returns the following: + // - did_doc is the latest version of the DID Document + // - metadata is is the DID Document metadata associated with the latest version of the DID Document Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } -func (m *QueryGetDidDocResponse) Reset() { *m = QueryGetDidDocResponse{} } -func (m *QueryGetDidDocResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetDidDocResponse) ProtoMessage() {} -func (*QueryGetDidDocResponse) Descriptor() ([]byte, []int) { +func (m *QueryDidDocResponse) Reset() { *m = QueryDidDocResponse{} } +func (m *QueryDidDocResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDidDocResponse) ProtoMessage() {} +func (*QueryDidDocResponse) Descriptor() ([]byte, []int) { return fileDescriptor_8d818263856d0dc9, []int{1} } -func (m *QueryGetDidDocResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryDidDocResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetDidDocResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDidDocResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetDidDocResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDidDocResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -97,42 +111,57 @@ func (m *QueryGetDidDocResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryGetDidDocResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetDidDocResponse.Merge(m, src) +func (m *QueryDidDocResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDidDocResponse.Merge(m, src) } -func (m *QueryGetDidDocResponse) XXX_Size() int { +func (m *QueryDidDocResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetDidDocResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetDidDocResponse.DiscardUnknown(m) +func (m *QueryDidDocResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDidDocResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetDidDocResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryDidDocResponse proto.InternalMessageInfo -func (m *QueryGetDidDocResponse) GetValue() *DidDocWithMetadata { +func (m *QueryDidDocResponse) GetValue() *DidDocWithMetadata { if m != nil { return m.Value } return nil } -type QueryGetDidDocVersionRequest struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +// QueryDidDocVersionRequest is the request type for the Query/DidDocVersion method +type QueryDidDocVersionRequest struct { + // DID unique identifier of the DID Document to fetch. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique version identifier of the DID Document to fetch. + // Returns the specified version of the DID Document. + // + // Format: + // + // Example: 93f2573c-eca9-4098-96cb-a1ec676a29ed Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` } -func (m *QueryGetDidDocVersionRequest) Reset() { *m = QueryGetDidDocVersionRequest{} } -func (m *QueryGetDidDocVersionRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetDidDocVersionRequest) ProtoMessage() {} -func (*QueryGetDidDocVersionRequest) Descriptor() ([]byte, []int) { +func (m *QueryDidDocVersionRequest) Reset() { *m = QueryDidDocVersionRequest{} } +func (m *QueryDidDocVersionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDidDocVersionRequest) ProtoMessage() {} +func (*QueryDidDocVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor_8d818263856d0dc9, []int{2} } -func (m *QueryGetDidDocVersionRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryDidDocVersionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetDidDocVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDidDocVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetDidDocVersionRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDidDocVersionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -142,48 +171,52 @@ func (m *QueryGetDidDocVersionRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryGetDidDocVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetDidDocVersionRequest.Merge(m, src) +func (m *QueryDidDocVersionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDidDocVersionRequest.Merge(m, src) } -func (m *QueryGetDidDocVersionRequest) XXX_Size() int { +func (m *QueryDidDocVersionRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetDidDocVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetDidDocVersionRequest.DiscardUnknown(m) +func (m *QueryDidDocVersionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDidDocVersionRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetDidDocVersionRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryDidDocVersionRequest proto.InternalMessageInfo -func (m *QueryGetDidDocVersionRequest) GetId() string { +func (m *QueryDidDocVersionRequest) GetId() string { if m != nil { return m.Id } return "" } -func (m *QueryGetDidDocVersionRequest) GetVersion() string { +func (m *QueryDidDocVersionRequest) GetVersion() string { if m != nil { return m.Version } return "" } -type QueryGetDidDocVersionResponse struct { +// QueryDidDocVersionResponse is the response type for the Query/DidDocVersion method +type QueryDidDocVersionResponse struct { + // Successful resolution of the DID Document returns the following: + // - did_doc is the requested version of the DID Document + // - metadata is DID Document metadata associated with the requested version of the DID Document Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } -func (m *QueryGetDidDocVersionResponse) Reset() { *m = QueryGetDidDocVersionResponse{} } -func (m *QueryGetDidDocVersionResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetDidDocVersionResponse) ProtoMessage() {} -func (*QueryGetDidDocVersionResponse) Descriptor() ([]byte, []int) { +func (m *QueryDidDocVersionResponse) Reset() { *m = QueryDidDocVersionResponse{} } +func (m *QueryDidDocVersionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDidDocVersionResponse) ProtoMessage() {} +func (*QueryDidDocVersionResponse) Descriptor() ([]byte, []int) { return fileDescriptor_8d818263856d0dc9, []int{3} } -func (m *QueryGetDidDocVersionResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryDidDocVersionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetDidDocVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDidDocVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetDidDocVersionResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDidDocVersionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -193,43 +226,52 @@ func (m *QueryGetDidDocVersionResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryGetDidDocVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetDidDocVersionResponse.Merge(m, src) +func (m *QueryDidDocVersionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDidDocVersionResponse.Merge(m, src) } -func (m *QueryGetDidDocVersionResponse) XXX_Size() int { +func (m *QueryDidDocVersionResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetDidDocVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetDidDocVersionResponse.DiscardUnknown(m) +func (m *QueryDidDocVersionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDidDocVersionResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetDidDocVersionResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryDidDocVersionResponse proto.InternalMessageInfo -func (m *QueryGetDidDocVersionResponse) GetValue() *DidDocWithMetadata { +func (m *QueryDidDocVersionResponse) GetValue() *DidDocWithMetadata { if m != nil { return m.Value } return nil } -type QueryGetAllDidDocVersionsMetadataRequest struct { +// QueryAllDidDocVersionsMetadataRequest is the request type for the Query/AllDidDocVersionsMetadata method +type QueryAllDidDocVersionsMetadataRequest struct { + // DID unique identifier of the DID Document to fetch version metadata. + // UUID-style DIDs as well as Indy-style DID are supported. + // + // Format: did:cheqd:: + // + // Examples: + // - did:cheqd:mainnet:c82f2b02-bdab-4dd7-b833-3e143745d612 + // - did:cheqd:testnet:wGHEXrZvJxR8vw5P3UWH1j Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryGetAllDidDocVersionsMetadataRequest) Reset() { - *m = QueryGetAllDidDocVersionsMetadataRequest{} -} -func (m *QueryGetAllDidDocVersionsMetadataRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetAllDidDocVersionsMetadataRequest) ProtoMessage() {} -func (*QueryGetAllDidDocVersionsMetadataRequest) Descriptor() ([]byte, []int) { +func (m *QueryAllDidDocVersionsMetadataRequest) Reset() { *m = QueryAllDidDocVersionsMetadataRequest{} } +func (m *QueryAllDidDocVersionsMetadataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllDidDocVersionsMetadataRequest) ProtoMessage() {} +func (*QueryAllDidDocVersionsMetadataRequest) Descriptor() ([]byte, []int) { return fileDescriptor_8d818263856d0dc9, []int{4} } -func (m *QueryGetAllDidDocVersionsMetadataRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAllDidDocVersionsMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetAllDidDocVersionsMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllDidDocVersionsMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetAllDidDocVersionsMetadataRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllDidDocVersionsMetadataRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -239,45 +281,54 @@ func (m *QueryGetAllDidDocVersionsMetadataRequest) XXX_Marshal(b []byte, determi return b[:n], nil } } -func (m *QueryGetAllDidDocVersionsMetadataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetAllDidDocVersionsMetadataRequest.Merge(m, src) +func (m *QueryAllDidDocVersionsMetadataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllDidDocVersionsMetadataRequest.Merge(m, src) } -func (m *QueryGetAllDidDocVersionsMetadataRequest) XXX_Size() int { +func (m *QueryAllDidDocVersionsMetadataRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetAllDidDocVersionsMetadataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetAllDidDocVersionsMetadataRequest.DiscardUnknown(m) +func (m *QueryAllDidDocVersionsMetadataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllDidDocVersionsMetadataRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetAllDidDocVersionsMetadataRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAllDidDocVersionsMetadataRequest proto.InternalMessageInfo -func (m *QueryGetAllDidDocVersionsMetadataRequest) GetId() string { +func (m *QueryAllDidDocVersionsMetadataRequest) GetId() string { if m != nil { return m.Id } return "" } -type QueryGetAllDidDocVersionsMetadataResponse struct { - Versions []*Metadata `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` +func (m *QueryAllDidDocVersionsMetadataRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil } -func (m *QueryGetAllDidDocVersionsMetadataResponse) Reset() { - *m = QueryGetAllDidDocVersionsMetadataResponse{} +// QueryAllDidDocVersionsMetadataResponse is the response type for the Query/AllDidDocVersionsMetadata method +type QueryAllDidDocVersionsMetadataResponse struct { + // versions is the list of all versions of the requested DID Document + Versions []*Metadata `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryGetAllDidDocVersionsMetadataResponse) String() string { - return proto.CompactTextString(m) + +func (m *QueryAllDidDocVersionsMetadataResponse) Reset() { + *m = QueryAllDidDocVersionsMetadataResponse{} } -func (*QueryGetAllDidDocVersionsMetadataResponse) ProtoMessage() {} -func (*QueryGetAllDidDocVersionsMetadataResponse) Descriptor() ([]byte, []int) { +func (m *QueryAllDidDocVersionsMetadataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllDidDocVersionsMetadataResponse) ProtoMessage() {} +func (*QueryAllDidDocVersionsMetadataResponse) Descriptor() ([]byte, []int) { return fileDescriptor_8d818263856d0dc9, []int{5} } -func (m *QueryGetAllDidDocVersionsMetadataResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAllDidDocVersionsMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetAllDidDocVersionsMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllDidDocVersionsMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetAllDidDocVersionsMetadataResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllDidDocVersionsMetadataResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -287,66 +338,77 @@ func (m *QueryGetAllDidDocVersionsMetadataResponse) XXX_Marshal(b []byte, determ return b[:n], nil } } -func (m *QueryGetAllDidDocVersionsMetadataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetAllDidDocVersionsMetadataResponse.Merge(m, src) +func (m *QueryAllDidDocVersionsMetadataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllDidDocVersionsMetadataResponse.Merge(m, src) } -func (m *QueryGetAllDidDocVersionsMetadataResponse) XXX_Size() int { +func (m *QueryAllDidDocVersionsMetadataResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetAllDidDocVersionsMetadataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetAllDidDocVersionsMetadataResponse.DiscardUnknown(m) +func (m *QueryAllDidDocVersionsMetadataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllDidDocVersionsMetadataResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetAllDidDocVersionsMetadataResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAllDidDocVersionsMetadataResponse proto.InternalMessageInfo -func (m *QueryGetAllDidDocVersionsMetadataResponse) GetVersions() []*Metadata { +func (m *QueryAllDidDocVersionsMetadataResponse) GetVersions() []*Metadata { if m != nil { return m.Versions } return nil } +func (m *QueryAllDidDocVersionsMetadataResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { - proto.RegisterType((*QueryGetDidDocRequest)(nil), "cheqd.did.v2.QueryGetDidDocRequest") - proto.RegisterType((*QueryGetDidDocResponse)(nil), "cheqd.did.v2.QueryGetDidDocResponse") - proto.RegisterType((*QueryGetDidDocVersionRequest)(nil), "cheqd.did.v2.QueryGetDidDocVersionRequest") - proto.RegisterType((*QueryGetDidDocVersionResponse)(nil), "cheqd.did.v2.QueryGetDidDocVersionResponse") - proto.RegisterType((*QueryGetAllDidDocVersionsMetadataRequest)(nil), "cheqd.did.v2.QueryGetAllDidDocVersionsMetadataRequest") - proto.RegisterType((*QueryGetAllDidDocVersionsMetadataResponse)(nil), "cheqd.did.v2.QueryGetAllDidDocVersionsMetadataResponse") + proto.RegisterType((*QueryDidDocRequest)(nil), "cheqd.did.v2.QueryDidDocRequest") + proto.RegisterType((*QueryDidDocResponse)(nil), "cheqd.did.v2.QueryDidDocResponse") + proto.RegisterType((*QueryDidDocVersionRequest)(nil), "cheqd.did.v2.QueryDidDocVersionRequest") + proto.RegisterType((*QueryDidDocVersionResponse)(nil), "cheqd.did.v2.QueryDidDocVersionResponse") + proto.RegisterType((*QueryAllDidDocVersionsMetadataRequest)(nil), "cheqd.did.v2.QueryAllDidDocVersionsMetadataRequest") + proto.RegisterType((*QueryAllDidDocVersionsMetadataResponse)(nil), "cheqd.did.v2.QueryAllDidDocVersionsMetadataResponse") } func init() { proto.RegisterFile("cheqd/did/v2/query.proto", fileDescriptor_8d818263856d0dc9) } var fileDescriptor_8d818263856d0dc9 = []byte{ - // 443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0x8b, 0xd3, 0x40, - 0x18, 0x87, 0x3b, 0x59, 0x76, 0xd5, 0x59, 0xf5, 0x30, 0xe8, 0x92, 0x8d, 0xbb, 0xa1, 0xa4, 0xc5, - 0xd6, 0x7f, 0x19, 0x88, 0x50, 0xc1, 0x5b, 0xa5, 0xa0, 0x17, 0x41, 0x7b, 0xb0, 0xe0, 0x45, 0xd2, - 0xcc, 0xd0, 0x0e, 0xa4, 0x99, 0xb4, 0x33, 0x09, 0x96, 0xd2, 0x8b, 0x9f, 0x40, 0x10, 0xfc, 0x1e, - 0x7e, 0x08, 0xc1, 0x63, 0xc1, 0x8b, 0x47, 0x69, 0xfd, 0x20, 0xe2, 0x64, 0x5a, 0x1c, 0x6d, 0x6a, - 0x65, 0x2f, 0x21, 0xc9, 0x3c, 0xef, 0x6f, 0x9e, 0x79, 0xdf, 0x04, 0xda, 0xd1, 0x90, 0x8e, 0x09, - 0x26, 0x8c, 0xe0, 0x3c, 0xc0, 0xe3, 0x8c, 0x4e, 0xa6, 0x7e, 0x3a, 0xe1, 0x92, 0xa3, 0xab, 0x6a, - 0xc5, 0x27, 0x8c, 0xf8, 0x79, 0xe0, 0x9c, 0x1a, 0x1c, 0x61, 0x84, 0xf0, 0xa8, 0x00, 0x9d, 0xb3, - 0x01, 0xe7, 0x83, 0x98, 0xe2, 0x30, 0x65, 0x38, 0x4c, 0x12, 0x2e, 0x43, 0xc9, 0x78, 0x22, 0x8a, - 0x55, 0xaf, 0x01, 0x6f, 0xbe, 0xfc, 0x95, 0xfa, 0x94, 0xca, 0x0e, 0x23, 0x1d, 0x1e, 0x75, 0xe9, - 0x38, 0xa3, 0x42, 0xa2, 0xeb, 0xd0, 0x62, 0xc4, 0x06, 0x55, 0xd0, 0xbc, 0xd2, 0xb5, 0x18, 0xf1, - 0x5e, 0xc0, 0x93, 0x3f, 0x41, 0x91, 0xf2, 0x44, 0x50, 0xd4, 0x82, 0x87, 0x79, 0x18, 0x67, 0x54, - 0xc1, 0xc7, 0x41, 0xd5, 0xff, 0xdd, 0xcc, 0x2f, 0xe0, 0x1e, 0x93, 0xc3, 0xe7, 0x54, 0x86, 0x24, - 0x94, 0x61, 0xb7, 0xc0, 0xbd, 0x67, 0xf0, 0xcc, 0x4c, 0x7c, 0x45, 0x27, 0x82, 0xf1, 0xa4, 0xc4, - 0x00, 0xd9, 0xf0, 0x52, 0x5e, 0x10, 0xb6, 0xa5, 0x5e, 0xae, 0x1f, 0xbd, 0x1e, 0x3c, 0x2f, 0x49, - 0xba, 0xa0, 0xe2, 0x63, 0xd8, 0x5c, 0x07, 0xb7, 0xe3, 0xd8, 0xc8, 0x16, 0x1b, 0xb6, 0xa4, 0x61, - 0x6f, 0xe0, 0x9d, 0x3d, 0x6a, 0xb5, 0x60, 0x00, 0x2f, 0xeb, 0xc3, 0x08, 0x1b, 0x54, 0x0f, 0x9a, - 0xc7, 0xc1, 0x89, 0xe9, 0xb8, 0xa9, 0xd8, 0x70, 0xc1, 0xe7, 0x03, 0x78, 0xa8, 0x76, 0x40, 0x1c, - 0x1e, 0x15, 0xf9, 0xa8, 0x66, 0x56, 0x6d, 0x1d, 0xad, 0x53, 0xdf, 0x0d, 0x15, 0x4a, 0x9e, 0xf3, - 0xee, 0xeb, 0x8f, 0x0f, 0xd6, 0x0d, 0x84, 0xb0, 0xf1, 0x6d, 0xcd, 0x18, 0x99, 0xa3, 0x8f, 0x00, - 0x5e, 0x33, 0x4e, 0x84, 0xee, 0xee, 0xca, 0x34, 0x07, 0xeb, 0xdc, 0xdb, 0x8b, 0xd5, 0x1a, 0xf7, - 0x95, 0xc6, 0x6d, 0x54, 0xff, 0x5b, 0x03, 0xeb, 0x56, 0xe0, 0x99, 0xbe, 0x99, 0xa3, 0x4f, 0x00, - 0x9e, 0x96, 0x76, 0x1b, 0xb5, 0xb6, 0x6f, 0xfc, 0xaf, 0xd1, 0x3a, 0x8f, 0xfe, 0xbb, 0x4e, 0xcb, - 0xd7, 0x94, 0xfc, 0x39, 0xba, 0xb5, 0x45, 0x7e, 0xa4, 0xe1, 0x27, 0xed, 0x2f, 0x4b, 0x17, 0x2c, - 0x96, 0x2e, 0xf8, 0xbe, 0x74, 0xc1, 0xfb, 0x95, 0x5b, 0x59, 0xac, 0xdc, 0xca, 0xb7, 0x95, 0x5b, - 0x79, 0xdd, 0x18, 0x30, 0x39, 0xcc, 0xfa, 0x7e, 0xc4, 0x47, 0x3a, 0x40, 0x5d, 0x1f, 0x24, 0x9c, - 0x50, 0xfc, 0x56, 0xa5, 0xc9, 0x69, 0x4a, 0x45, 0xff, 0x48, 0xfd, 0xcc, 0x0f, 0x7f, 0x06, 0x00, - 0x00, 0xff, 0xff, 0x63, 0xb1, 0x80, 0xaf, 0x2f, 0x04, 0x00, 0x00, + // 503 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x41, 0x8b, 0xd3, 0x40, + 0x14, 0xc7, 0x9b, 0x2e, 0xbb, 0xea, 0xab, 0x7a, 0x18, 0x45, 0xd2, 0xa8, 0xa1, 0xc6, 0xb5, 0x2d, + 0xa2, 0x33, 0x6c, 0x56, 0xbc, 0xaf, 0xac, 0x7a, 0x5a, 0xd0, 0x22, 0x0a, 0xde, 0xa6, 0x99, 0x21, + 0x1d, 0xe8, 0x66, 0xd2, 0xce, 0x34, 0xb8, 0x2c, 0x8b, 0xe0, 0x27, 0x58, 0xf0, 0x33, 0x78, 0xf2, + 0xe8, 0x97, 0xf0, 0xb8, 0xe0, 0xc5, 0xa3, 0xb4, 0x7e, 0x10, 0xd9, 0x99, 0xb1, 0x36, 0x6e, 0x63, + 0x91, 0xbd, 0x84, 0x24, 0xef, 0xff, 0xfe, 0xef, 0x37, 0xef, 0xbd, 0x04, 0xfc, 0x64, 0xc0, 0x47, + 0x8c, 0x30, 0xc1, 0x48, 0x11, 0x93, 0xd1, 0x84, 0x8f, 0x0f, 0x70, 0x3e, 0x96, 0x5a, 0xa2, 0xcb, + 0x26, 0x82, 0x99, 0x60, 0xb8, 0x88, 0x83, 0x66, 0x49, 0xc7, 0x04, 0x63, 0x32, 0xb1, 0xc2, 0xe0, + 0x7e, 0x22, 0xd5, 0xbe, 0x54, 0xa4, 0x4f, 0x15, 0xb7, 0x0e, 0xa4, 0xd8, 0xea, 0x73, 0x4d, 0xb7, + 0x48, 0x4e, 0x53, 0x91, 0x51, 0x2d, 0x64, 0xe6, 0xb4, 0xb7, 0x52, 0x29, 0xd3, 0x21, 0x27, 0x34, + 0x17, 0x84, 0x66, 0x99, 0xd4, 0x26, 0xa8, 0x6c, 0x34, 0xda, 0x04, 0xf4, 0xf2, 0x34, 0x7f, 0x57, + 0xb0, 0x5d, 0x99, 0xf4, 0xf8, 0x68, 0xc2, 0x95, 0x46, 0x57, 0xa1, 0x2e, 0x98, 0xef, 0xb5, 0xbc, + 0xee, 0xa5, 0x5e, 0x5d, 0xb0, 0x68, 0x0f, 0xae, 0x95, 0x54, 0x2a, 0x97, 0x99, 0xe2, 0xe8, 0x31, + 0xac, 0x17, 0x74, 0x38, 0xe1, 0x46, 0xd9, 0x88, 0x5b, 0x78, 0x91, 0x1f, 0x5b, 0xf1, 0x1b, 0xa1, + 0x07, 0x7b, 0x5c, 0x53, 0x46, 0x35, 0xed, 0x59, 0x79, 0xf4, 0x14, 0x9a, 0x0b, 0x76, 0xaf, 0xf9, + 0x58, 0x09, 0x99, 0x55, 0xd4, 0x46, 0x3e, 0x5c, 0x28, 0xac, 0xc2, 0xaf, 0x9b, 0x97, 0xbf, 0x1f, + 0xa3, 0x57, 0x10, 0x2c, 0xb3, 0x39, 0x27, 0xdc, 0x7b, 0xb8, 0x67, 0x5c, 0x77, 0x86, 0xc3, 0x92, + 0xb1, 0x9a, 0x0b, 0x2b, 0x40, 0x9f, 0x01, 0xfc, 0x69, 0xbe, 0x61, 0x6d, 0xc4, 0x6d, 0x6c, 0x27, + 0x85, 0x4f, 0x27, 0x85, 0xed, 0xac, 0xdd, 0xa4, 0xf0, 0x0b, 0x9a, 0x72, 0xe7, 0xd5, 0x5b, 0xc8, + 0x8c, 0x3e, 0x79, 0xd0, 0x5e, 0x45, 0xe0, 0xce, 0x18, 0xc3, 0x45, 0xd7, 0x0c, 0xe5, 0x7b, 0xad, + 0xb5, 0x6e, 0x23, 0xbe, 0x51, 0x3e, 0xe6, 0x3c, 0x63, 0xae, 0x43, 0xcf, 0x97, 0x60, 0x76, 0x56, + 0x62, 0xda, 0x82, 0x8b, 0x9c, 0xf1, 0x97, 0x35, 0x58, 0x37, 0x9c, 0x48, 0xc0, 0x86, 0x05, 0x45, + 0x7f, 0x75, 0xf9, 0xec, 0x6a, 0x05, 0x77, 0xfe, 0xa1, 0xb0, 0x45, 0xa2, 0xe0, 0xc3, 0xb7, 0x9f, + 0x1f, 0xeb, 0xd7, 0x11, 0x22, 0xa5, 0x2f, 0xe0, 0x50, 0xb0, 0x23, 0x74, 0xec, 0xc1, 0x95, 0x52, + 0x53, 0x50, 0xa7, 0xd2, 0xb0, 0xbc, 0x58, 0x41, 0x77, 0xb5, 0xd0, 0x01, 0x3c, 0x30, 0x00, 0x6d, + 0xb4, 0x79, 0x16, 0x80, 0xb8, 0x3e, 0x92, 0x43, 0x77, 0x73, 0x84, 0x3e, 0x7b, 0xd0, 0xac, 0x1c, + 0x15, 0xda, 0x5e, 0x52, 0x75, 0xd5, 0x6a, 0x05, 0x8f, 0xfe, 0x2f, 0xc9, 0x61, 0xdf, 0x35, 0xd8, + 0xb7, 0xd1, 0xcd, 0x6a, 0x6c, 0xf5, 0x64, 0xe7, 0xeb, 0x34, 0xf4, 0x4e, 0xa6, 0xa1, 0xf7, 0x63, + 0x1a, 0x7a, 0xc7, 0xb3, 0xb0, 0x76, 0x32, 0x0b, 0x6b, 0xdf, 0x67, 0x61, 0xed, 0x6d, 0x27, 0x15, + 0x7a, 0x30, 0xe9, 0xe3, 0x44, 0xee, 0x3b, 0x03, 0x73, 0x7d, 0x98, 0x49, 0xc6, 0xc9, 0x3b, 0xe3, + 0xa6, 0x0f, 0x72, 0xae, 0xfa, 0x1b, 0xe6, 0xd7, 0xb1, 0xfd, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xde, + 0xdf, 0xb1, 0x7a, 0xc9, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -361,9 +423,12 @@ 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 QueryClient interface { - DidDoc(ctx context.Context, in *QueryGetDidDocRequest, opts ...grpc.CallOption) (*QueryGetDidDocResponse, error) - DidDocVersion(ctx context.Context, in *QueryGetDidDocVersionRequest, opts ...grpc.CallOption) (*QueryGetDidDocVersionResponse, error) - AllDidDocVersionsMetadata(ctx context.Context, in *QueryGetAllDidDocVersionsMetadataRequest, opts ...grpc.CallOption) (*QueryGetAllDidDocVersionsMetadataResponse, error) + // Fetch latest version of a DID Document for a given DID + DidDoc(ctx context.Context, in *QueryDidDocRequest, opts ...grpc.CallOption) (*QueryDidDocResponse, error) + // Fetch specific version of a DID Document for a given DID + DidDocVersion(ctx context.Context, in *QueryDidDocVersionRequest, opts ...grpc.CallOption) (*QueryDidDocVersionResponse, error) + // Fetch list of all versions of DID Documents for a given DID + AllDidDocVersionsMetadata(ctx context.Context, in *QueryAllDidDocVersionsMetadataRequest, opts ...grpc.CallOption) (*QueryAllDidDocVersionsMetadataResponse, error) } type queryClient struct { @@ -374,8 +439,8 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) DidDoc(ctx context.Context, in *QueryGetDidDocRequest, opts ...grpc.CallOption) (*QueryGetDidDocResponse, error) { - out := new(QueryGetDidDocResponse) +func (c *queryClient) DidDoc(ctx context.Context, in *QueryDidDocRequest, opts ...grpc.CallOption) (*QueryDidDocResponse, error) { + out := new(QueryDidDocResponse) err := c.cc.Invoke(ctx, "/cheqd.did.v2.Query/DidDoc", in, out, opts...) if err != nil { return nil, err @@ -383,8 +448,8 @@ func (c *queryClient) DidDoc(ctx context.Context, in *QueryGetDidDocRequest, opt return out, nil } -func (c *queryClient) DidDocVersion(ctx context.Context, in *QueryGetDidDocVersionRequest, opts ...grpc.CallOption) (*QueryGetDidDocVersionResponse, error) { - out := new(QueryGetDidDocVersionResponse) +func (c *queryClient) DidDocVersion(ctx context.Context, in *QueryDidDocVersionRequest, opts ...grpc.CallOption) (*QueryDidDocVersionResponse, error) { + out := new(QueryDidDocVersionResponse) err := c.cc.Invoke(ctx, "/cheqd.did.v2.Query/DidDocVersion", in, out, opts...) if err != nil { return nil, err @@ -392,8 +457,8 @@ func (c *queryClient) DidDocVersion(ctx context.Context, in *QueryGetDidDocVersi return out, nil } -func (c *queryClient) AllDidDocVersionsMetadata(ctx context.Context, in *QueryGetAllDidDocVersionsMetadataRequest, opts ...grpc.CallOption) (*QueryGetAllDidDocVersionsMetadataResponse, error) { - out := new(QueryGetAllDidDocVersionsMetadataResponse) +func (c *queryClient) AllDidDocVersionsMetadata(ctx context.Context, in *QueryAllDidDocVersionsMetadataRequest, opts ...grpc.CallOption) (*QueryAllDidDocVersionsMetadataResponse, error) { + out := new(QueryAllDidDocVersionsMetadataResponse) err := c.cc.Invoke(ctx, "/cheqd.did.v2.Query/AllDidDocVersionsMetadata", in, out, opts...) if err != nil { return nil, err @@ -403,22 +468,25 @@ func (c *queryClient) AllDidDocVersionsMetadata(ctx context.Context, in *QueryGe // QueryServer is the server API for Query service. type QueryServer interface { - DidDoc(context.Context, *QueryGetDidDocRequest) (*QueryGetDidDocResponse, error) - DidDocVersion(context.Context, *QueryGetDidDocVersionRequest) (*QueryGetDidDocVersionResponse, error) - AllDidDocVersionsMetadata(context.Context, *QueryGetAllDidDocVersionsMetadataRequest) (*QueryGetAllDidDocVersionsMetadataResponse, error) + // Fetch latest version of a DID Document for a given DID + DidDoc(context.Context, *QueryDidDocRequest) (*QueryDidDocResponse, error) + // Fetch specific version of a DID Document for a given DID + DidDocVersion(context.Context, *QueryDidDocVersionRequest) (*QueryDidDocVersionResponse, error) + // Fetch list of all versions of DID Documents for a given DID + AllDidDocVersionsMetadata(context.Context, *QueryAllDidDocVersionsMetadataRequest) (*QueryAllDidDocVersionsMetadataResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) DidDoc(ctx context.Context, req *QueryGetDidDocRequest) (*QueryGetDidDocResponse, error) { +func (*UnimplementedQueryServer) DidDoc(ctx context.Context, req *QueryDidDocRequest) (*QueryDidDocResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DidDoc not implemented") } -func (*UnimplementedQueryServer) DidDocVersion(ctx context.Context, req *QueryGetDidDocVersionRequest) (*QueryGetDidDocVersionResponse, error) { +func (*UnimplementedQueryServer) DidDocVersion(ctx context.Context, req *QueryDidDocVersionRequest) (*QueryDidDocVersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DidDocVersion not implemented") } -func (*UnimplementedQueryServer) AllDidDocVersionsMetadata(ctx context.Context, req *QueryGetAllDidDocVersionsMetadataRequest) (*QueryGetAllDidDocVersionsMetadataResponse, error) { +func (*UnimplementedQueryServer) AllDidDocVersionsMetadata(ctx context.Context, req *QueryAllDidDocVersionsMetadataRequest) (*QueryAllDidDocVersionsMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllDidDocVersionsMetadata not implemented") } @@ -427,7 +495,7 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { } func _Query_DidDoc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetDidDocRequest) + in := new(QueryDidDocRequest) if err := dec(in); err != nil { return nil, err } @@ -439,13 +507,13 @@ func _Query_DidDoc_Handler(srv interface{}, ctx context.Context, dec func(interf FullMethod: "/cheqd.did.v2.Query/DidDoc", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DidDoc(ctx, req.(*QueryGetDidDocRequest)) + return srv.(QueryServer).DidDoc(ctx, req.(*QueryDidDocRequest)) } return interceptor(ctx, in, info, handler) } func _Query_DidDocVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetDidDocVersionRequest) + in := new(QueryDidDocVersionRequest) if err := dec(in); err != nil { return nil, err } @@ -457,13 +525,13 @@ func _Query_DidDocVersion_Handler(srv interface{}, ctx context.Context, dec func FullMethod: "/cheqd.did.v2.Query/DidDocVersion", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DidDocVersion(ctx, req.(*QueryGetDidDocVersionRequest)) + return srv.(QueryServer).DidDocVersion(ctx, req.(*QueryDidDocVersionRequest)) } return interceptor(ctx, in, info, handler) } func _Query_AllDidDocVersionsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetAllDidDocVersionsMetadataRequest) + in := new(QueryAllDidDocVersionsMetadataRequest) if err := dec(in); err != nil { return nil, err } @@ -475,7 +543,7 @@ func _Query_AllDidDocVersionsMetadata_Handler(srv interface{}, ctx context.Conte FullMethod: "/cheqd.did.v2.Query/AllDidDocVersionsMetadata", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllDidDocVersionsMetadata(ctx, req.(*QueryGetAllDidDocVersionsMetadataRequest)) + return srv.(QueryServer).AllDidDocVersionsMetadata(ctx, req.(*QueryAllDidDocVersionsMetadataRequest)) } return interceptor(ctx, in, info, handler) } @@ -501,7 +569,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "cheqd/did/v2/query.proto", } -func (m *QueryGetDidDocRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryDidDocRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -511,12 +579,12 @@ func (m *QueryGetDidDocRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetDidDocRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDidDocRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetDidDocRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDidDocRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -531,7 +599,7 @@ func (m *QueryGetDidDocRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryGetDidDocResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryDidDocResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -541,12 +609,12 @@ func (m *QueryGetDidDocResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetDidDocResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDidDocResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetDidDocResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDidDocResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -566,7 +634,7 @@ func (m *QueryGetDidDocResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryGetDidDocVersionRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryDidDocVersionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -576,12 +644,12 @@ func (m *QueryGetDidDocVersionRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetDidDocVersionRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDidDocVersionRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetDidDocVersionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDidDocVersionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -603,7 +671,7 @@ func (m *QueryGetDidDocVersionRequest) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *QueryGetDidDocVersionResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryDidDocVersionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -613,12 +681,12 @@ func (m *QueryGetDidDocVersionResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetDidDocVersionResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDidDocVersionResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetDidDocVersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDidDocVersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -638,7 +706,7 @@ func (m *QueryGetDidDocVersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryGetAllDidDocVersionsMetadataRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllDidDocVersionsMetadataRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -648,16 +716,28 @@ func (m *QueryGetAllDidDocVersionsMetadataRequest) Marshal() (dAtA []byte, err e return dAtA[:n], nil } -func (m *QueryGetAllDidDocVersionsMetadataRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllDidDocVersionsMetadataRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetAllDidDocVersionsMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllDidDocVersionsMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) @@ -668,7 +748,7 @@ func (m *QueryGetAllDidDocVersionsMetadataRequest) MarshalToSizedBuffer(dAtA []b return len(dAtA) - i, nil } -func (m *QueryGetAllDidDocVersionsMetadataResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllDidDocVersionsMetadataResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -678,16 +758,28 @@ func (m *QueryGetAllDidDocVersionsMetadataResponse) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *QueryGetAllDidDocVersionsMetadataResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllDidDocVersionsMetadataResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetAllDidDocVersionsMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllDidDocVersionsMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } if len(m.Versions) > 0 { for iNdEx := len(m.Versions) - 1; iNdEx >= 0; iNdEx-- { { @@ -716,7 +808,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryGetDidDocRequest) Size() (n int) { +func (m *QueryDidDocRequest) Size() (n int) { if m == nil { return 0 } @@ -729,7 +821,7 @@ func (m *QueryGetDidDocRequest) Size() (n int) { return n } -func (m *QueryGetDidDocResponse) Size() (n int) { +func (m *QueryDidDocResponse) Size() (n int) { if m == nil { return 0 } @@ -742,7 +834,7 @@ func (m *QueryGetDidDocResponse) Size() (n int) { return n } -func (m *QueryGetDidDocVersionRequest) Size() (n int) { +func (m *QueryDidDocVersionRequest) Size() (n int) { if m == nil { return 0 } @@ -759,7 +851,7 @@ func (m *QueryGetDidDocVersionRequest) Size() (n int) { return n } -func (m *QueryGetDidDocVersionResponse) Size() (n int) { +func (m *QueryDidDocVersionResponse) Size() (n int) { if m == nil { return 0 } @@ -772,7 +864,7 @@ func (m *QueryGetDidDocVersionResponse) Size() (n int) { return n } -func (m *QueryGetAllDidDocVersionsMetadataRequest) Size() (n int) { +func (m *QueryAllDidDocVersionsMetadataRequest) Size() (n int) { if m == nil { return 0 } @@ -782,10 +874,14 @@ func (m *QueryGetAllDidDocVersionsMetadataRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } -func (m *QueryGetAllDidDocVersionsMetadataResponse) Size() (n int) { +func (m *QueryAllDidDocVersionsMetadataResponse) Size() (n int) { if m == nil { return 0 } @@ -797,6 +893,10 @@ func (m *QueryGetAllDidDocVersionsMetadataResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -806,7 +906,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryGetDidDocRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDidDocRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -829,10 +929,10 @@ func (m *QueryGetDidDocRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetDidDocRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDidDocRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetDidDocRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDidDocRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -888,7 +988,7 @@ func (m *QueryGetDidDocRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetDidDocResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDidDocResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -911,10 +1011,10 @@ func (m *QueryGetDidDocResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetDidDocResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDidDocResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetDidDocResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDidDocResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -974,7 +1074,7 @@ func (m *QueryGetDidDocResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetDidDocVersionRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDidDocVersionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -997,10 +1097,10 @@ func (m *QueryGetDidDocVersionRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetDidDocVersionRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDidDocVersionRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetDidDocVersionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDidDocVersionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1088,7 +1188,7 @@ func (m *QueryGetDidDocVersionRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetDidDocVersionResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDidDocVersionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1111,10 +1211,10 @@ func (m *QueryGetDidDocVersionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetDidDocVersionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDidDocVersionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetDidDocVersionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDidDocVersionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1174,7 +1274,7 @@ func (m *QueryGetDidDocVersionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetAllDidDocVersionsMetadataRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllDidDocVersionsMetadataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1197,10 +1297,10 @@ func (m *QueryGetAllDidDocVersionsMetadataRequest) Unmarshal(dAtA []byte) error fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetAllDidDocVersionsMetadataRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllDidDocVersionsMetadataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetAllDidDocVersionsMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllDidDocVersionsMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1235,6 +1335,42 @@ func (m *QueryGetAllDidDocVersionsMetadataRequest) Unmarshal(dAtA []byte) error } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1256,7 +1392,7 @@ func (m *QueryGetAllDidDocVersionsMetadataRequest) Unmarshal(dAtA []byte) error } return nil } -func (m *QueryGetAllDidDocVersionsMetadataResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllDidDocVersionsMetadataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1279,10 +1415,10 @@ func (m *QueryGetAllDidDocVersionsMetadataResponse) Unmarshal(dAtA []byte) error fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetAllDidDocVersionsMetadataResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllDidDocVersionsMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetAllDidDocVersionsMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllDidDocVersionsMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1319,6 +1455,42 @@ func (m *QueryGetAllDidDocVersionsMetadataResponse) Unmarshal(dAtA []byte) error return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/did/types/query.pb.gw.go b/x/did/types/query.pb.gw.go index ba61196e1..03422b091 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -34,7 +34,7 @@ var _ = descriptor.ForMessage var _ = metadata.Join func request_Query_DidDoc_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetDidDocRequest + var protoReq QueryDidDocRequest var metadata runtime.ServerMetadata var ( @@ -61,7 +61,7 @@ func request_Query_DidDoc_0(ctx context.Context, marshaler runtime.Marshaler, cl } func local_request_Query_DidDoc_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetDidDocRequest + var protoReq QueryDidDocRequest var metadata runtime.ServerMetadata var ( @@ -88,7 +88,7 @@ func local_request_Query_DidDoc_0(ctx context.Context, marshaler runtime.Marshal } func request_Query_DidDocVersion_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetDidDocVersionRequest + var protoReq QueryDidDocVersionRequest var metadata runtime.ServerMetadata var ( @@ -126,7 +126,7 @@ func request_Query_DidDocVersion_0(ctx context.Context, marshaler runtime.Marsha } func local_request_Query_DidDocVersion_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetDidDocVersionRequest + var protoReq QueryDidDocVersionRequest var metadata runtime.ServerMetadata var ( @@ -163,8 +163,12 @@ func local_request_Query_DidDocVersion_0(ctx context.Context, marshaler runtime. } +var ( + filter_Query_AllDidDocVersionsMetadata_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_Query_AllDidDocVersionsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetAllDidDocVersionsMetadataRequest + var protoReq QueryAllDidDocVersionsMetadataRequest var metadata runtime.ServerMetadata var ( @@ -185,13 +189,20 @@ func request_Query_AllDidDocVersionsMetadata_0(ctx context.Context, marshaler ru return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllDidDocVersionsMetadata_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.AllDidDocVersionsMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } func local_request_Query_AllDidDocVersionsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetAllDidDocVersionsMetadataRequest + var protoReq QueryAllDidDocVersionsMetadataRequest var metadata runtime.ServerMetadata var ( @@ -212,6 +223,13 @@ func local_request_Query_AllDidDocVersionsMetadata_0(ctx context.Context, marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllDidDocVersionsMetadata_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.AllDidDocVersionsMetadata(ctx, &protoReq) return msg, metadata, err @@ -401,7 +419,7 @@ var ( pattern_Query_DidDocVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"cheqd", "did", "v2", "id", "version"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AllDidDocVersionsMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"cheqd", "did", "v2", "id", "metadata"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AllDidDocVersionsMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"cheqd", "did", "v2", "id", "versions"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/did/types/query_get_all_diddoc_versions_metadata_request.go b/x/did/types/query_get_all_diddoc_versions_metadata_request.go index 296d0cfe1..4cbe5128e 100644 --- a/x/did/types/query_get_all_diddoc_versions_metadata_request.go +++ b/x/did/types/query_get_all_diddoc_versions_metadata_request.go @@ -4,6 +4,6 @@ import ( "github.com/cheqd/cheqd-node/x/did/utils" ) -func (query *QueryGetAllDidDocVersionsMetadataRequest) Normalize() { +func (query *QueryAllDidDocVersionsMetadataRequest) Normalize() { query.Id = utils.NormalizeDID(query.Id) } diff --git a/x/did/types/query_get_diddoc_request.go b/x/did/types/query_get_diddoc_request.go index b7cd64d21..0f9081e93 100644 --- a/x/did/types/query_get_diddoc_request.go +++ b/x/did/types/query_get_diddoc_request.go @@ -4,6 +4,6 @@ import ( "github.com/cheqd/cheqd-node/x/did/utils" ) -func (query *QueryGetDidDocRequest) Normalize() { +func (query *QueryDidDocRequest) Normalize() { query.Id = utils.NormalizeDID(query.Id) } diff --git a/x/did/types/query_get_diddoc_version_request.go b/x/did/types/query_get_diddoc_version_request.go index a4cda1b55..62acfd2c7 100644 --- a/x/did/types/query_get_diddoc_version_request.go +++ b/x/did/types/query_get_diddoc_version_request.go @@ -4,7 +4,7 @@ import ( "github.com/cheqd/cheqd-node/x/did/utils" ) -func (query *QueryGetDidDocVersionRequest) Normalize() { +func (query *QueryDidDocVersionRequest) Normalize() { query.Id = utils.NormalizeDID(query.Id) query.Version = utils.NormalizeUUID(query.Version) } diff --git a/x/did/types/tx.pb.go b/x/did/types/tx.pb.go index 82b3603df..7cdb2af1f 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -27,9 +27,13 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MsgCreateDidDoc defines the Msg/CreateDidDoc request type. +// It describes the parameters of a request for creating a new DID document. type MsgCreateDidDoc struct { - Payload *MsgCreateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` + // Payload containing the DID Document to be created + Payload *MsgCreateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Signatures of the DID Document's controller(s) + Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` } func (m *MsgCreateDidDoc) Reset() { *m = MsgCreateDidDoc{} } @@ -79,9 +83,13 @@ func (m *MsgCreateDidDoc) GetSignatures() []*SignInfo { return nil } +// MsgUpdateDidDoc defines the Msg/UpdateDidDoc request type. +// It describes the parameters of a request for updating an existing DID document. type MsgUpdateDidDoc struct { - Payload *MsgUpdateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` + // Payload containing the DID Document to be updated. This should be updated the DID Document. + Payload *MsgUpdateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Signatures of the DID Document's controller(s) + Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` } func (m *MsgUpdateDidDoc) Reset() { *m = MsgUpdateDidDoc{} } @@ -131,9 +139,13 @@ func (m *MsgUpdateDidDoc) GetSignatures() []*SignInfo { return nil } +// MsgDeactivateDidDoc defines the Msg/DeactivateDidDoc request type. +// It describes the parameters of a request for deactivating an existing DID document. type MsgDeactivateDidDoc struct { - Payload *MsgDeactivateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` + // Payload containing the DID Document to be deactivated + Payload *MsgDeactivateDidDocPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Signatures of the DID Document's controller(s) + Signatures []*SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` } func (m *MsgDeactivateDidDoc) Reset() { *m = MsgDeactivateDidDoc{} } @@ -183,9 +195,12 @@ func (m *MsgDeactivateDidDoc) GetSignatures() []*SignInfo { return nil } +// SignInfo defines the structure of a DID Document controller's signature type SignInfo struct { + // Verification method ID of the DID Controller VerificationMethodId string `protobuf:"bytes,1,opt,name=verification_method_id,json=verificationMethodId,proto3" json:"verification_method_id,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // Signature of the DID Document controller + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` } func (m *SignInfo) Reset() { *m = SignInfo{} } @@ -235,19 +250,55 @@ func (m *SignInfo) GetSignature() []byte { return nil } +// MsgCreateDidDocPayload defines the structure of the payload for creating a new DID document type MsgCreateDidDocPayload struct { - Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` - VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` - Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` - AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` - CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` - CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` - KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` - AlsoKnownAs []string `protobuf:"bytes,10,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` - Service []*Service `protobuf:"bytes,11,rep,name=service,proto3" json:"service,omitempty"` - VersionId string `protobuf:"bytes,12,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 + Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` + // id is the DID of the DID document. + // Format: did:cheqd:: + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // controller is a list of DIDs that are allowed to control the DID document. + Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. + // Documentation: https://www.w3.org/TR/did-core/#verification-methods + // + // Required fields: + // - id: A unique identifier for the verification method + // - type: A supported verification method type (supported: Ed25519VerificationKey2018, Ed25519VerificationKey2020, JsonWebKey2020) + // - controller: DID of the controller of the verification method + // - verification_material: Public key of the verification method (supported: publicJwk, publicKeyBase58, publicKeyMultibase) + VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. + Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. + AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. + CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. + CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. + KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` + // service is a list of services that can be used to interact with the DID subject. + // Documentation: https://www.w3.org/TR/did-core/#services + // + // Required fields: + // - id: A unique identifier for the service + // - type: A service type defined in DID Specification Registries + // - service_endpoint: Service endpoint(s), provided as a URI or set of URIs + Service []*Service `protobuf:"bytes,10,rep,name=service,proto3" json:"service,omitempty"` + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. + AlsoKnownAs []string `protobuf:"bytes,11,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` + // Version ID of the DID Document to be created + // + // Format: + VersionId string `protobuf:"bytes,12,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` } func (m *MsgCreateDidDocPayload) Reset() { *m = MsgCreateDidDocPayload{} } @@ -346,16 +397,16 @@ func (m *MsgCreateDidDocPayload) GetKeyAgreement() []string { return nil } -func (m *MsgCreateDidDocPayload) GetAlsoKnownAs() []string { +func (m *MsgCreateDidDocPayload) GetService() []*Service { if m != nil { - return m.AlsoKnownAs + return m.Service } return nil } -func (m *MsgCreateDidDocPayload) GetService() []*Service { +func (m *MsgCreateDidDocPayload) GetAlsoKnownAs() []string { if m != nil { - return m.Service + return m.AlsoKnownAs } return nil } @@ -367,7 +418,9 @@ func (m *MsgCreateDidDocPayload) GetVersionId() string { return "" } +// MsgCreateDidDocResponse defines response type for Msg/CreateDidDoc. type MsgCreateDidDocResponse struct { + // Return the created DID Document with metadata Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } @@ -411,19 +464,56 @@ func (m *MsgCreateDidDocResponse) GetValue() *DidDocWithMetadata { return nil } +// MsgUpdateDidDocPayload defines the structure of the payload for updating an existing DID document type MsgUpdateDidDocPayload struct { - Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` - VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` - Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` - AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` - CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` - CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` - KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` - AlsoKnownAs []string `protobuf:"bytes,10,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` - Service []*Service `protobuf:"bytes,11,rep,name=service,proto3" json:"service,omitempty"` - VersionId string `protobuf:"bytes,12,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` + // context is a list of URIs used to identify the context of the DID document. + // Default: https://www.w3.org/ns/did/v1 + Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"` + // id is the DID of the DID document. + // Format: did:cheqd:: + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // controller is a list of DIDs that are allowed to control the DID document. + Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"` + // verificationMethod is a list of verification methods that can be used to + // verify a digital signature or cryptographic proof. + // Documentation: https://www.w3.org/TR/did-core/#verification-methods + // + // Required fields: + // - id: A unique identifier for the verification method + // - type: A supported verification method type (supported: Ed25519VerificationKey2018, Ed25519VerificationKey2020, JsonWebKey2020) + // - controller: DID of the controller of the verification method + // - verification_material: Public key of the verification method (supported: publicJwk, publicKeyBase58, publicKeyMultibase) + VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` + // authentication is a list of verification methods that can be used to + // authenticate as the DID subject. + Authentication []string `protobuf:"bytes,5,rep,name=authentication,proto3" json:"authentication,omitempty"` + // assertionMethod is a list of verification methods that can be used to + // assert statements as the DID subject. + AssertionMethod []string `protobuf:"bytes,6,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + // capabilityInvocation is a list of verification methods that can be used to + // invoke capabilities as the DID subject. + CapabilityInvocation []string `protobuf:"bytes,7,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + // capabilityDelegation is a list of verification methods that can be used to + // delegate capabilities as the DID subject. + CapabilityDelegation []string `protobuf:"bytes,8,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + // keyAgreement is a list of verification methods that can be used to perform + // key agreement as the DID subject. + KeyAgreement []string `protobuf:"bytes,9,rep,name=key_agreement,json=keyAgreement,proto3" json:"key_agreement,omitempty"` + // service is a list of services that can be used to interact with the DID subject. + // Documentation: https://www.w3.org/TR/did-core/#services + // + // Required fields: + // - id: A unique identifier for the service + // - type: A service type defined in DID Specification Registries + // - service_endpoint: Service endpoint(s), provided as a URI or set of URIs + Service []*Service `protobuf:"bytes,10,rep,name=service,proto3" json:"service,omitempty"` + // alsoKnownAs is a list of DIDs that are known to refer to the same DID subject. + AlsoKnownAs []string `protobuf:"bytes,11,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` + // Updated version ID of the DID Document. + // Links to next/previous versions of the DID Document will be automatically updated. + // + // Format: + VersionId string `protobuf:"bytes,12,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` } func (m *MsgUpdateDidDocPayload) Reset() { *m = MsgUpdateDidDocPayload{} } @@ -522,16 +612,16 @@ func (m *MsgUpdateDidDocPayload) GetKeyAgreement() []string { return nil } -func (m *MsgUpdateDidDocPayload) GetAlsoKnownAs() []string { +func (m *MsgUpdateDidDocPayload) GetService() []*Service { if m != nil { - return m.AlsoKnownAs + return m.Service } return nil } -func (m *MsgUpdateDidDocPayload) GetService() []*Service { +func (m *MsgUpdateDidDocPayload) GetAlsoKnownAs() []string { if m != nil { - return m.Service + return m.AlsoKnownAs } return nil } @@ -544,6 +634,7 @@ func (m *MsgUpdateDidDocPayload) GetVersionId() string { } type MsgUpdateDidDocResponse struct { + // Return the updated DID Document with metadata Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } @@ -587,8 +678,12 @@ func (m *MsgUpdateDidDocResponse) GetValue() *DidDocWithMetadata { return nil } +// MsgDeactivateDidDocPayload defines the structure of the payload for deactivating an existing DID document type MsgDeactivateDidDocPayload struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique identifier of the DID Document to be deactivated + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Version ID of the DID Document to be deactivated + // This is primarily used as a sanity check to ensure that the correct DID Document is being deactivated. VersionId string `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` } @@ -639,7 +734,9 @@ func (m *MsgDeactivateDidDocPayload) GetVersionId() string { return "" } +// MsgDeactivateDidDocResponse defines response type for Msg/DeactivateDidDoc. type MsgDeactivateDidDocResponse struct { + // Return the deactivated DID Document with metadata Value *DidDocWithMetadata `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } @@ -726,23 +823,23 @@ var fileDescriptor_0e353aae8dd04717 = []byte{ 0xb9, 0x09, 0xab, 0x36, 0xed, 0xd0, 0x43, 0xde, 0xe6, 0xaa, 0xd7, 0xe4, 0xae, 0x2f, 0x06, 0xca, 0x29, 0xcd, 0x5f, 0xb9, 0x2c, 0xd6, 0x87, 0xb5, 0x58, 0x13, 0xc3, 0x36, 0x3a, 0x41, 0xd3, 0x5c, 0xbc, 0xa9, 0x36, 0xac, 0x91, 0x87, 0x30, 0x7f, 0x8c, 0xbd, 0x26, 0x75, 0x3c, 0xc4, 0x13, 0x74, - 0x95, 0x99, 0xd6, 0xe4, 0xec, 0x31, 0xf6, 0xb6, 0x43, 0x8c, 0x14, 0x61, 0x9e, 0xb6, 0xa5, 0x68, - 0x1e, 0xbb, 0xe2, 0x93, 0xdb, 0xa4, 0xd2, 0x04, 0x4d, 0xca, 0xf4, 0xc1, 0xdd, 0x3e, 0xb6, 0x2d, - 0x49, 0x05, 0x52, 0x12, 0x3d, 0x9f, 0xdb, 0x68, 0x66, 0xf4, 0x66, 0xae, 0xc6, 0x22, 0x15, 0x14, - 0xad, 0x90, 0x45, 0xd6, 0x01, 0x7c, 0xf4, 0x64, 0x7f, 0x33, 0x38, 0x33, 0xb3, 0xfa, 0x04, 0xd3, - 0x03, 0xa4, 0xce, 0x8a, 0x7b, 0x70, 0x27, 0x16, 0x06, 0x0b, 0x65, 0x47, 0xb8, 0x12, 0xc9, 0x16, - 0xcc, 0xf8, 0xb4, 0xdd, 0xc5, 0xc1, 0x2b, 0x10, 0x3b, 0xb5, 0x80, 0xfc, 0x96, 0xab, 0x56, 0x03, - 0x15, 0x65, 0x54, 0x51, 0x2b, 0xa0, 0x87, 0x01, 0x9b, 0xf0, 0xc2, 0xfe, 0x0f, 0xd8, 0xbf, 0x1a, - 0xb0, 0x68, 0x18, 0x6e, 0x1c, 0xb0, 0x5d, 0xc8, 0xfd, 0xf9, 0x03, 0x3c, 0x48, 0x92, 0x31, 0x4c, - 0xd2, 0xa8, 0xbf, 0x44, 0xdc, 0xdf, 0x01, 0xdc, 0x9b, 0x20, 0x76, 0x53, 0x8f, 0xd5, 0xef, 0x09, - 0x48, 0x36, 0xa4, 0x43, 0xf6, 0x21, 0x3b, 0x32, 0x75, 0xd7, 0xaf, 0x1c, 0xb2, 0xb9, 0xc7, 0x57, - 0x96, 0x87, 0xae, 0xf6, 0x21, 0x3b, 0x32, 0x3f, 0xd7, 0xaf, 0x1c, 0x97, 0x13, 0x54, 0x27, 0x9e, - 0xc7, 0x07, 0x58, 0x1a, 0x9b, 0x84, 0x0f, 0xae, 0x1d, 0x7c, 0xb9, 0x8d, 0x6b, 0x29, 0xe1, 0x0a, - 0x3b, 0xdb, 0x3f, 0xce, 0xf3, 0xc6, 0xd9, 0x79, 0xde, 0xf8, 0x75, 0x9e, 0x37, 0xbe, 0x5e, 0xe4, - 0xa7, 0xce, 0x2e, 0xf2, 0x53, 0x3f, 0x2f, 0xf2, 0x53, 0xef, 0x9e, 0x3a, 0x5c, 0xb5, 0xba, 0x87, - 0x65, 0x5b, 0x9c, 0x54, 0x82, 0x7b, 0x8c, 0xfe, 0x7d, 0xe6, 0x0a, 0x86, 0x95, 0x53, 0x7d, 0xa9, - 0x51, 0xbd, 0x0e, 0xca, 0xc3, 0x59, 0x7d, 0xa3, 0xd9, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xde, - 0xf1, 0xc0, 0x25, 0x13, 0x09, 0x00, 0x00, + 0x95, 0x99, 0xd6, 0xe4, 0xec, 0x31, 0xf6, 0xb6, 0x43, 0x8c, 0x54, 0x20, 0x25, 0xd1, 0xf3, 0xb9, + 0x8d, 0x26, 0xe8, 0x8d, 0x5a, 0x8d, 0xc5, 0x25, 0x28, 0x5a, 0x21, 0x8b, 0x14, 0x61, 0x9e, 0xb6, + 0xa5, 0x68, 0x1e, 0xbb, 0xe2, 0x93, 0xdb, 0xa4, 0xd2, 0xcc, 0x68, 0xd5, 0x4c, 0x1f, 0xdc, 0xed, + 0x63, 0xdb, 0x92, 0xac, 0x03, 0xf8, 0xe8, 0xc9, 0xfe, 0x66, 0x70, 0x66, 0x66, 0xf5, 0x09, 0xa6, + 0x07, 0x48, 0x9d, 0x15, 0xf7, 0xe0, 0x4e, 0x2c, 0x0c, 0x16, 0xca, 0x8e, 0x70, 0x25, 0x92, 0x2d, + 0x98, 0xf1, 0x69, 0xbb, 0x8b, 0x83, 0x57, 0x20, 0x76, 0x6a, 0x01, 0xf9, 0x2d, 0x57, 0xad, 0x06, + 0x2a, 0xca, 0xa8, 0xa2, 0x56, 0x40, 0x0f, 0x03, 0x36, 0xe1, 0x85, 0xfd, 0x1f, 0xb0, 0x7f, 0x35, + 0x60, 0xd1, 0x30, 0xdc, 0x38, 0x60, 0xbb, 0x90, 0xfb, 0xf3, 0x07, 0x78, 0x90, 0x24, 0x63, 0x98, + 0xa4, 0x51, 0x7f, 0x89, 0xb8, 0xbf, 0x03, 0xb8, 0x37, 0x41, 0xec, 0xa6, 0x1e, 0xab, 0xdf, 0x13, + 0x90, 0x6c, 0x48, 0x87, 0xec, 0x43, 0x76, 0x64, 0xea, 0xae, 0x5f, 0x39, 0x64, 0x73, 0x8f, 0xaf, + 0x2c, 0x0f, 0x5d, 0xed, 0x43, 0x76, 0x64, 0x7e, 0xae, 0x5f, 0x39, 0x2e, 0x27, 0xa8, 0x4e, 0x3c, + 0x8f, 0x0f, 0xb0, 0x34, 0x36, 0x09, 0x1f, 0x5c, 0x3b, 0xf8, 0x72, 0x1b, 0xd7, 0x52, 0xc2, 0x15, + 0x76, 0xb6, 0x7f, 0x9c, 0xe7, 0x8d, 0xb3, 0xf3, 0xbc, 0xf1, 0xeb, 0x3c, 0x6f, 0x7c, 0xbd, 0xc8, + 0x4f, 0x9d, 0x5d, 0xe4, 0xa7, 0x7e, 0x5e, 0xe4, 0xa7, 0xde, 0x3d, 0x75, 0xb8, 0x6a, 0x75, 0x0f, + 0xcb, 0xb6, 0x38, 0xa9, 0x04, 0xf7, 0x18, 0xfd, 0xfb, 0xcc, 0x15, 0x0c, 0x2b, 0xa7, 0xfa, 0x52, + 0xa3, 0x7a, 0x1d, 0x94, 0x87, 0xb3, 0xfa, 0x46, 0xb3, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x41, + 0xe4, 0x38, 0xd8, 0x13, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -757,8 +854,11 @@ 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 { + // CreateDidDoc defines a method for creating a new DID document CreateDidDoc(ctx context.Context, in *MsgCreateDidDoc, opts ...grpc.CallOption) (*MsgCreateDidDocResponse, error) + // UpdateDidDoc defines a method for updating an existing DID document UpdateDidDoc(ctx context.Context, in *MsgUpdateDidDoc, opts ...grpc.CallOption) (*MsgUpdateDidDocResponse, error) + // DeactivateDidDoc defines a method for deactivating an existing DID document DeactivateDidDoc(ctx context.Context, in *MsgDeactivateDidDoc, opts ...grpc.CallOption) (*MsgDeactivateDidDocResponse, error) } @@ -799,8 +899,11 @@ func (c *msgClient) DeactivateDidDoc(ctx context.Context, in *MsgDeactivateDidDo // MsgServer is the server API for Msg service. type MsgServer interface { + // CreateDidDoc defines a method for creating a new DID document CreateDidDoc(context.Context, *MsgCreateDidDoc) (*MsgCreateDidDocResponse, error) + // UpdateDidDoc defines a method for updating an existing DID document UpdateDidDoc(context.Context, *MsgUpdateDidDoc) (*MsgUpdateDidDocResponse, error) + // DeactivateDidDoc defines a method for deactivating an existing DID document DeactivateDidDoc(context.Context, *MsgDeactivateDidDoc) (*MsgDeactivateDidDocResponse, error) } @@ -1108,6 +1211,15 @@ func (m *MsgCreateDidDocPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x62 } + if len(m.AlsoKnownAs) > 0 { + for iNdEx := len(m.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AlsoKnownAs[iNdEx]) + copy(dAtA[i:], m.AlsoKnownAs[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.AlsoKnownAs[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } if len(m.Service) > 0 { for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { { @@ -1119,15 +1231,6 @@ func (m *MsgCreateDidDocPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x5a - } - } - if len(m.AlsoKnownAs) > 0 { - for iNdEx := len(m.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AlsoKnownAs[iNdEx]) - copy(dAtA[i:], m.AlsoKnownAs[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.AlsoKnownAs[iNdEx]))) - i-- dAtA[i] = 0x52 } } @@ -1280,6 +1383,15 @@ func (m *MsgUpdateDidDocPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x62 } + if len(m.AlsoKnownAs) > 0 { + for iNdEx := len(m.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AlsoKnownAs[iNdEx]) + copy(dAtA[i:], m.AlsoKnownAs[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.AlsoKnownAs[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } if len(m.Service) > 0 { for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { { @@ -1291,15 +1403,6 @@ func (m *MsgUpdateDidDocPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x5a - } - } - if len(m.AlsoKnownAs) > 0 { - for iNdEx := len(m.AlsoKnownAs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AlsoKnownAs[iNdEx]) - copy(dAtA[i:], m.AlsoKnownAs[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.AlsoKnownAs[iNdEx]))) - i-- dAtA[i] = 0x52 } } @@ -1640,18 +1743,18 @@ func (m *MsgCreateDidDocPayload) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } - if len(m.AlsoKnownAs) > 0 { - for _, s := range m.AlsoKnownAs { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } if len(m.Service) > 0 { for _, e := range m.Service { l = e.Size() n += 1 + l + sovTx(uint64(l)) } } + if len(m.AlsoKnownAs) > 0 { + for _, s := range m.AlsoKnownAs { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } l = len(m.VersionId) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -1730,18 +1833,18 @@ func (m *MsgUpdateDidDocPayload) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } - if len(m.AlsoKnownAs) > 0 { - for _, s := range m.AlsoKnownAs { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } if len(m.Service) > 0 { for _, e := range m.Service { l = e.Size() n += 1 + l + sovTx(uint64(l)) } } + if len(m.AlsoKnownAs) > 0 { + for _, s := range m.AlsoKnownAs { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } l = len(m.VersionId) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2595,9 +2698,9 @@ func (m *MsgCreateDidDocPayload) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AlsoKnownAs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2607,29 +2710,31 @@ func (m *MsgCreateDidDocPayload) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.AlsoKnownAs = append(m.AlsoKnownAs, string(dAtA[iNdEx:postIndex])) + m.Service = append(m.Service, &Service{}) + if err := m.Service[len(m.Service)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AlsoKnownAs", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2639,25 +2744,23 @@ func (m *MsgCreateDidDocPayload) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Service = append(m.Service, &Service{}) - if err := m.Service[len(m.Service)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AlsoKnownAs = append(m.AlsoKnownAs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 12: if wireType != 2 { @@ -3119,9 +3222,9 @@ func (m *MsgUpdateDidDocPayload) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AlsoKnownAs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3131,29 +3234,31 @@ func (m *MsgUpdateDidDocPayload) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.AlsoKnownAs = append(m.AlsoKnownAs, string(dAtA[iNdEx:postIndex])) + m.Service = append(m.Service, &Service{}) + if err := m.Service[len(m.Service)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AlsoKnownAs", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3163,25 +3268,23 @@ func (m *MsgUpdateDidDocPayload) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Service = append(m.Service, &Service{}) - if err := m.Service[len(m.Service)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AlsoKnownAs = append(m.AlsoKnownAs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 12: if wireType != 2 { diff --git a/x/did/types/tx_msg_create_diddoc.go b/x/did/types/tx_msg_create_diddoc.go index be01a7d57..7677dd223 100644 --- a/x/did/types/tx_msg_create_diddoc.go +++ b/x/did/types/tx_msg_create_diddoc.go @@ -45,7 +45,7 @@ func (msg *MsgCreateDidDoc) ValidateBasic() error { func (msg MsgCreateDidDoc) Validate(allowedNamespaces []string) error { return validation.ValidateStruct(&msg, validation.Field(&msg.Payload, validation.Required, ValidMsgCreateDidPayloadRule(allowedNamespaces)), - validation.Field(&msg.Signatures, IsUniqueSignInfoListByIdRule(), validation.Each(ValidSignInfoRule(allowedNamespaces))), + validation.Field(&msg.Signatures, IsUniqueSignInfoListByIDRule(), validation.Each(ValidSignInfoRule(allowedNamespaces))), ) } diff --git a/x/did/types/tx_msg_create_diddoc_payload_test.go b/x/did/types/tx_msg_create_diddoc_payload_test.go index cd5a03362..63321e513 100644 --- a/x/did/types/tx_msg_create_diddoc_payload_test.go +++ b/x/did/types/tx_msg_create_diddoc_payload_test.go @@ -8,30 +8,30 @@ import ( var _ = Describe("Create DID Payload Validation tests", func() { type TestCaseUUIDDidStruct struct { - inputId string - expectedId string + inputID string + expectedID string } DescribeTable("UUID validation tests", func(testCase TestCaseUUIDDidStruct) { inputMsg := MsgCreateDidDocPayload{ - Id: testCase.inputId, - Authentication: []string{testCase.inputId + "#key1"}, + Id: testCase.inputID, + Authentication: []string{testCase.inputID + "#key1"}, VerificationMethod: []*VerificationMethod{ { - Id: testCase.inputId + "#key1", - Type: Ed25519VerificationKey2020{}.Type(), - Controller: testCase.inputId, + Id: testCase.inputID + "#key1", + VerificationMethodType: Ed25519VerificationKey2020Type, + Controller: testCase.inputID, }, }, } expectedMsg := MsgCreateDidDocPayload{ - Id: testCase.expectedId, - Authentication: []string{testCase.expectedId + "#key1"}, + Id: testCase.expectedID, + Authentication: []string{testCase.expectedID + "#key1"}, VerificationMethod: []*VerificationMethod{ { - Id: testCase.expectedId + "#key1", - Type: Ed25519VerificationKey2020{}.Type(), - Controller: testCase.expectedId, + Id: testCase.expectedID + "#key1", + VerificationMethodType: Ed25519VerificationKey2020Type, + Controller: testCase.expectedID, }, }, } @@ -42,29 +42,29 @@ var _ = Describe("Create DID Payload Validation tests", func() { Entry( "base58 identifier - not changed", TestCaseUUIDDidStruct{ - inputId: "did:cheqd:testnet:zABCDEFG123456789abcd", - expectedId: "did:cheqd:testnet:zABCDEFG123456789abcd", + inputID: "did:cheqd:testnet:zABCDEFG123456789abcd", + expectedID: "did:cheqd:testnet:zABCDEFG123456789abcd", }), Entry( "Mixed case UUID", TestCaseUUIDDidStruct{ - inputId: "did:cheqd:testnet:BAbbba14-f294-458a-9b9c-474d188680fd", - expectedId: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", + inputID: "did:cheqd:testnet:BAbbba14-f294-458a-9b9c-474d188680fd", + expectedID: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", }), Entry( "Low case UUID", TestCaseUUIDDidStruct{ - inputId: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", - expectedId: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", + inputID: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", + expectedID: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", }), Entry( "Upper case UUID", TestCaseUUIDDidStruct{ - inputId: "did:cheqd:testnet:A86F9CAE-0902-4a7c-a144-96b60ced2FC9", - expectedId: "did:cheqd:testnet:a86f9cae-0902-4a7c-a144-96b60ced2fc9", + inputID: "did:cheqd:testnet:A86F9CAE-0902-4a7c-a144-96b60ced2FC9", + expectedID: "did:cheqd:testnet:a86f9cae-0902-4a7c-a144-96b60ced2fc9", }), ) }) diff --git a/x/did/types/tx_msg_create_diddoc_test.go b/x/did/types/tx_msg_create_diddoc_test.go index 65469cc9d..ed4ab25de 100644 --- a/x/did/types/tx_msg_create_diddoc_test.go +++ b/x/did/types/tx_msg_create_diddoc_test.go @@ -25,7 +25,6 @@ var _ = Describe("Message for DID creation", func() { Expect(err.Error()).To(ContainSubstring(testCase.errorMsg)) } }, - Entry( "All fields are set properly", TestCaseMsgCreateDID{ @@ -34,10 +33,10 @@ var _ = Describe("Message for DID creation", func() { Id: "did:cheqd:testnet:zABCDEFG123456789abcd", VerificationMethod: []*VerificationMethod{ { - Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", - Type: "Ed25519VerificationKey2020", - Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, Authentication: []string{"did:cheqd:testnet:zABCDEFG123456789abcd#key1", "did:cheqd:testnet:zABCDEFG123456789abcd#aaa"}, @@ -46,8 +45,8 @@ var _ = Describe("Message for DID creation", func() { Signatures: nil, }, isValid: true, - }), - + }, + ), Entry( "IDs are duplicated", TestCaseMsgCreateDID{ @@ -56,10 +55,10 @@ var _ = Describe("Message for DID creation", func() { Id: "did:cheqd:testnet:zABCDEFG123456789abcd", VerificationMethod: []*VerificationMethod{ { - Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", - Type: "Ed25519VerificationKey2020", - Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, Authentication: []string{"did:cheqd:testnet:zABCDEFG123456789abcd#key1", "did:cheqd:testnet:zABCDEFG123456789abcd#key1"}, @@ -68,6 +67,7 @@ var _ = Describe("Message for DID creation", func() { }, isValid: false, errorMsg: "payload: (authentication: there should be no duplicates.).: basic validation failed", - }), + }, + ), ) }) diff --git a/x/did/types/tx_msg_update_did_doc_payload_test.go b/x/did/types/tx_msg_update_did_doc_payload_test.go index 8371df8c2..72ed70901 100644 --- a/x/did/types/tx_msg_update_did_doc_payload_test.go +++ b/x/did/types/tx_msg_update_did_doc_payload_test.go @@ -8,31 +8,31 @@ import ( var _ = Describe("Update DID Payload Validation tests", func() { type TestCaseUUIDDidStruct struct { - inputId string - expectedId string + inputID string + expectedID string } DescribeTable("UUID validation tests", func(testCase TestCaseUUIDDidStruct) { inputMsg := MsgUpdateDidDocPayload{ - Id: testCase.inputId, - Authentication: []string{testCase.inputId + "#key1"}, + Id: testCase.inputID, + Authentication: []string{testCase.inputID + "#key1"}, VerificationMethod: []*VerificationMethod{ { - Id: testCase.inputId + "#key1", - Type: Ed25519VerificationKey2020{}.Type(), - Controller: testCase.inputId, + Id: testCase.inputID + "#key1", + VerificationMethodType: Ed25519VerificationKey2020Type, + Controller: testCase.inputID, }, }, VersionId: "1234567890", } expectedMsg := MsgUpdateDidDocPayload{ - Id: testCase.expectedId, - Authentication: []string{testCase.expectedId + "#key1"}, + Id: testCase.expectedID, + Authentication: []string{testCase.expectedID + "#key1"}, VerificationMethod: []*VerificationMethod{ { - Id: testCase.expectedId + "#key1", - Type: Ed25519VerificationKey2020{}.Type(), - Controller: testCase.expectedId, + Id: testCase.expectedID + "#key1", + VerificationMethodType: Ed25519VerificationKey2020Type, + Controller: testCase.expectedID, }, }, VersionId: "1234567890", @@ -44,29 +44,29 @@ var _ = Describe("Update DID Payload Validation tests", func() { Entry( "base58 identifier - not changed", TestCaseUUIDDidStruct{ - inputId: "did:cheqd:testnet:zABCDEFG123456789abcd", - expectedId: "did:cheqd:testnet:zABCDEFG123456789abcd", + inputID: "did:cheqd:testnet:zABCDEFG123456789abcd", + expectedID: "did:cheqd:testnet:zABCDEFG123456789abcd", }), Entry( "Mixed case UUID", TestCaseUUIDDidStruct{ - inputId: "did:cheqd:testnet:BAbbba14-f294-458a-9b9c-474d188680fd", - expectedId: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", + inputID: "did:cheqd:testnet:BAbbba14-f294-458a-9b9c-474d188680fd", + expectedID: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", }), Entry( "Low case UUID", TestCaseUUIDDidStruct{ - inputId: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", - expectedId: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", + inputID: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", + expectedID: "did:cheqd:testnet:babbba14-f294-458a-9b9c-474d188680fd", }), Entry( "Upper case UUID", TestCaseUUIDDidStruct{ - inputId: "did:cheqd:testnet:A86F9CAE-0902-4a7c-a144-96b60ced2FC9", - expectedId: "did:cheqd:testnet:a86f9cae-0902-4a7c-a144-96b60ced2fc9", + inputID: "did:cheqd:testnet:A86F9CAE-0902-4a7c-a144-96b60ced2FC9", + expectedID: "did:cheqd:testnet:a86f9cae-0902-4a7c-a144-96b60ced2fc9", }), ) }) diff --git a/x/did/types/tx_msg_update_did_doc_test.go b/x/did/types/tx_msg_update_did_doc_test.go index 64fd61d17..8e08cffb1 100644 --- a/x/did/types/tx_msg_update_did_doc_test.go +++ b/x/did/types/tx_msg_update_did_doc_test.go @@ -33,10 +33,10 @@ var _ = Describe("Message for DID updating", func() { Id: "did:cheqd:testnet:zABCDEFG123456789abcd", VerificationMethod: []*VerificationMethod{ { - Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", - Type: "Ed25519VerificationKey2020", - Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, Authentication: []string{"did:cheqd:testnet:zABCDEFG123456789abcd#key1", "did:cheqd:testnet:zABCDEFG123456789abcd#aaa"}, @@ -55,10 +55,10 @@ var _ = Describe("Message for DID updating", func() { Id: "did:cheqd:testnet:zABCDEFG123456789abcd", VerificationMethod: []*VerificationMethod{ { - Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", - Type: "Ed25519VerificationKey2020", - Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, Authentication: []string{"did:cheqd:testnet:zABCDEFG123456789abcd#key1", "did:cheqd:testnet:zABCDEFG123456789abcd#key1"}, @@ -77,10 +77,10 @@ var _ = Describe("Message for DID updating", func() { Id: "did:cheqd:testnet:zABCDEFG123456789abcd", VerificationMethod: []*VerificationMethod{ { - Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", - Type: "Ed25519VerificationKey2020", - Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", - VerificationMaterial: ValidEd25519VerificationMaterial, + Id: "did:cheqd:testnet:zABCDEFG123456789abcd#key1", + VerificationMethodType: "Ed25519VerificationKey2020", + Controller: "did:cheqd:testnet:zABCDEFG123456789abcd", + VerificationMaterial: ValidEd25519VerificationKey2020VerificationMaterial, }, }, Authentication: []string{"did:cheqd:testnet:zABCDEFG123456789abcd#key1", "did:cheqd:testnet:zABCDEFG123456789abcd#aaa"}, diff --git a/x/did/types/tx_sign_info.go b/x/did/types/tx_sign_info.go index e39243fcc..3799cd772 100644 --- a/x/did/types/tx_sign_info.go +++ b/x/did/types/tx_sign_info.go @@ -8,8 +8,8 @@ import ( "github.com/mr-tron/base58" ) -func NewSignInfo(verificationMethodId string, signature []byte) *SignInfo { - return &SignInfo{VerificationMethodId: verificationMethodId, Signature: signature} +func NewSignInfo(verificationMethodID string, signature []byte) *SignInfo { + return &SignInfo{VerificationMethodId: verificationMethodID, Signature: signature} } // Helpers @@ -29,16 +29,16 @@ func IsUniqueSignInfoList(infos []*SignInfo) bool { return si.VerificationMethodId + ":" + base58.Encode(si.Signature) } - tmp_ := map[string]bool{} + tmp := map[string]bool{} for _, si := range infos { h := hash(si) - _, found := tmp_[h] + _, found := tmp[h] if found { return false } - tmp_[h] = true + tmp[h] = true } return true } @@ -60,13 +60,13 @@ func FindSignInfosBySigner(infos []*SignInfo, signer string) []SignInfo { // FindSignInfoBySigner returns the first sign info that corresponds to the provided signer's did func FindSignInfoBySigner(infos []*SignInfo, signer string) (info SignInfo, found bool) { - infos_ := FindSignInfosBySigner(infos, signer) + infosBS := FindSignInfosBySigner(infos, signer) - if len(infos_) == 0 { + if len(infosBS) == 0 { return SignInfo{}, false } - return infos_[0], true + return infosBS[0], true } // Validate @@ -89,7 +89,7 @@ func ValidSignInfoRule(allowedNamespaces []string) *CustomErrorRule { }) } -func IsUniqueSignInfoListByIdRule() *CustomErrorRule { +func IsUniqueSignInfoListByIDRule() *CustomErrorRule { return NewCustomErrorRule(func(value interface{}) error { casted, ok := value.([]*SignInfo) if !ok { diff --git a/x/did/types/tx_sign_info_test.go b/x/did/types/tx_sign_info_test.go index 33f316f45..45139b933 100644 --- a/x/did/types/tx_sign_info_test.go +++ b/x/did/types/tx_sign_info_test.go @@ -58,8 +58,8 @@ var _ = Describe("Full SignInfo duplicates tests", func() { } DescribeTable("SignInfo duplicates tests", func(testCase TestCaseSignInfosStruct) { - res_ := IsUniqueSignInfoList(testCase.signInfos) - Expect(res_).To(Equal(testCase.isValid)) + res := IsUniqueSignInfoList(testCase.signInfos) + Expect(res).To(Equal(testCase.isValid)) }, Entry( diff --git a/x/did/types/types_test.go b/x/did/types/types_test.go index 0421edfd7..37de453fa 100644 --- a/x/did/types/types_test.go +++ b/x/did/types/types_test.go @@ -9,5 +9,5 @@ import ( func TestUtils(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Cheqd Module Types") + RunSpecs(t, "DID Module Types") } diff --git a/x/did/types/v1/did_verification_method.go b/x/did/types/v1/did_verification_method.go index 284e92950..58223ee2a 100644 --- a/x/did/types/v1/did_verification_method.go +++ b/x/did/types/v1/did_verification_method.go @@ -1,6 +1,6 @@ package v1 const ( - JsonWebKey2020 = "JsonWebKey2020" + JSONWebKey2020 = "JsonWebKey2020" Ed25519VerificationKey2020 = "Ed25519VerificationKey2020" ) diff --git a/x/did/types/validate.go b/x/did/types/validate.go index 013987401..75643885b 100644 --- a/x/did/types/validate.go +++ b/x/did/types/validate.go @@ -127,6 +127,28 @@ func IsMultibase() *CustomErrorRule { }) } +func IsMultibaseEd25519VerificationKey2020() *CustomErrorRule { + return NewCustomErrorRule(func(value interface{}) error { + casted, ok := value.(string) + if !ok { + panic("IsMultibaseEd25519VerificationKey2020 must be only applied on string properties") + } + + return utils.ValidateMultibaseEd25519VerificationKey2020(casted) + }) +} + +func IsBase58Ed25519VerificationKey2018() *CustomErrorRule { + return NewCustomErrorRule(func(value interface{}) error { + casted, ok := value.(string) + if !ok { + panic("IsBase58Ed25519VerificationKey2018 must be only applied on string properties") + } + + return utils.ValidateBase58Ed25519VerificationKey2018(casted) + }) +} + func IsMultibaseEncodedEd25519PubKey() *CustomErrorRule { return NewCustomErrorRule(func(value interface{}) error { casted, ok := value.(string) diff --git a/x/did/utils/crypto.go b/x/did/utils/crypto.go index 0294f3bc3..33687882e 100644 --- a/x/did/utils/crypto.go +++ b/x/did/utils/crypto.go @@ -14,9 +14,9 @@ import ( "github.com/lestrrat-go/jwx/jwk" ) -func ValidateJWK(jwk_string string) error { +func ValidateJWK(jwkString string) error { var raw interface{} - err := jwk.ParseRawKey([]byte(jwk_string), &raw) + err := jwk.ParseRawKey([]byte(jwkString), &raw) if err != nil { return fmt.Errorf("can't parse jwk: %s", err.Error()) } @@ -84,3 +84,7 @@ func VerifyECDSASignature(pubKey ecdsa.PublicKey, message []byte, signature []by } return nil } + +func GetEd25519VerificationKey2020(keyBytes []byte) []byte { + return keyBytes[2:] +} diff --git a/x/did/utils/did.go b/x/did/utils/did.go index 092b5197c..56065cdbd 100644 --- a/x/did/utils/did.go +++ b/x/did/utils/did.go @@ -8,8 +8,8 @@ import ( ) var ( - SplitDIDRegexp, _ = regexp.Compile(`^did:([^:]+?)(:([^:]+?))?:([^:]+)$`) - DidNamespaceRegexp, _ = regexp.Compile(`^[a-zA-Z0-9]*$`) + SplitDIDRegexp = regexp.MustCompile(`^did:([^:]+?)(:([^:]+?))?:([^:]+)$`) + DidNamespaceRegexp = regexp.MustCompile(`^[a-zA-Z0-9]*$`) ) // TrySplitDID Validates generic format of DID. It doesn't validate method, name and id content. @@ -48,8 +48,8 @@ func JoinDID(method, namespace, id string) string { return res + ":" + id } -func ReplaceDidInDidUrl(didUrl string, oldDid string, newDid string) string { - did, path, query, fragment := MustSplitDIDUrl(didUrl) +func ReplaceDidInDidURL(didURL string, oldDid string, newDid string) string { + did, path, query, fragment := MustSplitDIDUrl(didURL) if did == oldDid { did = newDid } @@ -57,11 +57,11 @@ func ReplaceDidInDidUrl(didUrl string, oldDid string, newDid string) string { return JoinDIDUrl(did, path, query, fragment) } -func ReplaceDidInDidUrlList(didUrlList []string, oldDid string, newDid string) []string { - res := make([]string, len(didUrlList)) +func ReplaceDidInDidURLList(didURLList []string, oldDid string, newDid string) []string { + res := make([]string, len(didURLList)) - for i := range didUrlList { - res[i] = ReplaceDidInDidUrl(didUrlList[i], oldDid, newDid) + for i := range didURLList { + res[i] = ReplaceDidInDidURL(didURLList[i], oldDid, newDid) } return res @@ -69,7 +69,7 @@ func ReplaceDidInDidUrlList(didUrlList []string, oldDid string, newDid string) [ // ValidateDID checks method and allowed namespaces only when the corresponding parameters are specified. func ValidateDID(did string, method string, allowedNamespaces []string) error { - sMethod, sNamespace, sUniqueId, err := TrySplitDID(did) + sMethod, sNamespace, sUniqueID, err := TrySplitDID(did) if err != nil { return err } @@ -85,11 +85,11 @@ func ValidateDID(did string, method string, allowedNamespaces []string) error { } if len(allowedNamespaces) > 0 && !Contains(allowedNamespaces, sNamespace) { - return fmt.Errorf("did namespace must be one of: %s", strings.Join(allowedNamespaces[:], ", ")) + return fmt.Errorf("did namespace must be one of: %s", strings.Join(allowedNamespaces, ", ")) } // check unique-id - err = ValidateID(sUniqueId) + err = ValidateID(sUniqueID) if err != nil { return err } @@ -106,7 +106,7 @@ func IsValidDID(did string, method string, allowedNamespaces []string) bool { func NormalizeDID(did string) string { method, namespace, id := MustSplitDID(did) - id = NormalizeId(id) + id = NormalizeID(id) return JoinDID(method, namespace, id) } diff --git a/x/did/utils/did_url.go b/x/did/utils/did_url.go index 8b51d92af..2f38cdcf9 100644 --- a/x/did/utils/did_url.go +++ b/x/did/utils/did_url.go @@ -6,6 +6,7 @@ import ( "regexp" ) +// SplitDIDURLRegexp ... // That for groups: // Example: did:cheqd:testnet:fafdsffq11213343/path-to-s/ome-external-resource?query#key1??? // 1 - [^/?#]* - all the symbols except / and ? and # . This is the DID part (did:cheqd:testnet:fafdsffq11213343) @@ -15,18 +16,18 @@ import ( // 5 - #([^#]+[\$]?) - group for fragment, starts with #, includes # (#key1???) // 6 - [^#]+[\$]? - fragment only (key1???) // Number of queries is not limited. -var SplitDIDURLRegexp, _ = regexp.Compile(`([^/?#]*)?([^?#]*)(\?([^#]*))?(#([^#]+$))?$`) +var SplitDIDURLRegexp = regexp.MustCompile(`([^/?#]*)?([^?#]*)(\?([^#]*))?(#([^#]+$))?$`) var ( - DIDPathAbemptyRegexp, _ = regexp.Compile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@]*|(%[0-9A-Fa-f]{2})*)*$`) - DIDQueryRegexp, _ = regexp.Compile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]*|(%[0-9A-Fa-f]{2})*)*$`) - DIDFragmentRegexp, _ = regexp.Compile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]*|(%[0-9A-Fa-f]{2})*)*$`) + DIDPathAbemptyRegexp = regexp.MustCompile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@]*|(%[0-9A-Fa-f]{2})*)*$`) + DIDQueryRegexp = regexp.MustCompile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]*|(%[0-9A-Fa-f]{2})*)*$`) + DIDFragmentRegexp = regexp.MustCompile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]*|(%[0-9A-Fa-f]{2})*)*$`) ) // TrySplitDIDUrl Validates generic format of DIDUrl. It doesn't validate path, query and fragment content. // Call ValidateDIDUrl for further validation. -func TrySplitDIDUrl(didUrl string) (did string, path string, query string, fragment string, err error) { - matches := SplitDIDURLRegexp.FindAllStringSubmatch(didUrl, -1) +func TrySplitDIDUrl(didURL string) (did string, path string, query string, fragment string, err error) { + matches := SplitDIDURLRegexp.FindAllStringSubmatch(didURL, -1) if len(matches) != 1 { return "", "", "", "", errors.New("unable to split did url into did, path, query and fragment") @@ -37,8 +38,8 @@ func TrySplitDIDUrl(didUrl string) (did string, path string, query string, fragm return match[1], match[2], match[4], match[6], nil } -func MustSplitDIDUrl(didUrl string) (did string, path string, query string, fragment string) { - did, path, query, fragment, err := TrySplitDIDUrl(didUrl) +func MustSplitDIDUrl(didURL string) (did string, path string, query string, fragment string) { + did, path, query, fragment, err := TrySplitDIDUrl(didURL) if err != nil { panic(err.Error()) } @@ -60,8 +61,8 @@ func JoinDIDUrl(did string, path string, query string, fragment string) string { } // ValidateDIDUrl checks method and allowed namespaces only when the corresponding parameters are specified. -func ValidateDIDUrl(didUrl string, method string, allowedNamespaces []string) error { - did, path, query, fragment, err := TrySplitDIDUrl(didUrl) +func ValidateDIDUrl(didURL string, method string, allowedNamespaces []string) error { + did, path, query, fragment, err := TrySplitDIDUrl(didURL) if err != nil { return err } @@ -111,27 +112,27 @@ func ValidatePath(path string) error { return nil } -func IsValidDIDUrl(didUrl string, method string, allowedNamespaces []string) bool { - err := ValidateDIDUrl(didUrl, method, allowedNamespaces) +func IsValidDIDUrl(didURL string, method string, allowedNamespaces []string) bool { + err := ValidateDIDUrl(didURL, method, allowedNamespaces) return nil == err } // Normalization -func NormalizeDIDUrl(didUrl string) string { - did, path, query, fragment := MustSplitDIDUrl(didUrl) +func NormalizeDIDUrl(didURL string) string { + did, path, query, fragment := MustSplitDIDUrl(didURL) did = NormalizeDID(did) return JoinDIDUrl(did, path, query, fragment) } -func NormalizeDIDUrlList(didUrls []string) []string { - if didUrls == nil { +func NormalizeDIDUrlList(didURLs []string) []string { + if didURLs == nil { return nil } - newDIDUrls := []string{} - for _, id := range didUrls { - newDIDUrls = append(newDIDUrls, NormalizeDIDUrl(id)) + newDIDURLs := []string{} + for _, id := range didURLs { + newDIDURLs = append(newDIDURLs, NormalizeDIDUrl(id)) } - return newDIDUrls + return newDIDURLs } diff --git a/x/did/utils/did_url_test.go b/x/did/utils/did_url_test.go index 7faca2282..b0dd228dc 100644 --- a/x/did/utils/did_url_test.go +++ b/x/did/utils/did_url_test.go @@ -16,8 +16,8 @@ var _ = Describe("DID-URL tests", func() { func(did_url string) { did, path, query, fragment := MustSplitDIDUrl(did_url) - joined_did_url := JoinDIDUrl(did, path, query, fragment) - Expect(joined_did_url).To(Equal(did_url)) + joinedDidURL := JoinDIDUrl(did, path, query, fragment) + Expect(joinedDidURL).To(Equal(did_url)) }, Entry("All symbols", "did:cheqd:testnet:zABCDEFG123456789abcd/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@%20%ff"), Entry("All symbols for path", "did:cheqd:testnet:zABCDEFG123456789abcd/path/to/some/other/place/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@%20%ff/"), diff --git a/x/did/utils/encoding.go b/x/did/utils/encoding.go index fea527b2b..b6212a5a9 100644 --- a/x/did/utils/encoding.go +++ b/x/did/utils/encoding.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" + "github.com/mr-tron/base58" "github.com/multiformats/go-multibase" ) @@ -43,7 +44,7 @@ func MustEncodeMultibaseBase58(data []byte) string { return encoded } -func MustEncodeJson(data interface{}) string { +func MustEncodeJSON(data interface{}) string { encoded, err := json.Marshal(data) if err != nil { panic(err) @@ -51,3 +52,39 @@ func MustEncodeJson(data interface{}) string { return string(encoded) } + +func ValidateMulticodecEd25519VerificationKey2020(keyBytes []byte) error { + if keyBytes[0] != 0xed && keyBytes[1] != 0x01 { + return fmt.Errorf("invalid two-byte prefix for Ed25519VerificationKey2020. expected: %s actual: %s", + "0xed01", fmt.Sprintf("0x%02x%02x", keyBytes[0], keyBytes[1])) + } + return nil +} + +func ValidateMultibaseEd25519VerificationKey2020(data string) error { + encoding, keyBytes, err := multibase.Decode(data) + if err != nil { + return err + } + + if encoding != multibase.Base58BTC { + return fmt.Errorf("invalid encoding for Ed25519VerificationKey2020. expected: %s actual: %s", + multibase.EncodingToStr[multibase.Base58BTC], multibase.EncodingToStr[encoding]) + } + + err = ValidateMulticodecEd25519VerificationKey2020(keyBytes) + if err != nil { + return err + } + + pubKey := GetEd25519VerificationKey2020(keyBytes) + return ValidateEd25519PubKey(pubKey) +} + +func ValidateBase58Ed25519VerificationKey2018(data string) error { + pubKey, err := base58.Decode(data) + if err != nil { + return err + } + return ValidateEd25519PubKey(pubKey) +} diff --git a/x/did/utils/id.go b/x/did/utils/id.go index 53af8cce6..d52f9b377 100644 --- a/x/did/utils/id.go +++ b/x/did/utils/id.go @@ -7,13 +7,13 @@ import ( ) const ( - IndyIdLength = 16 + IndyIDLength = 16 ) func ValidateID(id string) error { - isValidId := IsValidIndyId(id) || IsValidUUID(id) + isValidID := IsValidIndyID(id) || IsValidUUID(id) - if !isValidId { + if !isValidID { return errors.New("unique id should be one of: 16 bytes of decoded base58 string or UUID") } @@ -25,30 +25,30 @@ func IsValidID(id string) bool { return err == nil } -func IsValidIndyId(data string) bool { +func IsValidIndyID(data string) bool { bytes, err := base58.Decode(data) if err != nil { return false } - return len(bytes) == IndyIdLength + return len(bytes) == IndyIDLength } // Normalization -func NormalizeId(id string) string { +func NormalizeID(id string) string { if IsValidUUID(id) { return NormalizeUUID(id) } return id } -func NormalizeIdList(keys []string) []string { +func NormalizeIDList(keys []string) []string { if keys == nil { return nil } newKeys := []string{} for _, id := range keys { - newKeys = append(newKeys, NormalizeId(id)) + newKeys = append(newKeys, NormalizeID(id)) } return newKeys } diff --git a/x/did/utils/str.go b/x/did/utils/str.go index 33cc9c921..b0fc56ce2 100644 --- a/x/did/utils/str.go +++ b/x/did/utils/str.go @@ -92,9 +92,9 @@ func ReplaceInSlice(list []string, old, new string) { } func UniqueSorted(ls []string) []string { - tmp_ := Unique(ls) - sort.Strings(tmp_) - return tmp_ + tmp := Unique(ls) + sort.Strings(tmp) + return tmp } func StrBytes(p string) []byte { diff --git a/x/did/utils/uri.go b/x/did/utils/uri.go index b8f5fcc1c..3f572a990 100644 --- a/x/did/utils/uri.go +++ b/x/did/utils/uri.go @@ -5,8 +5,9 @@ import ( "regexp" ) +// ValidURIRegexp ... // Goes from RFC: https://www.rfc-editor.org/rfc/rfc3986#appendix-B -var ValidURIRegexp, _ = regexp.Compile(`^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?`) +var ValidURIRegexp = regexp.MustCompile(`^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?`) func ValidateURI(uri string) error { // Match with Regexp from RFC diff --git a/x/did/utils/uri_test.go b/x/did/utils/uri_test.go index 3ed75ff28..112c727a7 100644 --- a/x/did/utils/uri_test.go +++ b/x/did/utils/uri_test.go @@ -10,11 +10,11 @@ var _ = Describe("URI validation", func() { DescribeTable("ValidateURI", func(isValid bool, uri string) { - err_ := ValidateURI(uri) + err := ValidateURI(uri) if isValid { - Expect(err_).To(BeNil()) + Expect(err).To(BeNil()) } else { - Expect(err_).ToNot(BeNil()) + Expect(err).ToNot(BeNil()) } }, diff --git a/x/did/utils/utils_suite_test.go b/x/did/utils/utils_suite_test.go index 6bd2b0c8e..3321a74c2 100644 --- a/x/did/utils/utils_suite_test.go +++ b/x/did/utils/utils_suite_test.go @@ -9,5 +9,5 @@ import ( func TestUtils(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Cheqd Module Utils") + RunSpecs(t, "DID Module Utils") } diff --git a/x/did/utils/uuid.go b/x/did/utils/uuid.go index c0dac6c50..1269aafdd 100644 --- a/x/did/utils/uuid.go +++ b/x/did/utils/uuid.go @@ -8,11 +8,11 @@ import ( "github.com/google/uuid" ) -const StandardUuidLength = 36 +const StandardUUIDLength = 36 func ValidateUUID(u string) error { - if len(u) != StandardUuidLength { - return errors.New("uuid must be of length " + strconv.Itoa(StandardUuidLength) + " (in form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)") + if len(u) != StandardUUIDLength { + return errors.New("uuid must be of length " + strconv.Itoa(StandardUUIDLength) + " (in form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)") } _, err := uuid.Parse(u) diff --git a/x/did/utils/uuid_test.go b/x/did/utils/uuid_test.go index a7a4c36b0..4b9dd8632 100644 --- a/x/did/utils/uuid_test.go +++ b/x/did/utils/uuid_test.go @@ -10,11 +10,11 @@ var _ = Describe("UUID validation", func() { DescribeTable("ValidateUUID", func(uri string, isValid bool) { - err_ := ValidateUUID(uri) + err := ValidateUUID(uri) if isValid { - Expect(err_).To(BeNil()) + Expect(err).To(BeNil()) } else { - Expect(err_).ToNot(BeNil()) + Expect(err).ToNot(BeNil()) } }, diff --git a/x/resource/client/cli/query_collection_resources.go b/x/resource/client/cli/query_collection_resources.go index e10c098c8..3e5138502 100644 --- a/x/resource/client/cli/query_collection_resources.go +++ b/x/resource/client/cli/query_collection_resources.go @@ -19,10 +19,10 @@ func CmdGetCollectionResources() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - collectionId := args[0] + collectionID := args[0] - params := &types.QueryGetCollectionResourcesRequest{ - CollectionId: collectionId, + params := &types.QueryCollectionResourcesRequest{ + CollectionId: collectionID, } resp, err := queryClient.CollectionResources(context.Background(), params) diff --git a/x/resource/client/cli/query_resource.go b/x/resource/client/cli/query_resource.go index 01536df7a..181618aa6 100644 --- a/x/resource/client/cli/query_resource.go +++ b/x/resource/client/cli/query_resource.go @@ -19,11 +19,11 @@ func CmdGetResource() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - collectionId := args[0] + collectionID := args[0] id := args[1] - params := &types.QueryGetResourceRequest{ - CollectionId: collectionId, + params := &types.QueryResourceRequest{ + CollectionId: collectionID, Id: id, } diff --git a/x/resource/client/cli/query_resource_metadata.go b/x/resource/client/cli/query_resource_metadata.go index 4a4897b1a..6797dd454 100644 --- a/x/resource/client/cli/query_resource_metadata.go +++ b/x/resource/client/cli/query_resource_metadata.go @@ -19,11 +19,11 @@ func CmdGetResourceMetadata() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - collectionId := args[0] + collectionID := args[0] id := args[1] - params := &types.QueryGetResourceMetadataRequest{ - CollectionId: collectionId, + params := &types.QueryResourceMetadataRequest{ + CollectionId: collectionID, Id: id, } diff --git a/x/resource/client/cli/tx_create_resource.go b/x/resource/client/cli/tx_create_resource.go index eab4e9aa2..d85c5132d 100644 --- a/x/resource/client/cli/tx_create_resource.go +++ b/x/resource/client/cli/tx_create_resource.go @@ -14,8 +14,8 @@ import ( ) type CreateResourceOptions struct { - CollectionId string `json:"collection_id"` - ResourceId string `json:"resource_id"` + CollectionID string `json:"collection_id"` + ResourceID string `json:"resource_id"` ResourceName string `json:"resource_name"` ResourceVersion string `json:"resource_version"` ResourceType string `json:"resource_type"` @@ -38,13 +38,13 @@ func CmdCreateResource() *cobra.Command { payloadFile := args[0] - payloadJson, signInputs, err := didcli.ReadPayloadWithSignInputsFromFile(payloadFile) + payloadJSON, signInputs, err := didcli.ReadPayloadWithSignInputsFromFile(payloadFile) if err != nil { return err } var options CreateResourceOptions - err = json.Unmarshal(payloadJson, &options) + err = json.Unmarshal(payloadJSON, &options) if err != nil { return err } @@ -56,8 +56,8 @@ func CmdCreateResource() *cobra.Command { // Prepare payload payload := types.MsgCreateResourcePayload{ - CollectionId: options.CollectionId, - Id: options.ResourceId, + CollectionId: options.CollectionID, + Id: options.ResourceID, Name: options.ResourceName, Version: options.ResourceVersion, ResourceType: options.ResourceType, diff --git a/x/resource/genesis.go b/x/resource/genesis.go index c09dda048..0cef14c6a 100644 --- a/x/resource/genesis.go +++ b/x/resource/genesis.go @@ -23,21 +23,17 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState *types.GenesisState) // ExportGenesis returns the cheqd module's exported genesis. func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.GenesisState{} - // Get all resource resourceList, err := k.GetAllResources(&ctx) if err != nil { panic(fmt.Sprintf("Cannot get all resource: %s", err.Error())) } - for _, elem := range resourceList { - genesis.Resources = append(genesis.Resources, &elem) - } - // get fee params feeParams := k.GetParams(ctx) - genesis.FeeParams = &feeParams - return &genesis + return &types.GenesisState{ + Resources: resourceList, + FeeParams: &feeParams, + } } diff --git a/x/resource/keeper/keeper_resource.go b/x/resource/keeper/keeper_resource.go index d5391ebad..f1243b0e6 100644 --- a/x/resource/keeper/keeper_resource.go +++ b/x/resource/keeper/keeper_resource.go @@ -82,20 +82,20 @@ func (k Keeper) SetResource(ctx *sdk.Context, resource *types.ResourceWithMetada } // GetResource returns a resource from its id -func (k Keeper) GetResource(ctx *sdk.Context, collectionId string, id string) (types.ResourceWithMetadata, error) { - if !k.HasResource(ctx, collectionId, id) { - return types.ResourceWithMetadata{}, sdkerrors.ErrNotFound.Wrap("resource " + collectionId + ":" + id) +func (k Keeper) GetResource(ctx *sdk.Context, collectionID string, id string) (types.ResourceWithMetadata, error) { + if !k.HasResource(ctx, collectionID, id) { + return types.ResourceWithMetadata{}, sdkerrors.ErrNotFound.Wrap("resource " + collectionID + ":" + id) } store := ctx.KVStore(k.storeKey) - metadataBytes := store.Get(types.GetResourceMetadataKey(collectionId, id)) + metadataBytes := store.Get(types.GetResourceMetadataKey(collectionID, id)) var metadata types.Metadata if err := k.cdc.Unmarshal(metadataBytes, &metadata); err != nil { return types.ResourceWithMetadata{}, sdkerrors.ErrInvalidType.Wrap(err.Error()) } - dataBytes := store.Get(types.GetResourceDataKey(collectionId, id)) + dataBytes := store.Get(types.GetResourceDataKey(collectionID, id)) data := types.Resource{Data: dataBytes} return types.ResourceWithMetadata{ @@ -104,14 +104,14 @@ func (k Keeper) GetResource(ctx *sdk.Context, collectionId string, id string) (t }, nil } -func (k Keeper) GetResourceMetadata(ctx *sdk.Context, collectionId string, id string) (types.Metadata, error) { - if !k.HasResource(ctx, collectionId, id) { - return types.Metadata{}, sdkerrors.ErrNotFound.Wrap("resource " + collectionId + ":" + id) +func (k Keeper) GetResourceMetadata(ctx *sdk.Context, collectionID string, id string) (types.Metadata, error) { + if !k.HasResource(ctx, collectionID, id) { + return types.Metadata{}, sdkerrors.ErrNotFound.Wrap("resource " + collectionID + ":" + id) } store := ctx.KVStore(k.storeKey) - metadataBytes := store.Get(types.GetResourceMetadataKey(collectionId, id)) + metadataBytes := store.Get(types.GetResourceMetadataKey(collectionID, id)) var metadata types.Metadata if err := k.cdc.Unmarshal(metadataBytes, &metadata); err != nil { return types.Metadata{}, sdkerrors.ErrInvalidType.Wrap(err.Error()) @@ -121,14 +121,14 @@ func (k Keeper) GetResourceMetadata(ctx *sdk.Context, collectionId string, id st } // HasResource checks if the resource exists in the store -func (k Keeper) HasResource(ctx *sdk.Context, collectionId string, id string) bool { +func (k Keeper) HasResource(ctx *sdk.Context, collectionID string, id string) bool { store := ctx.KVStore(k.storeKey) - return store.Has(types.GetResourceMetadataKey(collectionId, id)) + return store.Has(types.GetResourceMetadataKey(collectionID, id)) } -func (k Keeper) GetResourceCollection(ctx *sdk.Context, collectionId string) []*types.Metadata { +func (k Keeper) GetResourceCollection(ctx *sdk.Context, collectionID string) []*types.Metadata { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.GetResourceMetadataCollectionPrefix(collectionId)) + iterator := sdk.KVStorePrefixIterator(store, types.GetResourceMetadataCollectionPrefix(collectionID)) var resources []*types.Metadata @@ -144,8 +144,8 @@ func (k Keeper) GetResourceCollection(ctx *sdk.Context, collectionId string) []* return resources } -func (k Keeper) GetLastResourceVersionMetadata(ctx *sdk.Context, collectionId, name, resourceType string) (types.Metadata, bool) { - iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.GetResourceMetadataCollectionPrefix(collectionId)) +func (k Keeper) GetLastResourceVersionMetadata(ctx *sdk.Context, collectionID, name, resourceType string) (types.Metadata, bool) { + iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.GetResourceMetadataCollectionPrefix(collectionID)) defer closeIteratorOrPanic(iterator) @@ -195,15 +195,15 @@ func (k Keeper) IterateAllResourceMetadatas(ctx *sdk.Context, callback func(meta // GetAllResources returns all resources as a list // Loads everything in memory. Use only for genesis export! -func (k Keeper) GetAllResources(ctx *sdk.Context) (list []types.ResourceWithMetadata, err_ error) { +func (k Keeper) GetAllResources(ctx *sdk.Context) (list []*types.ResourceWithMetadata, iterErr error) { k.IterateAllResourceMetadatas(ctx, func(metadata types.Metadata) bool { resource, err := k.GetResource(ctx, metadata.CollectionId, metadata.Id) if err != nil { - err_ = err + iterErr = err return false } - list = append(list, resource) + list = append(list, &resource) return true }) diff --git a/x/resource/keeper/msg_server_create_resource.go b/x/resource/keeper/msg_server_create_resource.go index 6668f24f1..f54a20138 100644 --- a/x/resource/keeper/msg_server_create_resource.go +++ b/x/resource/keeper/msg_server_create_resource.go @@ -5,7 +5,6 @@ import ( "crypto/sha256" "encoding/hex" "fmt" - "time" "github.com/cheqd/cheqd-node/x/resource/utils" @@ -17,8 +16,8 @@ import ( ) const ( - DefaultAlternativeUriTemplate = "did:cheqd:%s:%s/resources/%s" - DefaultAlternaticeUriDescription = "did-url" + DefaultAlternativeURITemplate = "did:cheqd:%s:%s/resources/%s" + DefaultAlternaticeURIDescription = "did-url" ) func (k msgServer) CreateResource(goCtx context.Context, msg *types.MsgCreateResource) (*types.MsgCreateResourceResponse, error) { @@ -63,17 +62,17 @@ func (k msgServer) CreateResource(goCtx context.Context, msg *types.MsgCreateRes // Build Resource resource := msg.Payload.ToResource() - checksum := sha256.Sum256([]byte(resource.Resource.Data)) + checksum := sha256.Sum256(resource.Resource.Data) resource.Metadata.Checksum = hex.EncodeToString(checksum[:]) - resource.Metadata.Created = ctx.BlockTime().Format(time.RFC3339) + resource.Metadata.Created = ctx.BlockTime() resource.Metadata.MediaType = utils.DetectMediaType(resource.Resource.Data) // Add default resource alternative url - defaultAlternativeUrl := types.AlternativeUri{ - Uri: fmt.Sprintf(DefaultAlternativeUriTemplate, namespace, msg.Payload.CollectionId, msg.Payload.Id), - Description: DefaultAlternaticeUriDescription, + defaultAlternativeURL := types.AlternativeUri{ + Uri: fmt.Sprintf(DefaultAlternativeURITemplate, namespace, msg.Payload.CollectionId, msg.Payload.Id), + Description: DefaultAlternaticeURIDescription, } - resource.Metadata.AlsoKnownAs = append(resource.Metadata.AlsoKnownAs, &defaultAlternativeUrl) + resource.Metadata.AlsoKnownAs = append(resource.Metadata.AlsoKnownAs, &defaultAlternativeURL) // Persist resource err = k.AddNewResourceVersion(&ctx, &resource) diff --git a/x/resource/keeper/querier_collection_resources.go b/x/resource/keeper/querier_collection_resources.go index bbab14c08..5fdd2faac 100644 --- a/x/resource/keeper/querier_collection_resources.go +++ b/x/resource/keeper/querier_collection_resources.go @@ -8,11 +8,11 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -func collectionResources(ctx sdk.Context, keeper Keeper, cheqdKeeper didkeeper.Keeper, legacyQuerierCdc *codec.LegacyAmino, collectionId string) ([]byte, error) { +func collectionResources(ctx sdk.Context, keeper Keeper, cheqdKeeper didkeeper.Keeper, legacyQuerierCdc *codec.LegacyAmino, collectionID string) ([]byte, error) { queryServer := NewQueryServer(keeper, cheqdKeeper) - resp, err := queryServer.CollectionResources(sdk.WrapSDKContext(ctx), &types.QueryGetCollectionResourcesRequest{ - CollectionId: collectionId, + resp, err := queryServer.CollectionResources(sdk.WrapSDKContext(ctx), &types.QueryCollectionResourcesRequest{ + CollectionId: collectionID, }) if err != nil { return nil, err diff --git a/x/resource/keeper/querier_resource.go b/x/resource/keeper/querier_resource.go index a6be1bc78..f46999c7d 100644 --- a/x/resource/keeper/querier_resource.go +++ b/x/resource/keeper/querier_resource.go @@ -8,10 +8,10 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -func resource(ctx sdk.Context, keeper Keeper, cheqdKeeper didkeeper.Keeper, legacyQuerierCdc *codec.LegacyAmino, collectionId, id string) ([]byte, error) { +func resource(ctx sdk.Context, keeper Keeper, cheqdKeeper didkeeper.Keeper, legacyQuerierCdc *codec.LegacyAmino, collectionID, id string) ([]byte, error) { queryServer := NewQueryServer(keeper, cheqdKeeper) - resp, err := queryServer.Resource(sdk.WrapSDKContext(ctx), &types.QueryGetResourceRequest{CollectionId: collectionId, Id: id}) + resp, err := queryServer.Resource(sdk.WrapSDKContext(ctx), &types.QueryResourceRequest{CollectionId: collectionID, Id: id}) if err != nil { return nil, err } diff --git a/x/resource/keeper/querier_resource_metadata.go b/x/resource/keeper/querier_resource_metadata.go index 3e87a9196..0c1403a08 100644 --- a/x/resource/keeper/querier_resource_metadata.go +++ b/x/resource/keeper/querier_resource_metadata.go @@ -8,10 +8,10 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -func resourceMetadata(ctx sdk.Context, keeper Keeper, cheqdKeeper didkeeper.Keeper, legacyQuerierCdc *codec.LegacyAmino, collectionId, id string) ([]byte, error) { +func resourceMetadata(ctx sdk.Context, keeper Keeper, cheqdKeeper didkeeper.Keeper, legacyQuerierCdc *codec.LegacyAmino, collectionID, id string) ([]byte, error) { queryServer := NewQueryServer(keeper, cheqdKeeper) - resp, err := queryServer.ResourceMetadata(sdk.WrapSDKContext(ctx), &types.QueryGetResourceMetadataRequest{CollectionId: collectionId, Id: id}) + resp, err := queryServer.ResourceMetadata(sdk.WrapSDKContext(ctx), &types.QueryResourceMetadataRequest{CollectionId: collectionID, Id: id}) if err != nil { return nil, err } diff --git a/x/resource/keeper/query_server_collection_resources.go b/x/resource/keeper/query_server_collection_resources.go index 054a03422..b8773478b 100644 --- a/x/resource/keeper/query_server_collection_resources.go +++ b/x/resource/keeper/query_server_collection_resources.go @@ -11,7 +11,7 @@ import ( "google.golang.org/grpc/status" ) -func (m queryServer) CollectionResources(c context.Context, req *types.QueryGetCollectionResourcesRequest) (*types.QueryGetCollectionResourcesResponse, error) { +func (q queryServer) CollectionResources(c context.Context, req *types.QueryCollectionResourcesRequest) (*types.QueryCollectionResourcesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -21,16 +21,16 @@ func (m queryServer) CollectionResources(c context.Context, req *types.QueryGetC req.Normalize() // Validate corresponding DIDDoc exists - namespace := m.didKeeper.GetDidNamespace(&ctx) + namespace := q.didKeeper.GetDidNamespace(&ctx) did := didutils.JoinDID(didtypes.DidMethod, namespace, req.CollectionId) - if !m.didKeeper.HasDidDoc(&ctx, did) { + if !q.didKeeper.HasDidDoc(&ctx, did) { return nil, didtypes.ErrDidDocNotFound.Wrap(did) } // Get all resources - resources := m.GetResourceCollection(&ctx, req.CollectionId) + resources := q.GetResourceCollection(&ctx, req.CollectionId) - return &types.QueryGetCollectionResourcesResponse{ + return &types.QueryCollectionResourcesResponse{ Resources: resources, }, nil } diff --git a/x/resource/keeper/query_server_resource.go b/x/resource/keeper/query_server_resource.go index 5e060635b..d85348418 100644 --- a/x/resource/keeper/query_server_resource.go +++ b/x/resource/keeper/query_server_resource.go @@ -12,7 +12,7 @@ import ( "github.com/cheqd/cheqd-node/x/resource/types" ) -func (q queryServer) Resource(c context.Context, req *types.QueryGetResourceRequest) (*types.QueryGetResourceResponse, error) { +func (q queryServer) Resource(c context.Context, req *types.QueryResourceRequest) (*types.QueryResourceResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -33,7 +33,7 @@ func (q queryServer) Resource(c context.Context, req *types.QueryGetResourceRequ return nil, err } - return &types.QueryGetResourceResponse{ + return &types.QueryResourceResponse{ Resource: &resource, }, nil } diff --git a/x/resource/keeper/query_server_resource_metadata.go b/x/resource/keeper/query_server_resource_metadata.go index 326b4394d..047530dc1 100644 --- a/x/resource/keeper/query_server_resource_metadata.go +++ b/x/resource/keeper/query_server_resource_metadata.go @@ -12,7 +12,7 @@ import ( "github.com/cheqd/cheqd-node/x/resource/types" ) -func (q queryServer) ResourceMetadata(c context.Context, req *types.QueryGetResourceMetadataRequest) (*types.QueryGetResourceMetadataResponse, error) { +func (q queryServer) ResourceMetadata(c context.Context, req *types.QueryResourceMetadataRequest) (*types.QueryResourceMetadataResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -33,7 +33,7 @@ func (q queryServer) ResourceMetadata(c context.Context, req *types.QueryGetReso return nil, err } - return &types.QueryGetResourceMetadataResponse{ + return &types.QueryResourceMetadataResponse{ Resource: &metadata, }, nil } diff --git a/x/resource/keeper/v1/keeper_resource.go b/x/resource/keeper/v1/keeper_resource.go index 9684a1a36..9cc2fe520 100644 --- a/x/resource/keeper/v1/keeper_resource.go +++ b/x/resource/keeper/v1/keeper_resource.go @@ -61,20 +61,20 @@ func (k Keeper) SetResource(ctx *sdk.Context, resource *types.Resource) error { } // GetResource returns a resource from its id -func (k Keeper) GetResource(ctx *sdk.Context, collectionId string, id string) (types.Resource, error) { - if !k.HasResource(ctx, collectionId, id) { - return types.Resource{}, sdkerrors.ErrNotFound.Wrap("resource " + collectionId + ":" + id) +func (k Keeper) GetResource(ctx *sdk.Context, collectionID string, id string) (types.Resource, error) { + if !k.HasResource(ctx, collectionID, id) { + return types.Resource{}, sdkerrors.ErrNotFound.Wrap("resource " + collectionID + ":" + id) } store := ctx.KVStore(k.storeKey) - headerBytes := store.Get(GetResourceHeaderKeyBytes(collectionId, id)) + headerBytes := store.Get(GetResourceHeaderKeyBytes(collectionID, id)) var header types.ResourceHeader if err := k.cdc.Unmarshal(headerBytes, &header); err != nil { return types.Resource{}, sdkerrors.ErrInvalidType.Wrap(err.Error()) } - dataBytes := store.Get(GetResourceDataKeyBytes(collectionId, id)) + dataBytes := store.Get(GetResourceDataKeyBytes(collectionID, id)) return types.Resource{ Header: &header, @@ -83,14 +83,14 @@ func (k Keeper) GetResource(ctx *sdk.Context, collectionId string, id string) (t } // HasResource checks if the resource exists in the store -func (k Keeper) HasResource(ctx *sdk.Context, collectionId string, id string) bool { +func (k Keeper) HasResource(ctx *sdk.Context, collectionID string, id string) bool { store := ctx.KVStore(k.storeKey) - return store.Has(GetResourceHeaderKeyBytes(collectionId, id)) + return store.Has(GetResourceHeaderKeyBytes(collectionID, id)) } -func (k Keeper) GetAllResourceVersions(ctx *sdk.Context, collectionId, name string) []*types.ResourceHeader { +func (k Keeper) GetAllResourceVersions(ctx *sdk.Context, collectionID, name string) []*types.ResourceHeader { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, GetResourceHeaderCollectionPrefixBytes(collectionId)) + iterator := sdk.KVStorePrefixIterator(store, GetResourceHeaderCollectionPrefixBytes(collectionID)) defer closeIteratorOrPanic(iterator) @@ -108,9 +108,9 @@ func (k Keeper) GetAllResourceVersions(ctx *sdk.Context, collectionId, name stri return result } -func (k Keeper) GetResourceCollection(ctx *sdk.Context, collectionId string) []*types.ResourceHeader { +func (k Keeper) GetResourceCollection(ctx *sdk.Context, collectionID string) []*types.ResourceHeader { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, GetResourceHeaderCollectionPrefixBytes(collectionId)) + iterator := sdk.KVStorePrefixIterator(store, GetResourceHeaderCollectionPrefixBytes(collectionID)) var resources []*types.ResourceHeader @@ -126,8 +126,8 @@ func (k Keeper) GetResourceCollection(ctx *sdk.Context, collectionId string) []* return resources } -func (k Keeper) GetLastResourceVersionHeader(ctx *sdk.Context, collectionId, name, resourceType, mediaType string) (types.ResourceHeader, bool) { - iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), GetResourceHeaderCollectionPrefixBytes(collectionId)) +func (k Keeper) GetLastResourceVersionHeader(ctx *sdk.Context, collectionID, name, resourceType, mediaType string) (types.ResourceHeader, bool) { + iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), GetResourceHeaderCollectionPrefixBytes(collectionID)) defer closeIteratorOrPanic(iterator) @@ -189,18 +189,18 @@ func (k Keeper) GetAllResources(ctx *sdk.Context) (list []types.Resource) { } // GetResourceHeaderKeyBytes returns the byte representation of resource key -func GetResourceHeaderKeyBytes(collectionId string, id string) []byte { - return []byte(types.ResourceHeaderKey + collectionId + ":" + id) +func GetResourceHeaderKeyBytes(collectionID string, id string) []byte { + return []byte(types.ResourceHeaderKey + collectionID + ":" + id) } // GetResourceHeaderCollectionPrefixBytes used to iterate over all resource headers in a collection -func GetResourceHeaderCollectionPrefixBytes(collectionId string) []byte { - return []byte(types.ResourceHeaderKey + collectionId + ":") +func GetResourceHeaderCollectionPrefixBytes(collectionID string) []byte { + return []byte(types.ResourceHeaderKey + collectionID + ":") } // GetResourceDataKeyBytes returns the byte representation of resource key -func GetResourceDataKeyBytes(collectionId string, id string) []byte { - return []byte(types.ResourceDataKey + collectionId + ":" + id) +func GetResourceDataKeyBytes(collectionID string, id string) []byte { + return []byte(types.ResourceDataKey + collectionID + ":" + id) } func closeIteratorOrPanic(iterator sdk.Iterator) { diff --git a/x/resource/tests/create_resource_test.go b/x/resource/tests/create_resource_test.go index 93662a647..8c2df8201 100644 --- a/x/resource/tests/create_resource_test.go +++ b/x/resource/tests/create_resource_test.go @@ -24,12 +24,12 @@ func ExpectPayloadToMatchResource(payload *resourcetypes.MsgCreateResourcePayloa Expect(payload.Name).To(Equal(resource.Metadata.Name)) Expect(payload.ResourceType).To(Equal(resource.Metadata.ResourceType)) - defaultAlternativeUrl := resourcetypes.AlternativeUri{ - Uri: "did:cheqd:" + didsetup.DID_NAMESPACE + ":" + payload.CollectionId + "/resources/" + payload.Id, + defaultAlternativeURL := resourcetypes.AlternativeUri{ + Uri: "did:cheqd:" + didsetup.DidNamespace + ":" + payload.CollectionId + "/resources/" + payload.Id, Description: "did-url", } - Expect(append(payload.AlsoKnownAs, &defaultAlternativeUrl)).To(Equal(resource.Metadata.AlsoKnownAs)) + Expect(append(payload.AlsoKnownAs, &defaultAlternativeURL)).To(Equal(resource.Metadata.AlsoKnownAs)) // Generated header hash := sha256.Sum256(payload.Data) @@ -54,7 +54,7 @@ var _ = Describe("Create Resource Tests", func() { BeforeEach(func() { msg = &resourcetypes.MsgCreateResourcePayload{ - CollectionId: alice.CollectionId, + CollectionId: alice.CollectionID, Id: uuid.NewString(), Name: "Test Resource Name", ResourceType: CLSchemaType, @@ -76,7 +76,7 @@ var _ = Describe("Create Resource Tests", func() { Expect(err).To(BeNil()) // check - created, err := setup.QueryResource(alice.CollectionId, msg.Id) + created, err := setup.QueryResource(alice.CollectionID, msg.Id) Expect(err).To(BeNil()) ExpectPayloadToMatchResource(msg, created.Resource) @@ -107,12 +107,12 @@ var _ = Describe("Create Resource Tests", func() { var existingResource *resourcetypes.MsgCreateResourceResponse BeforeEach(func() { - existingResource = setup.CreateSimpleResource(alice.CollectionId, SchemaData, "Test Resource Name", CLSchemaType, []didsetup.SignInput{alice.SignInput}) + existingResource = setup.CreateSimpleResource(alice.CollectionID, SchemaData, "Test Resource Name", CLSchemaType, []didsetup.SignInput{alice.SignInput}) }) It("Is linked to the previous one when name matches", func() { msg := resourcetypes.MsgCreateResourcePayload{ - CollectionId: alice.CollectionId, + CollectionId: alice.CollectionID, Id: uuid.NewString(), Name: existingResource.Resource.Name, ResourceType: CLSchemaType, @@ -123,7 +123,7 @@ var _ = Describe("Create Resource Tests", func() { Expect(err).To(BeNil()) // check - created, err := setup.QueryResource(alice.CollectionId, msg.Id) + created, err := setup.QueryResource(alice.CollectionID, msg.Id) Expect(err).To(BeNil()) ExpectPayloadToMatchResource(&msg, created.Resource) @@ -136,7 +136,7 @@ var _ = Describe("Create Resource Tests", func() { BeforeEach(func() { msg = &resourcetypes.MsgCreateResourcePayload{ - CollectionId: alice.CollectionId, + CollectionId: alice.CollectionID, Id: uuid.NewString(), Name: "Test Resource Name", ResourceType: CLSchemaType, @@ -169,7 +169,7 @@ var _ = Describe("Create Resource Tests", func() { Describe("UUID with capital letters", func() { It("Should work even for UUID with capital letters", func() { msg := resourcetypes.MsgCreateResourcePayload{ - CollectionId: alice.CollectionId, + CollectionId: alice.CollectionID, Id: UUIDString, Name: "Resource with capital letters in UUID", ResourceType: CLSchemaType, @@ -180,15 +180,15 @@ var _ = Describe("Create Resource Tests", func() { Expect(err).To(BeNil()) // check for the same UUID - created, err := setup.QueryResource(alice.CollectionId, UUIDString) + created, err := setup.QueryResource(alice.CollectionID, UUIDString) Expect(err).To(BeNil()) Expect(created.Resource.Metadata.Id).To(Equal(strings.ToLower(UUIDString))) // check for already normalized UUID created, err = setup.QueryResource( - didutils.NormalizeId(alice.CollectionId), - didutils.NormalizeId(UUIDString)) + didutils.NormalizeID(alice.CollectionID), + didutils.NormalizeID(UUIDString)) Expect(err).To(BeNil()) Expect(created.Resource.Metadata.Id).To(Equal(strings.ToLower(UUIDString))) diff --git a/x/resource/tests/query_collection_resources_test.go b/x/resource/tests/query_collection_resources_test.go index eb94dde54..6edf4ef5e 100644 --- a/x/resource/tests/query_collection_resources_test.go +++ b/x/resource/tests/query_collection_resources_test.go @@ -25,16 +25,16 @@ var _ = Describe("Query Collection Resources", func() { setup = Setup() alice = setup.CreateSimpleDid() - uuidDID = setup.CreateCustomDidDoc(setup.BuildDidDocWithCustomId(UUIDString)) + uuidDID = setup.CreateCustomDidDoc(setup.BuildDidDocWithCustomID(UUIDString)) - res1v1 = setup.CreateSimpleResource(alice.CollectionId, SchemaData, "Resource 1", CLSchemaType, []didsetup.SignInput{alice.SignInput}) - res1v2 = setup.CreateSimpleResource(alice.CollectionId, SchemaData, "Resource 1", CLSchemaType, []didsetup.SignInput{alice.SignInput}) - res2v1 = setup.CreateSimpleResource(alice.CollectionId, SchemaData, "Resource 2", CLSchemaType, []didsetup.SignInput{alice.SignInput}) - resUUID = setup.CreateSimpleResource(uuidDID.CollectionId, SchemaData, "Resource UUID", CLSchemaType, []didsetup.SignInput{uuidDID.SignInput}) + res1v1 = setup.CreateSimpleResource(alice.CollectionID, SchemaData, "Resource 1", CLSchemaType, []didsetup.SignInput{alice.SignInput}) + res1v2 = setup.CreateSimpleResource(alice.CollectionID, SchemaData, "Resource 1", CLSchemaType, []didsetup.SignInput{alice.SignInput}) + res2v1 = setup.CreateSimpleResource(alice.CollectionID, SchemaData, "Resource 2", CLSchemaType, []didsetup.SignInput{alice.SignInput}) + resUUID = setup.CreateSimpleResource(uuidDID.CollectionID, SchemaData, "Resource UUID", CLSchemaType, []didsetup.SignInput{uuidDID.SignInput}) }) It("Should return all 3 headers", func() { - versions, err := setup.CollectionResources(alice.CollectionId) + versions, err := setup.CollectionResources(alice.CollectionID) Expect(err).To(BeNil()) Expect(versions.Resources).To(HaveLen(3)) @@ -47,7 +47,7 @@ var _ = Describe("Query Collection Resources", func() { It("Should work with capital letters in UUID", func() { // Here we are asking for non-normalized UUID - versions, err := setup.CollectionResources(uuidDID.CollectionId) + versions, err := setup.CollectionResources(uuidDID.CollectionID) Expect(err).To(BeNil()) Expect(versions.Resources).To(HaveLen(1)) @@ -58,8 +58,8 @@ var _ = Describe("Query Collection Resources", func() { It("Should work with capital letters in UUID. Ask with already normalized collectionId", func() { // Here we are asking for normalized UUID but it was written with capital letters - normalizedId := didutils.NormalizeId(uuidDID.CollectionId) - versions, err := setup.CollectionResources(normalizedId) + normalizedID := didutils.NormalizeID(uuidDID.CollectionID) + versions, err := setup.CollectionResources(normalizedID) Expect(err).To(BeNil()) Expect(versions.Resources).To(HaveLen(1)) diff --git a/x/resource/tests/query_resource_metadata_test.go b/x/resource/tests/query_resource_metadata_test.go index 875eede4c..b4303b036 100644 --- a/x/resource/tests/query_resource_metadata_test.go +++ b/x/resource/tests/query_resource_metadata_test.go @@ -19,11 +19,11 @@ var _ = Describe("Query Resource Metadata", func() { BeforeEach(func() { setup = Setup() alice = setup.CreateSimpleDid() - resource = setup.CreateSimpleResource(alice.CollectionId, SchemaData, "Resource 1", CLSchemaType, []didsetup.SignInput{alice.SignInput}) + resource = setup.CreateSimpleResource(alice.CollectionID, SchemaData, "Resource 1", CLSchemaType, []didsetup.SignInput{alice.SignInput}) }) It("Works", func() { - metadata, err := setup.QueryResourceMetadata(alice.CollectionId, resource.Resource.Id) + metadata, err := setup.QueryResourceMetadata(alice.CollectionID, resource.Resource.Id) Expect(err).To(BeNil()) Expect(metadata.Resource).To(Equal(resource.Resource)) }) @@ -31,7 +31,7 @@ var _ = Describe("Query Resource Metadata", func() { It("Returns error if resource does not exist", func() { nonExistingResource := uuid.NewString() - _, err := setup.QueryResource(alice.CollectionId, nonExistingResource) + _, err := setup.QueryResource(alice.CollectionID, nonExistingResource) Expect(err.Error()).To(ContainSubstring("not found")) }) diff --git a/x/resource/tests/query_resource_test.go b/x/resource/tests/query_resource_test.go index cff1df74b..ed99660ff 100644 --- a/x/resource/tests/query_resource_test.go +++ b/x/resource/tests/query_resource_test.go @@ -19,11 +19,11 @@ var _ = Describe("Query Resource", func() { BeforeEach(func() { setup = Setup() alice = setup.CreateSimpleDid() - resource = setup.CreateSimpleResource(alice.CollectionId, SchemaData, "Resource 1", CLSchemaType, []didsetup.SignInput{alice.SignInput}) + resource = setup.CreateSimpleResource(alice.CollectionID, SchemaData, "Resource 1", CLSchemaType, []didsetup.SignInput{alice.SignInput}) }) It("Works", func() { - resp, err := setup.QueryResource(alice.CollectionId, resource.Resource.Id) + resp, err := setup.QueryResource(alice.CollectionID, resource.Resource.Id) Expect(err).To(BeNil()) Expect(resp.Resource.Metadata.Id).To(Equal(resource.Resource.Id)) }) @@ -31,7 +31,7 @@ var _ = Describe("Query Resource", func() { It("Returns error if resource does not exist", func() { nonExistingResource := uuid.NewString() - _, err := setup.QueryResource(alice.CollectionId, nonExistingResource) + _, err := setup.QueryResource(alice.CollectionID, nonExistingResource) Expect(err.Error()).To(ContainSubstring("not found")) }) diff --git a/x/resource/tests/setup/setup.go b/x/resource/tests/setup/setup.go index eb632922d..6dfd3b078 100644 --- a/x/resource/tests/setup/setup.go +++ b/x/resource/tests/setup/setup.go @@ -95,7 +95,7 @@ func Setup() TestSetup { ResourceQueryServer: queryServer, } - setup.Keeper.SetDidNamespace(&ctx, didsetup.DID_NAMESPACE) + setup.Keeper.SetDidNamespace(&ctx, didsetup.DidNamespace) return setup } diff --git a/x/resource/tests/setup/setup_create_resource.go b/x/resource/tests/setup/setup_create_resource.go index 016ffcedc..6c238f12b 100644 --- a/x/resource/tests/setup/setup_create_resource.go +++ b/x/resource/tests/setup/setup_create_resource.go @@ -11,13 +11,13 @@ import ( func (s *TestSetup) CreateResource(payload *types.MsgCreateResourcePayload, signInputs []setup.SignInput) (*types.MsgCreateResourceResponse, error) { signBytes := payload.GetSignBytes() - var signatures []*didtypes.SignInfo + signatures := make([]*didtypes.SignInfo, 0, len(signInputs)) for _, input := range signInputs { signature := ed25519.Sign(input.Key, signBytes) signatures = append(signatures, &didtypes.SignInfo{ - VerificationMethodId: input.VerificationMethodId, + VerificationMethodId: input.VerificationMethodID, Signature: signature, }) } @@ -30,18 +30,18 @@ func (s *TestSetup) CreateResource(payload *types.MsgCreateResourcePayload, sign return s.ResourceMsgServer.CreateResource(s.StdCtx, msg) } -func (s *TestSetup) BuildSimpleResource(collectionId, data, name, _type string) types.MsgCreateResourcePayload { +func (s *TestSetup) BuildSimpleResource(collectionID, data, name, _type string) types.MsgCreateResourcePayload { return types.MsgCreateResourcePayload{ Id: uuid.NewString(), - CollectionId: collectionId, + CollectionId: collectionID, Data: []byte(data), Name: name, ResourceType: _type, } } -func (s *TestSetup) CreateSimpleResource(collectionId, data, name, _type string, signInputs []setup.SignInput) *types.MsgCreateResourceResponse { - resource := s.BuildSimpleResource(collectionId, data, name, _type) +func (s *TestSetup) CreateSimpleResource(collectionID, data, name, _type string, signInputs []setup.SignInput) *types.MsgCreateResourceResponse { + resource := s.BuildSimpleResource(collectionID, data, name, _type) res, err := s.CreateResource(&resource, signInputs) if err != nil { panic(err) diff --git a/x/resource/tests/setup/setup_query_collecton_resources.go b/x/resource/tests/setup/setup_query_collecton_resources.go index 708877110..88b0b11f5 100644 --- a/x/resource/tests/setup/setup_query_collecton_resources.go +++ b/x/resource/tests/setup/setup_query_collecton_resources.go @@ -2,9 +2,9 @@ package setup import "github.com/cheqd/cheqd-node/x/resource/types" -func (s *TestSetup) CollectionResources(collectionId string) (*types.QueryGetCollectionResourcesResponse, error) { - req := &types.QueryGetCollectionResourcesRequest{ - CollectionId: collectionId, +func (s *TestSetup) CollectionResources(collectionID string) (*types.QueryCollectionResourcesResponse, error) { + req := &types.QueryCollectionResourcesRequest{ + CollectionId: collectionID, } return s.ResourceQueryServer.CollectionResources(s.StdCtx, req) diff --git a/x/resource/tests/setup/setup_query_resource.go b/x/resource/tests/setup/setup_query_resource.go index 34c47bc1d..433c82aca 100644 --- a/x/resource/tests/setup/setup_query_resource.go +++ b/x/resource/tests/setup/setup_query_resource.go @@ -2,10 +2,10 @@ package setup import "github.com/cheqd/cheqd-node/x/resource/types" -func (s *TestSetup) QueryResource(collectionId, resourceId string) (*types.QueryGetResourceResponse, error) { - req := &types.QueryGetResourceRequest{ - CollectionId: collectionId, - Id: resourceId, +func (s *TestSetup) QueryResource(collectionID, resourceID string) (*types.QueryResourceResponse, error) { + req := &types.QueryResourceRequest{ + CollectionId: collectionID, + Id: resourceID, } return s.ResourceQueryServer.Resource(s.StdCtx, req) diff --git a/x/resource/tests/setup/setup_query_resource_metadata.go b/x/resource/tests/setup/setup_query_resource_metadata.go index 87e4ff2cd..fcf59bcd7 100644 --- a/x/resource/tests/setup/setup_query_resource_metadata.go +++ b/x/resource/tests/setup/setup_query_resource_metadata.go @@ -2,10 +2,10 @@ package setup import "github.com/cheqd/cheqd-node/x/resource/types" -func (s *TestSetup) QueryResourceMetadata(collectionId, resourceId string) (*types.QueryGetResourceMetadataResponse, error) { - req := &types.QueryGetResourceMetadataRequest{ - CollectionId: collectionId, - Id: resourceId, +func (s *TestSetup) QueryResourceMetadata(collectionID, resourceID string) (*types.QueryResourceMetadataResponse, error) { + req := &types.QueryResourceMetadataRequest{ + CollectionId: collectionID, + Id: resourceID, } return s.ResourceQueryServer.ResourceMetadata(s.StdCtx, req) diff --git a/x/resource/tests/setup/testdata.go b/x/resource/tests/setup/testdata.go index 3de72d6fa..d9bbc289c 100644 --- a/x/resource/tests/setup/testdata.go +++ b/x/resource/tests/setup/testdata.go @@ -4,6 +4,6 @@ const ( CLSchemaType = "CL-Schema" SchemaData = "{\"attr\":[\"name\",\"age\"]}" TestResourceName = "Test Resource Name" - JsonResourceType = "application/json" + JSONResourceType = "application/json" UUIDString = "A86F9CAE-0902-4a7c-a144-96b60ced2FC9" ) diff --git a/x/resource/types/error.go b/x/resource/types/error.go index f8786359d..c1a11ba59 100644 --- a/x/resource/types/error.go +++ b/x/resource/types/error.go @@ -9,7 +9,7 @@ import ( // x/resource module sentinel errors var ( ErrBadRequest = sdkerrors.Register(ModuleName, 2000, "bad request") - ErrResourceExists = sdkerrors.Register(ModuleName, 2200, "Resoure exists") + ErrResourceExists = sdkerrors.Register(ModuleName, 2200, "Resource exists") ErrBasicValidation = sdkerrors.Register(ModuleName, 2205, "basic validation failed") ErrInternal = sdkerrors.Register(ModuleName, 2500, "internal error") ) diff --git a/x/resource/types/fee.pb.go b/x/resource/types/fee.pb.go index c868e80a9..5e389ee44 100644 --- a/x/resource/types/fee.pb.go +++ b/x/resource/types/fee.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -26,12 +26,24 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// FeeParams defines the parameters for the `resource` module fixed fee. +// FeeParams defines the parameters for the cheqd Resource module fixed fee. +// Creation requests for different IANA media types are charged different fees. type FeeParams struct { - // Media types define the fixed fee each for the `resource` module. - Image types.Coin `protobuf:"bytes,1,opt,name=image,proto3" json:"image"` - Json types.Coin `protobuf:"bytes,2,opt,name=json,proto3" json:"json"` - Default types.Coin `protobuf:"bytes,3,opt,name=default,proto3" json:"default"` + // Fixed fee for creating a resource with media type 'image/*' + // + // Default: 10 CHEQ or 10000000000ncheq + Image types.Coin `protobuf:"bytes,1,opt,name=image,proto3" json:"image"` + // Fixed fee for creating a resource with media type 'application/json' + // + // Default: 2.5 CHEQ or 2500000000ncheq + Json types.Coin `protobuf:"bytes,2,opt,name=json,proto3" json:"json"` + // Fixed fee for creating a resource with all other media types + // + // Default: 5 CHEQ or 5000000000ncheq + Default types.Coin `protobuf:"bytes,3,opt,name=default,proto3" json:"default"` + // Percentage of the fixed fee that will be burned + // + // Default: 0.5 (50%) BurnFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=burn_factor,json=burnFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"burn_factor"` } @@ -100,24 +112,24 @@ var fileDescriptor_133abe56c2e24f1e = []byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xce, 0x48, 0x2d, 0x4c, 0xd1, 0x2f, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2f, 0x33, 0xd2, 0x4f, 0x4b, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0x4b, 0xea, 0xc1, 0x24, 0xf5, 0xca, - 0x8c, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xb2, 0xfa, 0x20, 0x16, 0x44, 0xa1, 0x94, 0x5c, - 0x72, 0x7e, 0x71, 0x6e, 0x7e, 0xb1, 0x7e, 0x52, 0x62, 0x71, 0xaa, 0x7e, 0x99, 0x61, 0x52, 0x6a, - 0x49, 0xa2, 0xa1, 0x7e, 0x72, 0x7e, 0x66, 0x1e, 0x54, 0x5e, 0x12, 0x22, 0x1f, 0x0f, 0xd1, 0x08, - 0xe1, 0x40, 0xa4, 0x94, 0x26, 0x32, 0x71, 0x71, 0xba, 0xa5, 0xa6, 0x06, 0x24, 0x16, 0x25, 0xe6, - 0x16, 0x0b, 0x99, 0x72, 0xb1, 0x66, 0xe6, 0x26, 0xa6, 0xa7, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, - 0x1b, 0x49, 0xea, 0x41, 0xd5, 0x82, 0x0c, 0xd6, 0x83, 0x1a, 0xac, 0xe7, 0x9c, 0x9f, 0x99, 0xe7, - 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x44, 0xb5, 0x90, 0x31, 0x17, 0x4b, 0x56, 0x71, 0x7e, - 0x9e, 0x04, 0x13, 0x71, 0xba, 0xc0, 0x8a, 0x85, 0x2c, 0xb9, 0xd8, 0x53, 0x52, 0xd3, 0x12, 0x4b, - 0x73, 0x4a, 0x24, 0x98, 0x89, 0xd3, 0x07, 0x53, 0x2f, 0x14, 0xcb, 0xc5, 0x9d, 0x54, 0x5a, 0x94, - 0x17, 0x9f, 0x96, 0x98, 0x5c, 0x92, 0x5f, 0x24, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, 0xe9, 0x64, 0x03, - 0x52, 0x73, 0xeb, 0x9e, 0xbc, 0x5a, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, - 0xd4, 0xab, 0x50, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x58, 0xcf, 0x25, + 0x8c, 0xa4, 0xe4, 0x92, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, 0x93, 0x12, 0x8b, 0x53, 0xf5, 0xcb, + 0x0c, 0x93, 0x52, 0x4b, 0x12, 0x0d, 0xf5, 0x93, 0xf3, 0x33, 0xf3, 0x20, 0x5a, 0xa4, 0x24, 0x21, + 0xf2, 0xf1, 0x60, 0x9e, 0x3e, 0x84, 0x03, 0x95, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x87, 0x88, 0x83, + 0x58, 0x10, 0x51, 0xa5, 0x89, 0x4c, 0x5c, 0x9c, 0x6e, 0xa9, 0xa9, 0x01, 0x89, 0x45, 0x89, 0xb9, + 0xc5, 0x42, 0xa6, 0x5c, 0xac, 0x99, 0xb9, 0x89, 0xe9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, + 0x46, 0x92, 0x7a, 0x50, 0x13, 0x40, 0xd6, 0xe9, 0x41, 0xad, 0xd3, 0x73, 0xce, 0xcf, 0xcc, 0x73, + 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xa2, 0x5a, 0xc8, 0x98, 0x8b, 0x25, 0xab, 0x38, 0x3f, + 0x4f, 0x82, 0x89, 0x38, 0x5d, 0x60, 0xc5, 0x42, 0x96, 0x5c, 0xec, 0x29, 0xa9, 0x69, 0x89, 0xa5, + 0x39, 0x25, 0x12, 0xcc, 0xc4, 0xe9, 0x83, 0xa9, 0x17, 0x8a, 0xe5, 0xe2, 0x4e, 0x2a, 0x2d, 0xca, + 0x8b, 0x4f, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0x92, 0x60, 0x51, 0x60, 0xd4, 0xe0, 0x74, 0xb2, 0x01, + 0xa9, 0xb9, 0x75, 0x4f, 0x5e, 0x2d, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x17, + 0x1a, 0x00, 0x50, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x58, 0xcf, 0x25, 0x35, 0xf9, 0xd2, 0x16, 0x5d, 0x2e, 0xa8, 0x7d, 0x2e, 0xa9, 0xc9, 0x41, 0x5c, 0x20, 0x03, 0xdd, 0xc0, 0xe6, 0x39, 0x79, 0xad, 0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x3a, 0xc8, 0xe6, 0x83, 0x63, 0x0f, 0x4c, 0xea, 0xe6, 0xe5, 0xa7, 0xa4, 0xea, 0x57, 0x20, 0xa2, 0x12, 0x6c, 0x53, 0x12, 0x1b, 0x38, 0x98, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x17, 0x94, 0xe1, 0xf5, 0xe9, 0x01, 0x00, 0x00, + 0xff, 0x7e, 0x2c, 0x51, 0xb6, 0xe9, 0x01, 0x00, 0x00, } func (this *FeeParams) Equal(that interface{}) bool { diff --git a/x/resource/types/genesis.go b/x/resource/types/genesis.go index 2987e05b0..481cc7488 100644 --- a/x/resource/types/genesis.go +++ b/x/resource/types/genesis.go @@ -6,7 +6,7 @@ import ( const ( DefaultCreateResourceImageFee = 10e9 // 10 CHEQ or 10000000000 ncheq - DefaultCreateResourceJsonFee = 25e8 // 2.5 CHEQ or 2500000000 ncheq + DefaultCreateResourceJSONFee = 25e8 // 2.5 CHEQ or 2500000000 ncheq DefaultCreateResourceDefaultFee = 5e9 // 5 CHEQ or 5000000000 ncheq DefaultBurnFactor = "0.500000000000000000" // 0.5 or 50% ) @@ -44,14 +44,14 @@ func (gs GenesisState) ValidateNoDuplicates() error { // Check that there are no collisions within each collection for _, resources := range resourcesByCollection { - resourceIdMap := make(map[string]bool) + resourceIDMap := make(map[string]bool) for _, resource := range resources { - if _, ok := resourceIdMap[resource.Metadata.Id]; ok { + if _, ok := resourceIDMap[resource.Metadata.Id]; ok { return fmt.Errorf("duplicated id for resource within the same collection. collection: %s, id: %s", resource.Metadata.CollectionId, resource.Metadata.Id) } - resourceIdMap[resource.Metadata.Id] = true + resourceIDMap[resource.Metadata.Id] = true } } diff --git a/x/resource/types/genesis.pb.go b/x/resource/types/genesis.pb.go index 1d656903c..7a6ef47b4 100644 --- a/x/resource/types/genesis.pb.go +++ b/x/resource/types/genesis.pb.go @@ -22,9 +22,13 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// GenesisState defines the chqed Resource module's genesis state type GenesisState struct { + // All Resources with metadata Resources []*ResourceWithMetadata `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` - FeeParams *FeeParams `protobuf:"bytes,2,opt,name=fee_params,json=feeParams,proto3" json:"fee_params,omitempty"` + // Fee parameters for the Resource module + // Defines fixed fees and burn percentage for resources + FeeParams *FeeParams `protobuf:"bytes,2,opt,name=fee_params,json=feeParams,proto3" json:"fee_params,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } diff --git a/x/resource/types/keys.go b/x/resource/types/keys.go index a9de14ed5..eb327d3e5 100644 --- a/x/resource/types/keys.go +++ b/x/resource/types/keys.go @@ -21,16 +21,16 @@ const ( ) // GetResourceDataKey returns the byte representation of resource key -func GetResourceDataKey(collectionId string, id string) []byte { - return []byte(ResourceDataKey + collectionId + ":" + id) +func GetResourceDataKey(collectionID string, id string) []byte { + return []byte(ResourceDataKey + collectionID + ":" + id) } // GetResourceMetadataKey returns the byte representation of resource key -func GetResourceMetadataKey(collectionId string, id string) []byte { - return []byte(ResourceMetadataKey + collectionId + ":" + id) +func GetResourceMetadataKey(collectionID string, id string) []byte { + return []byte(ResourceMetadataKey + collectionID + ":" + id) } // GetResourceMetadataCollectionPrefix used to iterate over all resource metadatas in a collection -func GetResourceMetadataCollectionPrefix(collectionId string) []byte { - return []byte(ResourceMetadataKey + collectionId + ":") +func GetResourceMetadataCollectionPrefix(collectionID string) []byte { + return []byte(ResourceMetadataKey + collectionID + ":") } diff --git a/x/resource/types/params.go b/x/resource/types/params.go index 5f164279e..b8ed1251a 100644 --- a/x/resource/types/params.go +++ b/x/resource/types/params.go @@ -20,7 +20,7 @@ func ParamKeyTable() paramstypes.KeyTable { func DefaultFeeParams() *FeeParams { return &FeeParams{ Image: sdk.NewCoin(BaseMinimalDenom, sdk.NewInt(DefaultCreateResourceImageFee)), - Json: sdk.NewCoin(BaseMinimalDenom, sdk.NewInt(DefaultCreateResourceJsonFee)), + Json: sdk.NewCoin(BaseMinimalDenom, sdk.NewInt(DefaultCreateResourceJSONFee)), Default: sdk.NewCoin(BaseMinimalDenom, sdk.NewInt(DefaultCreateResourceDefaultFee)), BurnFactor: sdk.MustNewDecFromStr(DefaultBurnFactor), } @@ -64,7 +64,7 @@ func validateImage(i interface{}) error { return nil } -func validateJson(i interface{}) error { +func validateJSON(i interface{}) error { v, ok := i.(sdk.Coin) if !ok { return fmt.Errorf("invalid parameter type: %T", i) @@ -129,7 +129,7 @@ func validateFeeParams(i interface{}) error { return err } - if err := validateJson(v.Json); err != nil { + if err := validateJSON(v.Json); err != nil { return err } diff --git a/x/resource/types/query.pb.go b/x/resource/types/query.pb.go index 8914b6dc6..f888b4a1c 100644 --- a/x/resource/types/query.pb.go +++ b/x/resource/types/query.pb.go @@ -28,23 +28,25 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type QueryGetResourceRequest struct { +type QueryResourceRequest struct { + // is unique identifier a for collection CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // is unique identifier for a resource + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` } -func (m *QueryGetResourceRequest) Reset() { *m = QueryGetResourceRequest{} } -func (m *QueryGetResourceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetResourceRequest) ProtoMessage() {} -func (*QueryGetResourceRequest) Descriptor() ([]byte, []int) { +func (m *QueryResourceRequest) Reset() { *m = QueryResourceRequest{} } +func (m *QueryResourceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryResourceRequest) ProtoMessage() {} +func (*QueryResourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_14284472e64722d9, []int{0} } -func (m *QueryGetResourceRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryResourceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetResourceRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryResourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -54,48 +56,48 @@ func (m *QueryGetResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryGetResourceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetResourceRequest.Merge(m, src) +func (m *QueryResourceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResourceRequest.Merge(m, src) } -func (m *QueryGetResourceRequest) XXX_Size() int { +func (m *QueryResourceRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetResourceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetResourceRequest.DiscardUnknown(m) +func (m *QueryResourceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResourceRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetResourceRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryResourceRequest proto.InternalMessageInfo -func (m *QueryGetResourceRequest) GetCollectionId() string { +func (m *QueryResourceRequest) GetCollectionId() string { if m != nil { return m.CollectionId } return "" } -func (m *QueryGetResourceRequest) GetId() string { +func (m *QueryResourceRequest) GetId() string { if m != nil { return m.Id } return "" } -type QueryGetResourceResponse struct { +type QueryResourceResponse struct { Resource *ResourceWithMetadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` } -func (m *QueryGetResourceResponse) Reset() { *m = QueryGetResourceResponse{} } -func (m *QueryGetResourceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetResourceResponse) ProtoMessage() {} -func (*QueryGetResourceResponse) Descriptor() ([]byte, []int) { +func (m *QueryResourceResponse) Reset() { *m = QueryResourceResponse{} } +func (m *QueryResourceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResourceResponse) ProtoMessage() {} +func (*QueryResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_14284472e64722d9, []int{1} } -func (m *QueryGetResourceResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryResourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetResourceResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -105,42 +107,44 @@ func (m *QueryGetResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *QueryGetResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetResourceResponse.Merge(m, src) +func (m *QueryResourceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResourceResponse.Merge(m, src) } -func (m *QueryGetResourceResponse) XXX_Size() int { +func (m *QueryResourceResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetResourceResponse.DiscardUnknown(m) +func (m *QueryResourceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResourceResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetResourceResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryResourceResponse proto.InternalMessageInfo -func (m *QueryGetResourceResponse) GetResource() *ResourceWithMetadata { +func (m *QueryResourceResponse) GetResource() *ResourceWithMetadata { if m != nil { return m.Resource } return nil } -type QueryGetResourceMetadataRequest struct { +type QueryResourceMetadataRequest struct { + // is unique identifier a for collection CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // is unique identifier for a resource + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` } -func (m *QueryGetResourceMetadataRequest) Reset() { *m = QueryGetResourceMetadataRequest{} } -func (m *QueryGetResourceMetadataRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetResourceMetadataRequest) ProtoMessage() {} -func (*QueryGetResourceMetadataRequest) Descriptor() ([]byte, []int) { +func (m *QueryResourceMetadataRequest) Reset() { *m = QueryResourceMetadataRequest{} } +func (m *QueryResourceMetadataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryResourceMetadataRequest) ProtoMessage() {} +func (*QueryResourceMetadataRequest) Descriptor() ([]byte, []int) { return fileDescriptor_14284472e64722d9, []int{2} } -func (m *QueryGetResourceMetadataRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryResourceMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetResourceMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResourceMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetResourceMetadataRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryResourceMetadataRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -150,48 +154,48 @@ func (m *QueryGetResourceMetadataRequest) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } -func (m *QueryGetResourceMetadataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetResourceMetadataRequest.Merge(m, src) +func (m *QueryResourceMetadataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResourceMetadataRequest.Merge(m, src) } -func (m *QueryGetResourceMetadataRequest) XXX_Size() int { +func (m *QueryResourceMetadataRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetResourceMetadataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetResourceMetadataRequest.DiscardUnknown(m) +func (m *QueryResourceMetadataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResourceMetadataRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetResourceMetadataRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryResourceMetadataRequest proto.InternalMessageInfo -func (m *QueryGetResourceMetadataRequest) GetCollectionId() string { +func (m *QueryResourceMetadataRequest) GetCollectionId() string { if m != nil { return m.CollectionId } return "" } -func (m *QueryGetResourceMetadataRequest) GetId() string { +func (m *QueryResourceMetadataRequest) GetId() string { if m != nil { return m.Id } return "" } -type QueryGetResourceMetadataResponse struct { +type QueryResourceMetadataResponse struct { Resource *Metadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` } -func (m *QueryGetResourceMetadataResponse) Reset() { *m = QueryGetResourceMetadataResponse{} } -func (m *QueryGetResourceMetadataResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetResourceMetadataResponse) ProtoMessage() {} -func (*QueryGetResourceMetadataResponse) Descriptor() ([]byte, []int) { +func (m *QueryResourceMetadataResponse) Reset() { *m = QueryResourceMetadataResponse{} } +func (m *QueryResourceMetadataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResourceMetadataResponse) ProtoMessage() {} +func (*QueryResourceMetadataResponse) Descriptor() ([]byte, []int) { return fileDescriptor_14284472e64722d9, []int{3} } -func (m *QueryGetResourceMetadataResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryResourceMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetResourceMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResourceMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetResourceMetadataResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryResourceMetadataResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -201,41 +205,42 @@ func (m *QueryGetResourceMetadataResponse) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } -func (m *QueryGetResourceMetadataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetResourceMetadataResponse.Merge(m, src) +func (m *QueryResourceMetadataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResourceMetadataResponse.Merge(m, src) } -func (m *QueryGetResourceMetadataResponse) XXX_Size() int { +func (m *QueryResourceMetadataResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetResourceMetadataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetResourceMetadataResponse.DiscardUnknown(m) +func (m *QueryResourceMetadataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResourceMetadataResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetResourceMetadataResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryResourceMetadataResponse proto.InternalMessageInfo -func (m *QueryGetResourceMetadataResponse) GetResource() *Metadata { +func (m *QueryResourceMetadataResponse) GetResource() *Metadata { if m != nil { return m.Resource } return nil } -type QueryGetCollectionResourcesRequest struct { +type QueryCollectionResourcesRequest struct { + // is unique identifier a for collection CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` } -func (m *QueryGetCollectionResourcesRequest) Reset() { *m = QueryGetCollectionResourcesRequest{} } -func (m *QueryGetCollectionResourcesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetCollectionResourcesRequest) ProtoMessage() {} -func (*QueryGetCollectionResourcesRequest) Descriptor() ([]byte, []int) { +func (m *QueryCollectionResourcesRequest) Reset() { *m = QueryCollectionResourcesRequest{} } +func (m *QueryCollectionResourcesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCollectionResourcesRequest) ProtoMessage() {} +func (*QueryCollectionResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_14284472e64722d9, []int{4} } -func (m *QueryGetCollectionResourcesRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryCollectionResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetCollectionResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryCollectionResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetCollectionResourcesRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryCollectionResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -245,41 +250,41 @@ func (m *QueryGetCollectionResourcesRequest) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *QueryGetCollectionResourcesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetCollectionResourcesRequest.Merge(m, src) +func (m *QueryCollectionResourcesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollectionResourcesRequest.Merge(m, src) } -func (m *QueryGetCollectionResourcesRequest) XXX_Size() int { +func (m *QueryCollectionResourcesRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetCollectionResourcesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetCollectionResourcesRequest.DiscardUnknown(m) +func (m *QueryCollectionResourcesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollectionResourcesRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetCollectionResourcesRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryCollectionResourcesRequest proto.InternalMessageInfo -func (m *QueryGetCollectionResourcesRequest) GetCollectionId() string { +func (m *QueryCollectionResourcesRequest) GetCollectionId() string { if m != nil { return m.CollectionId } return "" } -type QueryGetCollectionResourcesResponse struct { +type QueryCollectionResourcesResponse struct { Resources []*Metadata `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` } -func (m *QueryGetCollectionResourcesResponse) Reset() { *m = QueryGetCollectionResourcesResponse{} } -func (m *QueryGetCollectionResourcesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetCollectionResourcesResponse) ProtoMessage() {} -func (*QueryGetCollectionResourcesResponse) Descriptor() ([]byte, []int) { +func (m *QueryCollectionResourcesResponse) Reset() { *m = QueryCollectionResourcesResponse{} } +func (m *QueryCollectionResourcesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCollectionResourcesResponse) ProtoMessage() {} +func (*QueryCollectionResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_14284472e64722d9, []int{5} } -func (m *QueryGetCollectionResourcesResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryCollectionResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetCollectionResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryCollectionResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetCollectionResourcesResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryCollectionResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -289,19 +294,19 @@ func (m *QueryGetCollectionResourcesResponse) XXX_Marshal(b []byte, deterministi return b[:n], nil } } -func (m *QueryGetCollectionResourcesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetCollectionResourcesResponse.Merge(m, src) +func (m *QueryCollectionResourcesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollectionResourcesResponse.Merge(m, src) } -func (m *QueryGetCollectionResourcesResponse) XXX_Size() int { +func (m *QueryCollectionResourcesResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetCollectionResourcesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetCollectionResourcesResponse.DiscardUnknown(m) +func (m *QueryCollectionResourcesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollectionResourcesResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetCollectionResourcesResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryCollectionResourcesResponse proto.InternalMessageInfo -func (m *QueryGetCollectionResourcesResponse) GetResources() []*Metadata { +func (m *QueryCollectionResourcesResponse) GetResources() []*Metadata { if m != nil { return m.Resources } @@ -309,47 +314,47 @@ func (m *QueryGetCollectionResourcesResponse) GetResources() []*Metadata { } func init() { - proto.RegisterType((*QueryGetResourceRequest)(nil), "cheqd.resource.v2.QueryGetResourceRequest") - proto.RegisterType((*QueryGetResourceResponse)(nil), "cheqd.resource.v2.QueryGetResourceResponse") - proto.RegisterType((*QueryGetResourceMetadataRequest)(nil), "cheqd.resource.v2.QueryGetResourceMetadataRequest") - proto.RegisterType((*QueryGetResourceMetadataResponse)(nil), "cheqd.resource.v2.QueryGetResourceMetadataResponse") - proto.RegisterType((*QueryGetCollectionResourcesRequest)(nil), "cheqd.resource.v2.QueryGetCollectionResourcesRequest") - proto.RegisterType((*QueryGetCollectionResourcesResponse)(nil), "cheqd.resource.v2.QueryGetCollectionResourcesResponse") + proto.RegisterType((*QueryResourceRequest)(nil), "cheqd.resource.v2.QueryResourceRequest") + proto.RegisterType((*QueryResourceResponse)(nil), "cheqd.resource.v2.QueryResourceResponse") + proto.RegisterType((*QueryResourceMetadataRequest)(nil), "cheqd.resource.v2.QueryResourceMetadataRequest") + proto.RegisterType((*QueryResourceMetadataResponse)(nil), "cheqd.resource.v2.QueryResourceMetadataResponse") + proto.RegisterType((*QueryCollectionResourcesRequest)(nil), "cheqd.resource.v2.QueryCollectionResourcesRequest") + proto.RegisterType((*QueryCollectionResourcesResponse)(nil), "cheqd.resource.v2.QueryCollectionResourcesResponse") } func init() { proto.RegisterFile("cheqd/resource/v2/query.proto", fileDescriptor_14284472e64722d9) } var fileDescriptor_14284472e64722d9 = []byte{ - // 453 bytes of a gzipped FileDescriptorProto + // 449 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0x48, 0x2d, 0x4c, 0xd1, 0x2f, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2f, 0x33, 0xd2, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0x4b, 0xeb, 0xc1, 0xa4, 0xf5, 0xca, 0x8c, 0xa4, 0x14, 0x30, 0x75, 0xc0, 0xa5, 0xc1, 0x9a, 0xa4, 0x64, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0x13, 0x0b, 0x32, 0xf5, 0x13, 0xf3, 0xf2, 0xf2, 0x4b, 0x12, 0x4b, 0x32, - 0xf3, 0xf3, 0x8a, 0x21, 0xb2, 0x4a, 0x7e, 0x5c, 0xe2, 0x81, 0x20, 0x1b, 0xdc, 0x53, 0x4b, 0x82, - 0xa0, 0xfa, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x94, 0xb9, 0x78, 0x93, 0xf3, 0x73, - 0x72, 0x52, 0x93, 0x41, 0xea, 0xe3, 0x33, 0x53, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x78, - 0x10, 0x82, 0x9e, 0x29, 0x42, 0x7c, 0x5c, 0x4c, 0x99, 0x29, 0x12, 0x4c, 0x60, 0x19, 0xa6, 0xcc, - 0x14, 0xa5, 0x78, 0x2e, 0x09, 0x4c, 0xf3, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x9c, 0xb9, - 0x38, 0x60, 0x6e, 0x03, 0x9b, 0xc5, 0x6d, 0xa4, 0xae, 0x87, 0xe1, 0x23, 0x3d, 0x98, 0xb6, 0xf0, - 0xcc, 0x92, 0x0c, 0xdf, 0xd4, 0x92, 0xc4, 0x94, 0xc4, 0x92, 0xc4, 0x20, 0xb8, 0x46, 0xa5, 0x30, - 0x2e, 0x79, 0x74, 0x0b, 0xe0, 0xaa, 0x28, 0x71, 0x78, 0x34, 0x97, 0x02, 0x6e, 0x73, 0xa1, 0x1e, - 0x30, 0xc7, 0xf0, 0x80, 0x34, 0x16, 0x0f, 0x60, 0x71, 0xb4, 0x27, 0x97, 0x12, 0xcc, 0x70, 0x67, - 0xb8, 0x23, 0x60, 0xd6, 0x14, 0x93, 0xe2, 0x6e, 0xa5, 0x04, 0x2e, 0x65, 0xbc, 0x46, 0x41, 0x9d, - 0x6a, 0xc9, 0xc5, 0x09, 0xb3, 0xbd, 0x58, 0x82, 0x51, 0x81, 0x99, 0x90, 0x5b, 0x11, 0xaa, 0x8d, - 0x96, 0xb1, 0x70, 0xb1, 0x82, 0xad, 0x10, 0x9a, 0xc7, 0xc8, 0xc5, 0x01, 0x33, 0x5a, 0x48, 0x0b, - 0x8b, 0x76, 0x1c, 0x49, 0x47, 0x4a, 0x9b, 0x28, 0xb5, 0x10, 0xa7, 0x2a, 0x59, 0x36, 0x5d, 0x7e, - 0x32, 0x99, 0xc9, 0x58, 0xc8, 0x50, 0x1f, 0x33, 0x2d, 0x57, 0xa3, 0x04, 0x48, 0x2d, 0x5c, 0xae, - 0x58, 0xbf, 0x3a, 0x33, 0xa5, 0x56, 0x68, 0x3f, 0x23, 0x97, 0x00, 0x7a, 0x6c, 0x09, 0x19, 0x11, - 0x61, 0x39, 0x5a, 0x92, 0x91, 0x32, 0x26, 0x49, 0x0f, 0xd4, 0xe1, 0x4e, 0x60, 0x87, 0xdb, 0x08, - 0x59, 0x91, 0xec, 0x70, 0xfd, 0x5c, 0x98, 0x63, 0x77, 0x32, 0x72, 0x09, 0x63, 0x89, 0x47, 0x21, - 0x53, 0x3c, 0x0e, 0xc2, 0x9d, 0x84, 0xa4, 0xcc, 0x48, 0xd5, 0x06, 0xf5, 0x8a, 0x31, 0xd8, 0x2b, - 0xba, 0x42, 0xda, 0x44, 0x78, 0x05, 0xe6, 0x76, 0x27, 0xb7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, - 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, - 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0x85, - 0x1a, 0x08, 0x26, 0x75, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x2b, 0x10, 0xa6, 0x97, 0x54, 0x16, 0xa4, - 0x16, 0x27, 0xb1, 0x81, 0x8b, 0x22, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x08, 0xfa, - 0x7b, 0xfe, 0x04, 0x00, 0x00, + 0xf3, 0xf3, 0x8a, 0x21, 0xb2, 0x4a, 0xde, 0x5c, 0x22, 0x81, 0x20, 0x1b, 0x82, 0xa0, 0x9a, 0x82, + 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x94, 0xb9, 0x78, 0x93, 0xf3, 0x73, 0x72, 0x52, 0x93, + 0x41, 0x8a, 0xe3, 0x33, 0x53, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x78, 0x10, 0x82, 0x9e, + 0x29, 0x42, 0x7c, 0x5c, 0x4c, 0x99, 0x29, 0x12, 0x4c, 0x60, 0x19, 0xa6, 0xcc, 0x14, 0xa5, 0x18, + 0x2e, 0x51, 0x34, 0xc3, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x9c, 0xb9, 0x38, 0x60, 0xae, + 0x02, 0x1b, 0xc4, 0x6d, 0xa4, 0xae, 0x87, 0xe1, 0x17, 0x3d, 0x98, 0xb6, 0xf0, 0xcc, 0x92, 0x0c, + 0xdf, 0xd4, 0x92, 0xc4, 0x94, 0xc4, 0x92, 0xc4, 0x20, 0xb8, 0x46, 0xa5, 0x60, 0x2e, 0x19, 0x14, + 0xd3, 0xe1, 0x4a, 0x28, 0x71, 0x72, 0x04, 0x97, 0x2c, 0x0e, 0x43, 0xa1, 0x4e, 0x37, 0xc7, 0x70, + 0xba, 0x34, 0x16, 0xa7, 0x63, 0x71, 0xae, 0x1b, 0x97, 0x3c, 0xd8, 0x64, 0x67, 0xb8, 0xf5, 0x30, + 0x3b, 0x8a, 0x49, 0x71, 0xb1, 0x52, 0x2c, 0x97, 0x02, 0x6e, 0x73, 0xa0, 0x8e, 0xb4, 0xe4, 0xe2, + 0x84, 0xd9, 0x5b, 0x2c, 0xc1, 0xa8, 0xc0, 0x4c, 0xc8, 0x95, 0x08, 0xd5, 0x46, 0x53, 0x58, 0xb8, + 0x58, 0xc1, 0xe6, 0x0b, 0xcd, 0x60, 0xe4, 0xe2, 0x80, 0x19, 0x2d, 0x84, 0x2d, 0x7e, 0xb0, 0x25, + 0x14, 0x29, 0x0d, 0xc2, 0x0a, 0x21, 0x8e, 0x54, 0xb2, 0x6c, 0xba, 0xfc, 0x64, 0x32, 0x93, 0xb1, + 0x90, 0xa1, 0x3e, 0x66, 0x9a, 0xad, 0x46, 0x09, 0x87, 0x5a, 0xb8, 0x5c, 0xb1, 0x7e, 0x75, 0x66, + 0x4a, 0xad, 0xd0, 0x4e, 0x46, 0x2e, 0x01, 0xf4, 0x18, 0x12, 0xd2, 0x27, 0x64, 0x33, 0x5a, 0x02, + 0x91, 0x32, 0x20, 0x5e, 0x03, 0xd4, 0xc9, 0x4e, 0x60, 0x27, 0xdb, 0x08, 0x59, 0x91, 0xec, 0x64, + 0xfd, 0x5c, 0x98, 0x33, 0x37, 0x33, 0x72, 0x09, 0x63, 0x89, 0x3b, 0x21, 0x23, 0x5c, 0xae, 0xc1, + 0x9d, 0x60, 0xa4, 0x8c, 0x49, 0xd2, 0x03, 0xf5, 0x84, 0x31, 0xd8, 0x13, 0xba, 0x42, 0xda, 0x44, + 0x78, 0x02, 0xe6, 0x6a, 0x27, 0xb7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, + 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, + 0xd2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0x85, 0x1a, 0x08, 0x26, 0x75, + 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x2b, 0x10, 0xa6, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, + 0x8b, 0x19, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xda, 0xf9, 0xe7, 0x82, 0xda, 0x04, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -364,9 +369,9 @@ 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 QueryClient interface { - Resource(ctx context.Context, in *QueryGetResourceRequest, opts ...grpc.CallOption) (*QueryGetResourceResponse, error) - ResourceMetadata(ctx context.Context, in *QueryGetResourceMetadataRequest, opts ...grpc.CallOption) (*QueryGetResourceMetadataResponse, error) - CollectionResources(ctx context.Context, in *QueryGetCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryGetCollectionResourcesResponse, error) + Resource(ctx context.Context, in *QueryResourceRequest, opts ...grpc.CallOption) (*QueryResourceResponse, error) + ResourceMetadata(ctx context.Context, in *QueryResourceMetadataRequest, opts ...grpc.CallOption) (*QueryResourceMetadataResponse, error) + CollectionResources(ctx context.Context, in *QueryCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryCollectionResourcesResponse, error) } type queryClient struct { @@ -377,8 +382,8 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Resource(ctx context.Context, in *QueryGetResourceRequest, opts ...grpc.CallOption) (*QueryGetResourceResponse, error) { - out := new(QueryGetResourceResponse) +func (c *queryClient) Resource(ctx context.Context, in *QueryResourceRequest, opts ...grpc.CallOption) (*QueryResourceResponse, error) { + out := new(QueryResourceResponse) err := c.cc.Invoke(ctx, "/cheqd.resource.v2.Query/Resource", in, out, opts...) if err != nil { return nil, err @@ -386,8 +391,8 @@ func (c *queryClient) Resource(ctx context.Context, in *QueryGetResourceRequest, return out, nil } -func (c *queryClient) ResourceMetadata(ctx context.Context, in *QueryGetResourceMetadataRequest, opts ...grpc.CallOption) (*QueryGetResourceMetadataResponse, error) { - out := new(QueryGetResourceMetadataResponse) +func (c *queryClient) ResourceMetadata(ctx context.Context, in *QueryResourceMetadataRequest, opts ...grpc.CallOption) (*QueryResourceMetadataResponse, error) { + out := new(QueryResourceMetadataResponse) err := c.cc.Invoke(ctx, "/cheqd.resource.v2.Query/ResourceMetadata", in, out, opts...) if err != nil { return nil, err @@ -395,8 +400,8 @@ func (c *queryClient) ResourceMetadata(ctx context.Context, in *QueryGetResource return out, nil } -func (c *queryClient) CollectionResources(ctx context.Context, in *QueryGetCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryGetCollectionResourcesResponse, error) { - out := new(QueryGetCollectionResourcesResponse) +func (c *queryClient) CollectionResources(ctx context.Context, in *QueryCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryCollectionResourcesResponse, error) { + out := new(QueryCollectionResourcesResponse) err := c.cc.Invoke(ctx, "/cheqd.resource.v2.Query/CollectionResources", in, out, opts...) if err != nil { return nil, err @@ -406,22 +411,22 @@ func (c *queryClient) CollectionResources(ctx context.Context, in *QueryGetColle // QueryServer is the server API for Query service. type QueryServer interface { - Resource(context.Context, *QueryGetResourceRequest) (*QueryGetResourceResponse, error) - ResourceMetadata(context.Context, *QueryGetResourceMetadataRequest) (*QueryGetResourceMetadataResponse, error) - CollectionResources(context.Context, *QueryGetCollectionResourcesRequest) (*QueryGetCollectionResourcesResponse, error) + Resource(context.Context, *QueryResourceRequest) (*QueryResourceResponse, error) + ResourceMetadata(context.Context, *QueryResourceMetadataRequest) (*QueryResourceMetadataResponse, error) + CollectionResources(context.Context, *QueryCollectionResourcesRequest) (*QueryCollectionResourcesResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Resource(ctx context.Context, req *QueryGetResourceRequest) (*QueryGetResourceResponse, error) { +func (*UnimplementedQueryServer) Resource(ctx context.Context, req *QueryResourceRequest) (*QueryResourceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resource not implemented") } -func (*UnimplementedQueryServer) ResourceMetadata(ctx context.Context, req *QueryGetResourceMetadataRequest) (*QueryGetResourceMetadataResponse, error) { +func (*UnimplementedQueryServer) ResourceMetadata(ctx context.Context, req *QueryResourceMetadataRequest) (*QueryResourceMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ResourceMetadata not implemented") } -func (*UnimplementedQueryServer) CollectionResources(ctx context.Context, req *QueryGetCollectionResourcesRequest) (*QueryGetCollectionResourcesResponse, error) { +func (*UnimplementedQueryServer) CollectionResources(ctx context.Context, req *QueryCollectionResourcesRequest) (*QueryCollectionResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CollectionResources not implemented") } @@ -430,7 +435,7 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { } func _Query_Resource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetResourceRequest) + in := new(QueryResourceRequest) if err := dec(in); err != nil { return nil, err } @@ -442,13 +447,13 @@ func _Query_Resource_Handler(srv interface{}, ctx context.Context, dec func(inte FullMethod: "/cheqd.resource.v2.Query/Resource", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Resource(ctx, req.(*QueryGetResourceRequest)) + return srv.(QueryServer).Resource(ctx, req.(*QueryResourceRequest)) } return interceptor(ctx, in, info, handler) } func _Query_ResourceMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetResourceMetadataRequest) + in := new(QueryResourceMetadataRequest) if err := dec(in); err != nil { return nil, err } @@ -460,13 +465,13 @@ func _Query_ResourceMetadata_Handler(srv interface{}, ctx context.Context, dec f FullMethod: "/cheqd.resource.v2.Query/ResourceMetadata", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ResourceMetadata(ctx, req.(*QueryGetResourceMetadataRequest)) + return srv.(QueryServer).ResourceMetadata(ctx, req.(*QueryResourceMetadataRequest)) } return interceptor(ctx, in, info, handler) } func _Query_CollectionResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetCollectionResourcesRequest) + in := new(QueryCollectionResourcesRequest) if err := dec(in); err != nil { return nil, err } @@ -478,7 +483,7 @@ func _Query_CollectionResources_Handler(srv interface{}, ctx context.Context, de FullMethod: "/cheqd.resource.v2.Query/CollectionResources", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).CollectionResources(ctx, req.(*QueryGetCollectionResourcesRequest)) + return srv.(QueryServer).CollectionResources(ctx, req.(*QueryCollectionResourcesRequest)) } return interceptor(ctx, in, info, handler) } @@ -504,7 +509,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "cheqd/resource/v2/query.proto", } -func (m *QueryGetResourceRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryResourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -514,12 +519,12 @@ func (m *QueryGetResourceRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetResourceRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResourceRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -541,7 +546,7 @@ func (m *QueryGetResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryGetResourceResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -551,12 +556,12 @@ func (m *QueryGetResourceResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetResourceResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResourceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -576,7 +581,7 @@ func (m *QueryGetResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *QueryGetResourceMetadataRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryResourceMetadataRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -586,12 +591,12 @@ func (m *QueryGetResourceMetadataRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetResourceMetadataRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResourceMetadataRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetResourceMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResourceMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -613,7 +618,7 @@ func (m *QueryGetResourceMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } -func (m *QueryGetResourceMetadataResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryResourceMetadataResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -623,12 +628,12 @@ func (m *QueryGetResourceMetadataResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetResourceMetadataResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResourceMetadataResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetResourceMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResourceMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -648,7 +653,7 @@ func (m *QueryGetResourceMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryGetCollectionResourcesRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryCollectionResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -658,12 +663,12 @@ func (m *QueryGetCollectionResourcesRequest) Marshal() (dAtA []byte, err error) return dAtA[:n], nil } -func (m *QueryGetCollectionResourcesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryCollectionResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetCollectionResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryCollectionResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -678,7 +683,7 @@ func (m *QueryGetCollectionResourcesRequest) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } -func (m *QueryGetCollectionResourcesResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryCollectionResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -688,12 +693,12 @@ func (m *QueryGetCollectionResourcesResponse) Marshal() (dAtA []byte, err error) return dAtA[:n], nil } -func (m *QueryGetCollectionResourcesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryCollectionResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetCollectionResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryCollectionResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -726,7 +731,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryGetResourceRequest) Size() (n int) { +func (m *QueryResourceRequest) Size() (n int) { if m == nil { return 0 } @@ -743,7 +748,7 @@ func (m *QueryGetResourceRequest) Size() (n int) { return n } -func (m *QueryGetResourceResponse) Size() (n int) { +func (m *QueryResourceResponse) Size() (n int) { if m == nil { return 0 } @@ -756,7 +761,7 @@ func (m *QueryGetResourceResponse) Size() (n int) { return n } -func (m *QueryGetResourceMetadataRequest) Size() (n int) { +func (m *QueryResourceMetadataRequest) Size() (n int) { if m == nil { return 0 } @@ -773,7 +778,7 @@ func (m *QueryGetResourceMetadataRequest) Size() (n int) { return n } -func (m *QueryGetResourceMetadataResponse) Size() (n int) { +func (m *QueryResourceMetadataResponse) Size() (n int) { if m == nil { return 0 } @@ -786,7 +791,7 @@ func (m *QueryGetResourceMetadataResponse) Size() (n int) { return n } -func (m *QueryGetCollectionResourcesRequest) Size() (n int) { +func (m *QueryCollectionResourcesRequest) Size() (n int) { if m == nil { return 0 } @@ -799,7 +804,7 @@ func (m *QueryGetCollectionResourcesRequest) Size() (n int) { return n } -func (m *QueryGetCollectionResourcesResponse) Size() (n int) { +func (m *QueryCollectionResourcesResponse) Size() (n int) { if m == nil { return 0 } @@ -820,7 +825,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryGetResourceRequest) Unmarshal(dAtA []byte) error { +func (m *QueryResourceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -843,10 +848,10 @@ func (m *QueryGetResourceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetResourceRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResourceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -934,7 +939,7 @@ func (m *QueryGetResourceRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetResourceResponse) Unmarshal(dAtA []byte) error { +func (m *QueryResourceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -957,10 +962,10 @@ func (m *QueryGetResourceResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetResourceResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResourceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1020,7 +1025,7 @@ func (m *QueryGetResourceResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetResourceMetadataRequest) Unmarshal(dAtA []byte) error { +func (m *QueryResourceMetadataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1043,10 +1048,10 @@ func (m *QueryGetResourceMetadataRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetResourceMetadataRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResourceMetadataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetResourceMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResourceMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1134,7 +1139,7 @@ func (m *QueryGetResourceMetadataRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetResourceMetadataResponse) Unmarshal(dAtA []byte) error { +func (m *QueryResourceMetadataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1157,10 +1162,10 @@ func (m *QueryGetResourceMetadataResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetResourceMetadataResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResourceMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetResourceMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResourceMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1220,7 +1225,7 @@ func (m *QueryGetResourceMetadataResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetCollectionResourcesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryCollectionResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1243,10 +1248,10 @@ func (m *QueryGetCollectionResourcesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetCollectionResourcesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryCollectionResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetCollectionResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryCollectionResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1302,7 +1307,7 @@ func (m *QueryGetCollectionResourcesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetCollectionResourcesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryCollectionResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1325,10 +1330,10 @@ func (m *QueryGetCollectionResourcesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetCollectionResourcesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryCollectionResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetCollectionResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryCollectionResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/resource/types/query.pb.gw.go b/x/resource/types/query.pb.gw.go index 85817d760..47f1996e3 100644 --- a/x/resource/types/query.pb.gw.go +++ b/x/resource/types/query.pb.gw.go @@ -34,7 +34,7 @@ var _ = descriptor.ForMessage var _ = metadata.Join func request_Query_Resource_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetResourceRequest + var protoReq QueryResourceRequest var metadata runtime.ServerMetadata var ( @@ -72,7 +72,7 @@ func request_Query_Resource_0(ctx context.Context, marshaler runtime.Marshaler, } func local_request_Query_Resource_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetResourceRequest + var protoReq QueryResourceRequest var metadata runtime.ServerMetadata var ( @@ -110,7 +110,7 @@ func local_request_Query_Resource_0(ctx context.Context, marshaler runtime.Marsh } func request_Query_ResourceMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetResourceMetadataRequest + var protoReq QueryResourceMetadataRequest var metadata runtime.ServerMetadata var ( @@ -148,7 +148,7 @@ func request_Query_ResourceMetadata_0(ctx context.Context, marshaler runtime.Mar } func local_request_Query_ResourceMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetResourceMetadataRequest + var protoReq QueryResourceMetadataRequest var metadata runtime.ServerMetadata var ( @@ -186,7 +186,7 @@ func local_request_Query_ResourceMetadata_0(ctx context.Context, marshaler runti } func request_Query_CollectionResources_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetCollectionResourcesRequest + var protoReq QueryCollectionResourcesRequest var metadata runtime.ServerMetadata var ( @@ -213,7 +213,7 @@ func request_Query_CollectionResources_0(ctx context.Context, marshaler runtime. } func local_request_Query_CollectionResources_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetCollectionResourcesRequest + var protoReq QueryCollectionResourcesRequest var metadata runtime.ServerMetadata var ( diff --git a/x/resource/types/query_get_collection_resources.go b/x/resource/types/query_get_collection_resources.go index 94dfc6773..1f4236577 100644 --- a/x/resource/types/query_get_collection_resources.go +++ b/x/resource/types/query_get_collection_resources.go @@ -4,6 +4,6 @@ import ( "github.com/cheqd/cheqd-node/x/did/utils" ) -func (query *QueryGetCollectionResourcesRequest) Normalize() { - query.CollectionId = utils.NormalizeId(query.CollectionId) +func (query *QueryCollectionResourcesRequest) Normalize() { + query.CollectionId = utils.NormalizeID(query.CollectionId) } diff --git a/x/resource/types/query_get_resource_metadata_request.go b/x/resource/types/query_get_resource_metadata_request.go index 7b48f6d53..61e075bd2 100644 --- a/x/resource/types/query_get_resource_metadata_request.go +++ b/x/resource/types/query_get_resource_metadata_request.go @@ -2,7 +2,7 @@ package types import "github.com/cheqd/cheqd-node/x/did/utils" -func (query *QueryGetResourceMetadataRequest) Normalize() { - query.CollectionId = utils.NormalizeId(query.CollectionId) +func (query *QueryResourceMetadataRequest) Normalize() { + query.CollectionId = utils.NormalizeID(query.CollectionId) query.Id = utils.NormalizeUUID(query.Id) } diff --git a/x/resource/types/query_get_resource_request.go b/x/resource/types/query_get_resource_request.go index f5793ae07..ffdc15e68 100644 --- a/x/resource/types/query_get_resource_request.go +++ b/x/resource/types/query_get_resource_request.go @@ -4,7 +4,7 @@ import ( "github.com/cheqd/cheqd-node/x/did/utils" ) -func (query *QueryGetResourceRequest) Normalize() { - query.CollectionId = utils.NormalizeId(query.CollectionId) +func (query *QueryResourceRequest) Normalize() { + query.CollectionId = utils.NormalizeID(query.CollectionId) query.Id = utils.NormalizeUUID(query.Id) } diff --git a/x/resource/types/resource.pb.go b/x/resource/types/resource.pb.go index 7fbbc139e..dfdf3b2c2 100644 --- a/x/resource/types/resource.pb.go +++ b/x/resource/types/resource.pb.go @@ -5,16 +5,21 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "github.com/cosmos/gogoproto/types" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -22,50 +27,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type Resource struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *Resource) Reset() { *m = Resource{} } -func (m *Resource) String() string { return proto.CompactTextString(m) } -func (*Resource) ProtoMessage() {} -func (*Resource) Descriptor() ([]byte, []int) { - return fileDescriptor_abfe0b32f2a40f67, []int{0} -} -func (m *Resource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Resource.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 *Resource) XXX_Merge(src proto.Message) { - xxx_messageInfo_Resource.Merge(m, src) -} -func (m *Resource) XXX_Size() int { - return m.Size() -} -func (m *Resource) XXX_DiscardUnknown() { - xxx_messageInfo_Resource.DiscardUnknown(m) -} - -var xxx_messageInfo_Resource proto.InternalMessageInfo - -func (m *Resource) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - +// ResourceWithMetadata describes the overall structure of a DID-Linked Resource type ResourceWithMetadata struct { Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` @@ -75,7 +37,7 @@ func (m *ResourceWithMetadata) Reset() { *m = ResourceWithMetadata{} } func (m *ResourceWithMetadata) String() string { return proto.CompactTextString(m) } func (*ResourceWithMetadata) ProtoMessage() {} func (*ResourceWithMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_abfe0b32f2a40f67, []int{1} + return fileDescriptor_abfe0b32f2a40f67, []int{0} } func (m *ResourceWithMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -118,23 +80,24 @@ func (m *ResourceWithMetadata) GetMetadata() *Metadata { return nil } -type AlternativeUri struct { - Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +// Resource stores the contents of a DID-Linked Resource +type Resource struct { + // bytes is the raw data of the Resource + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } -func (m *AlternativeUri) Reset() { *m = AlternativeUri{} } -func (m *AlternativeUri) String() string { return proto.CompactTextString(m) } -func (*AlternativeUri) ProtoMessage() {} -func (*AlternativeUri) Descriptor() ([]byte, []int) { - return fileDescriptor_abfe0b32f2a40f67, []int{2} +func (m *Resource) Reset() { *m = Resource{} } +func (m *Resource) String() string { return proto.CompactTextString(m) } +func (*Resource) ProtoMessage() {} +func (*Resource) Descriptor() ([]byte, []int) { + return fileDescriptor_abfe0b32f2a40f67, []int{1} } -func (m *AlternativeUri) XXX_Unmarshal(b []byte) error { +func (m *Resource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AlternativeUri) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AlternativeUri.Marshal(b, m, deterministic) + return xxx_messageInfo_Resource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -144,51 +107,73 @@ func (m *AlternativeUri) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *AlternativeUri) XXX_Merge(src proto.Message) { - xxx_messageInfo_AlternativeUri.Merge(m, src) +func (m *Resource) XXX_Merge(src proto.Message) { + xxx_messageInfo_Resource.Merge(m, src) } -func (m *AlternativeUri) XXX_Size() int { +func (m *Resource) XXX_Size() int { return m.Size() } -func (m *AlternativeUri) XXX_DiscardUnknown() { - xxx_messageInfo_AlternativeUri.DiscardUnknown(m) +func (m *Resource) XXX_DiscardUnknown() { + xxx_messageInfo_Resource.DiscardUnknown(m) } -var xxx_messageInfo_AlternativeUri proto.InternalMessageInfo - -func (m *AlternativeUri) GetUri() string { - if m != nil { - return m.Uri - } - return "" -} +var xxx_messageInfo_Resource proto.InternalMessageInfo -func (m *AlternativeUri) GetDescription() string { +func (m *Resource) GetData() []byte { if m != nil { - return m.Description + return m.Data } - return "" + return nil } +// Metadata stores the metadata of a DID-Linked Resource type Metadata struct { - CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - ResourceType string `protobuf:"bytes,5,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` - AlsoKnownAs []*AlternativeUri `protobuf:"bytes,6,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` - MediaType string `protobuf:"bytes,7,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` - Created string `protobuf:"bytes,8,opt,name=created,proto3" json:"created,omitempty"` - Checksum string `protobuf:"bytes,9,opt,name=checksum,proto3" json:"checksum,omitempty"` - PreviousVersionId string `protobuf:"bytes,10,opt,name=previous_version_id,json=previousVersionId,proto3" json:"previous_version_id,omitempty"` - NextVersionId string `protobuf:"bytes,11,opt,name=next_version_id,json=nextVersionId,proto3" json:"next_version_id,omitempty"` + // collection_id is the ID of the collection that the Resource belongs to. Defined client-side. + // This field is the unique identifier of the DID linked to this Resource + CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + // id is the ID of the Resource. Defined client-side. + // This field is a unique identifier for this specific version of the Resource. + // Format: + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // name is a human-readable name for the Resource. Defined client-side. + // Does not change between different versions. + // Example: PassportSchema, EducationTrustRegistry + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // version is a human-readable semantic version for the Resource. Defined client-side. + // Stored as a string. OPTIONAL. + // Example: 1.0.0, v2.1.0 + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + // resource_type is a Resource type that identifies what the Resource is. Defined client-side. + // This is NOT the same as the resource's media type. + // Example: AnonCredsSchema, StatusList2021 + ResourceType string `protobuf:"bytes,5,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + // List of alternative URIs for the SAME Resource. + AlsoKnownAs []*AlternativeUri `protobuf:"bytes,6,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` + // media_type is IANA media type of the Resource. Defined ledger-side. + // Example: application/json, image/png + MediaType string `protobuf:"bytes,7,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` + // created is the time at which the Resource was created. Defined ledger-side. + // Format: RFC3339 + // Example: 2021-01-01T00:00:00Z + Created time.Time `protobuf:"bytes,8,opt,name=created,proto3,stdtime" json:"created"` + // checksum is a SHA-256 checksum hash of the Resource. Defined ledger-side. + // Example: d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f + Checksum string `protobuf:"bytes,9,opt,name=checksum,proto3" json:"checksum,omitempty"` + // previous_version_id is the ID of the previous version of the Resource. Defined ledger-side. + // This is based on the Resource's name and Resource type to determine whether it's the same Resource. + // Format: + PreviousVersionId string `protobuf:"bytes,10,opt,name=previous_version_id,json=previousVersionId,proto3" json:"previous_version_id,omitempty"` + // next_version_id is the ID of the next version of the Resource. Defined ledger-side. + // This is based on the Resource's name and Resource type to determine whether it's the same Resource. + // Format: + NextVersionId string `protobuf:"bytes,11,opt,name=next_version_id,json=nextVersionId,proto3" json:"next_version_id,omitempty"` } func (m *Metadata) Reset() { *m = Metadata{} } func (m *Metadata) String() string { return proto.CompactTextString(m) } func (*Metadata) ProtoMessage() {} func (*Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_abfe0b32f2a40f67, []int{3} + return fileDescriptor_abfe0b32f2a40f67, []int{2} } func (m *Metadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -266,11 +251,11 @@ func (m *Metadata) GetMediaType() string { return "" } -func (m *Metadata) GetCreated() string { +func (m *Metadata) GetCreated() time.Time { if m != nil { return m.Created } - return "" + return time.Time{} } func (m *Metadata) GetChecksum() string { @@ -294,75 +279,116 @@ func (m *Metadata) GetNextVersionId() string { return "" } -func init() { - proto.RegisterType((*Resource)(nil), "cheqd.resource.v2.Resource") - proto.RegisterType((*ResourceWithMetadata)(nil), "cheqd.resource.v2.ResourceWithMetadata") - proto.RegisterType((*AlternativeUri)(nil), "cheqd.resource.v2.AlternativeUri") - proto.RegisterType((*Metadata)(nil), "cheqd.resource.v2.Metadata") +// AlternativeUri are alternative URIs that can be used to access the Resource. +// By default, at least the DID URI equivalent of the Resource is populated. +type AlternativeUri struct { + // uri is the URI of the Resource. + // Examples: + // - did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + // - https://resolver..cheqd.net/1.0/identifiers/did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e + // - https://example.com/example.json + // - https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + // - ipfs://bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // description is a human-readable description of the URI. Defined client-side. + // Examples: + // - did-uri + // - http-uri + // - ipfs-uri + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` } -func init() { proto.RegisterFile("cheqd/resource/v2/resource.proto", fileDescriptor_abfe0b32f2a40f67) } +func (m *AlternativeUri) Reset() { *m = AlternativeUri{} } +func (m *AlternativeUri) String() string { return proto.CompactTextString(m) } +func (*AlternativeUri) ProtoMessage() {} +func (*AlternativeUri) Descriptor() ([]byte, []int) { + return fileDescriptor_abfe0b32f2a40f67, []int{3} +} +func (m *AlternativeUri) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AlternativeUri) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AlternativeUri.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 *AlternativeUri) XXX_Merge(src proto.Message) { + xxx_messageInfo_AlternativeUri.Merge(m, src) +} +func (m *AlternativeUri) XXX_Size() int { + return m.Size() +} +func (m *AlternativeUri) XXX_DiscardUnknown() { + xxx_messageInfo_AlternativeUri.DiscardUnknown(m) +} -var fileDescriptor_abfe0b32f2a40f67 = []byte{ - // 446 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0x93, 0xd2, 0x38, 0xe3, 0xa6, 0xd0, 0x85, 0xc3, 0x0a, 0x84, 0x15, 0x82, 0x84, 0x7a, - 0x00, 0x47, 0x0a, 0x07, 0xce, 0x45, 0x80, 0x54, 0x21, 0x2e, 0x16, 0x3f, 0x12, 0x17, 0x6b, 0xbb, - 0x3b, 0x22, 0xab, 0xc6, 0x5e, 0xb3, 0xbb, 0x36, 0xed, 0x0b, 0x20, 0x8e, 0x3c, 0x16, 0xc7, 0x1e, - 0x39, 0xa2, 0xe4, 0x45, 0xd0, 0xae, 0x7f, 0x1a, 0x04, 0x5c, 0xac, 0x99, 0x6f, 0xbe, 0x1f, 0xcf, - 0x68, 0x61, 0xc6, 0x57, 0xf8, 0x59, 0x2c, 0x34, 0x1a, 0x55, 0x69, 0x8e, 0x8b, 0x7a, 0xd9, 0xd7, - 0x49, 0xa9, 0x95, 0x55, 0xe4, 0xc8, 0x33, 0x92, 0x1e, 0xad, 0x97, 0xf3, 0x18, 0xc2, 0xb4, 0x6d, - 0x09, 0x81, 0x3d, 0xc1, 0x2c, 0xa3, 0xc1, 0x2c, 0x38, 0x3e, 0x48, 0x7d, 0x3d, 0xff, 0x16, 0xc0, - 0x9d, 0x8e, 0xf0, 0x41, 0xda, 0xd5, 0x1b, 0xb4, 0xcc, 0x0d, 0xc8, 0x33, 0x08, 0x3b, 0x1f, 0x2f, - 0x88, 0x96, 0xf7, 0x92, 0xbf, 0xec, 0x93, 0x4e, 0x9a, 0xf6, 0x64, 0x27, 0xcc, 0x5b, 0x13, 0x3a, - 0xfc, 0xaf, 0xb0, 0xcb, 0x49, 0x7b, 0xf2, 0xfc, 0x05, 0x1c, 0x9e, 0xac, 0x2d, 0xea, 0x82, 0x59, - 0x59, 0xe3, 0x3b, 0x2d, 0xc9, 0x2d, 0x18, 0x55, 0x5a, 0xfa, 0xf8, 0x49, 0xea, 0x4a, 0x32, 0x83, - 0x48, 0xa0, 0xe1, 0x5a, 0x96, 0x56, 0xaa, 0xc2, 0xfb, 0x4f, 0xd2, 0x5d, 0x68, 0xfe, 0x75, 0x04, - 0x61, 0xbf, 0xc4, 0x43, 0x98, 0x72, 0xb5, 0x5e, 0x23, 0x77, 0xa3, 0x4c, 0x8a, 0xd6, 0xea, 0xe0, - 0x1a, 0x3c, 0x15, 0xe4, 0x10, 0x86, 0x52, 0xb4, 0x56, 0x43, 0x29, 0xdc, 0x99, 0x0a, 0x96, 0x23, - 0x1d, 0x79, 0xc4, 0xd7, 0x84, 0xc2, 0xb8, 0x46, 0x6d, 0x5c, 0xe6, 0x9e, 0x87, 0xbb, 0xd6, 0x45, - 0x74, 0x7b, 0x65, 0xf6, 0xb2, 0x44, 0x7a, 0xa3, 0x89, 0xe8, 0xc0, 0xb7, 0x97, 0x25, 0x92, 0x97, - 0x30, 0x65, 0x6b, 0xa3, 0xb2, 0xf3, 0x42, 0x7d, 0x29, 0x32, 0x66, 0xe8, 0xfe, 0x6c, 0x74, 0x1c, - 0x2d, 0x1f, 0xfc, 0xe3, 0x30, 0x7f, 0x9e, 0x20, 0x8d, 0x9c, 0xee, 0xb5, 0x93, 0x9d, 0x18, 0x72, - 0x1f, 0x20, 0x47, 0x21, 0x59, 0x13, 0x34, 0xf6, 0x41, 0x13, 0x8f, 0xf8, 0x14, 0x0a, 0x63, 0xae, - 0x91, 0x59, 0x14, 0x34, 0x6c, 0x7e, 0xb2, 0x6d, 0xc9, 0x5d, 0x08, 0xf9, 0x0a, 0xf9, 0xb9, 0xa9, - 0x72, 0x3a, 0xf1, 0xa3, 0xbe, 0x27, 0x09, 0xdc, 0x2e, 0x35, 0xd6, 0x52, 0x55, 0x26, 0x6b, 0x97, - 0x72, 0x97, 0x02, 0x4f, 0x3b, 0xea, 0x46, 0xef, 0x9b, 0xc9, 0xa9, 0x20, 0x8f, 0xe0, 0x66, 0x81, - 0x17, 0x76, 0x97, 0x1b, 0x79, 0xee, 0xd4, 0xc1, 0x3d, 0xef, 0xf9, 0xab, 0x1f, 0x9b, 0x38, 0xb8, - 0xda, 0xc4, 0xc1, 0xaf, 0x4d, 0x1c, 0x7c, 0xdf, 0xc6, 0x83, 0xab, 0x6d, 0x3c, 0xf8, 0xb9, 0x8d, - 0x07, 0x1f, 0x1f, 0x7f, 0x92, 0x76, 0x55, 0x9d, 0x25, 0x5c, 0xe5, 0x8b, 0xe6, 0x4d, 0xfb, 0xef, - 0x93, 0x42, 0x09, 0x5c, 0x5c, 0x5c, 0x3f, 0x70, 0xb7, 0xa5, 0x39, 0xdb, 0xf7, 0x6f, 0xfb, 0xe9, - 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xee, 0x59, 0x24, 0x51, 0xff, 0x02, 0x00, 0x00, +var xxx_messageInfo_AlternativeUri proto.InternalMessageInfo + +func (m *AlternativeUri) GetUri() string { + if m != nil { + return m.Uri + } + return "" } -func (m *Resource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *AlternativeUri) GetDescription() string { + if m != nil { + return m.Description } - return dAtA[:n], nil + return "" } -func (m *Resource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func init() { + proto.RegisterType((*ResourceWithMetadata)(nil), "cheqd.resource.v2.ResourceWithMetadata") + proto.RegisterType((*Resource)(nil), "cheqd.resource.v2.Resource") + proto.RegisterType((*Metadata)(nil), "cheqd.resource.v2.Metadata") + proto.RegisterType((*AlternativeUri)(nil), "cheqd.resource.v2.AlternativeUri") } -func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintResource(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func init() { proto.RegisterFile("cheqd/resource/v2/resource.proto", fileDescriptor_abfe0b32f2a40f67) } + +var fileDescriptor_abfe0b32f2a40f67 = []byte{ + // 514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcf, 0x6e, 0xd3, 0x4c, + 0x10, 0x8f, 0x93, 0x7c, 0x8d, 0x33, 0x69, 0xfa, 0xd1, 0xa5, 0x07, 0x2b, 0x08, 0x27, 0x84, 0x4b, + 0x0f, 0xc5, 0x96, 0x02, 0x12, 0x37, 0xa4, 0x46, 0x08, 0xa9, 0xaa, 0xb8, 0x58, 0x05, 0x24, 0x2e, + 0x91, 0xe3, 0x1d, 0x92, 0x55, 0x63, 0xaf, 0xf1, 0xae, 0x4d, 0xfb, 0x06, 0x1c, 0xfb, 0x44, 0x9c, + 0x73, 0xec, 0x91, 0x53, 0x41, 0xc9, 0x8b, 0xa0, 0x5d, 0x7b, 0xdd, 0x20, 0xe0, 0x62, 0xcd, 0xfe, + 0xf6, 0xf7, 0x67, 0x3c, 0xa3, 0x85, 0x51, 0xb4, 0xc4, 0xcf, 0xd4, 0xcf, 0x50, 0xf0, 0x3c, 0x8b, + 0xd0, 0x2f, 0x26, 0x75, 0xed, 0xa5, 0x19, 0x97, 0x9c, 0x1c, 0x6a, 0x86, 0x57, 0xa3, 0xc5, 0x64, + 0x70, 0xb4, 0xe0, 0x0b, 0xae, 0x6f, 0x7d, 0x55, 0x95, 0xc4, 0xc1, 0x70, 0xc1, 0xf9, 0x62, 0x85, + 0xbe, 0x3e, 0xcd, 0xf3, 0x4f, 0xbe, 0x64, 0x31, 0x0a, 0x19, 0xc6, 0x69, 0x49, 0x18, 0x7f, 0xb5, + 0xe0, 0x28, 0xa8, 0x6c, 0x3e, 0x30, 0xb9, 0x7c, 0x8b, 0x32, 0xa4, 0xa1, 0x0c, 0xc9, 0x4b, 0xb0, + 0x8d, 0xbd, 0x63, 0x8d, 0xac, 0xe3, 0xde, 0xe4, 0x91, 0xf7, 0x47, 0xaa, 0x67, 0xa4, 0x41, 0x4d, + 0x56, 0xc2, 0xb8, 0x32, 0x71, 0x9a, 0xff, 0x14, 0x9a, 0x9c, 0xa0, 0x26, 0x8f, 0x5d, 0xb0, 0x8d, + 0x1d, 0x21, 0xd0, 0xd6, 0x06, 0x2a, 0x79, 0x3f, 0xd0, 0xf5, 0xf8, 0x5b, 0x0b, 0xec, 0xba, 0xbd, + 0xa7, 0xd0, 0x8f, 0xf8, 0x6a, 0x85, 0x91, 0x64, 0x3c, 0x99, 0x31, 0xaa, 0x99, 0xdd, 0x60, 0xff, + 0x1e, 0x3c, 0xa3, 0xe4, 0x00, 0x9a, 0x8c, 0xea, 0x26, 0xba, 0x41, 0x93, 0x51, 0xe5, 0x9a, 0x84, + 0x31, 0x3a, 0x2d, 0x8d, 0xe8, 0x9a, 0x38, 0xd0, 0x29, 0x30, 0x13, 0x8c, 0x27, 0x4e, 0x5b, 0xc3, + 0xe6, 0xa8, 0x22, 0x4c, 0xc7, 0x33, 0x79, 0x9d, 0xa2, 0xf3, 0x5f, 0x19, 0x61, 0xc0, 0x8b, 0xeb, + 0x14, 0xc9, 0x39, 0xf4, 0xc3, 0x95, 0xe0, 0xb3, 0xcb, 0x84, 0x7f, 0x49, 0x66, 0xa1, 0x70, 0xf6, + 0x46, 0xad, 0xe3, 0xde, 0xe4, 0xc9, 0x5f, 0x7e, 0xf9, 0x74, 0x25, 0x31, 0x4b, 0x42, 0xc9, 0x0a, + 0x7c, 0x97, 0xb1, 0x69, 0x7b, 0x7d, 0x37, 0xb4, 0x82, 0x9e, 0x52, 0x9f, 0x2b, 0xf1, 0xa9, 0x20, + 0x8f, 0x01, 0x62, 0xa4, 0x2c, 0x2c, 0xe3, 0x3a, 0x3a, 0xae, 0xab, 0x11, 0x9d, 0xf5, 0x0a, 0x3a, + 0x51, 0x86, 0xa1, 0x44, 0xea, 0xd8, 0x7a, 0xb0, 0x03, 0xaf, 0x5c, 0xaf, 0x67, 0xd6, 0xeb, 0x5d, + 0x98, 0xf5, 0x4e, 0xed, 0xf5, 0xdd, 0xb0, 0x71, 0xf3, 0x63, 0x68, 0x05, 0x46, 0x44, 0x06, 0x60, + 0x47, 0x4b, 0x8c, 0x2e, 0x45, 0x1e, 0x3b, 0x5d, 0x6d, 0x5e, 0x9f, 0xc9, 0x0b, 0x78, 0x98, 0x66, + 0x58, 0x30, 0x9e, 0x8b, 0x59, 0x35, 0x00, 0x35, 0x55, 0x50, 0xb4, 0xaa, 0xd5, 0x43, 0x43, 0x78, + 0x5f, 0xde, 0x9f, 0x51, 0x72, 0x02, 0xff, 0x27, 0x78, 0x25, 0x77, 0x15, 0xbd, 0x1d, 0x45, 0x5f, + 0x5d, 0xd6, 0xec, 0xf1, 0x6b, 0x38, 0xf8, 0x7d, 0x06, 0xe4, 0x01, 0xb4, 0xf2, 0x8c, 0x55, 0xbb, + 0x53, 0x25, 0x19, 0x41, 0x8f, 0xa2, 0x88, 0x32, 0x96, 0xaa, 0x1d, 0x56, 0xbb, 0xdb, 0x85, 0xa6, + 0x6f, 0xd6, 0x1b, 0xd7, 0xba, 0xdd, 0xb8, 0xd6, 0xcf, 0x8d, 0x6b, 0xdd, 0x6c, 0xdd, 0xc6, 0xed, + 0xd6, 0x6d, 0x7c, 0xdf, 0xba, 0x8d, 0x8f, 0x27, 0x0b, 0x26, 0x97, 0xf9, 0xdc, 0x8b, 0x78, 0xec, + 0x97, 0x4f, 0x48, 0x7f, 0x9f, 0x25, 0x9c, 0xa2, 0x7f, 0x75, 0xff, 0x9e, 0xd4, 0x74, 0xc5, 0x7c, + 0x4f, 0x0f, 0xed, 0xf9, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x6a, 0xda, 0x2f, 0x6e, 0x03, + 0x00, 0x00, } func (m *ResourceWithMetadata) Marshal() (dAtA []byte, err error) { @@ -412,7 +438,7 @@ func (m *ResourceWithMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AlternativeUri) Marshal() (dAtA []byte, err error) { +func (m *Resource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -422,27 +448,20 @@ func (m *AlternativeUri) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AlternativeUri) MarshalTo(dAtA []byte) (int, error) { +func (m *Resource) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AlternativeUri) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintResource(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Uri) > 0 { - i -= len(m.Uri) - copy(dAtA[i:], m.Uri) - i = encodeVarintResource(dAtA, i, uint64(len(m.Uri))) + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintResource(dAtA, i, uint64(len(m.Data))) i-- dAtA[i] = 0xa } @@ -490,13 +509,14 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x4a } - if len(m.Created) > 0 { - i -= len(m.Created) - copy(dAtA[i:], m.Created) - i = encodeVarintResource(dAtA, i, uint64(len(m.Created))) - i-- - dAtA[i] = 0x42 + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Created, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Created):]) + if err3 != nil { + return 0, err3 } + i -= n3 + i = encodeVarintResource(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x42 if len(m.MediaType) > 0 { i -= len(m.MediaType) copy(dAtA[i:], m.MediaType) @@ -556,6 +576,43 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AlternativeUri) 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 *AlternativeUri) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AlternativeUri) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintResource(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintResource(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintResource(dAtA []byte, offset int, v uint64) int { offset -= sovResource(v) base := offset @@ -567,19 +624,6 @@ func encodeVarintResource(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Resource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - return n -} - func (m *ResourceWithMetadata) Size() (n int) { if m == nil { return 0 @@ -597,167 +641,94 @@ func (m *ResourceWithMetadata) Size() (n int) { return n } -func (m *AlternativeUri) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Uri) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - return n -} - -func (m *Metadata) Size() (n int) { +func (m *Resource) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.CollectionId) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.Id) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.ResourceType) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - if len(m.AlsoKnownAs) > 0 { - for _, e := range m.AlsoKnownAs { - l = e.Size() - n += 1 + l + sovResource(uint64(l)) - } - } - l = len(m.MediaType) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.Created) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.Checksum) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.PreviousVersionId) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.NextVersionId) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - return n -} - -func sovResource(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozResource(x uint64) (n int) { - return sovResource(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Resource) 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 ErrIntOverflowResource - } - 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: Resource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResource - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthResource - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthResource - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResource(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + l = len(m.Data) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + return n +} + +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CollectionId) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + l = len(m.ResourceType) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + if len(m.AlsoKnownAs) > 0 { + for _, e := range m.AlsoKnownAs { + l = e.Size() + n += 1 + l + sovResource(uint64(l)) } } + l = len(m.MediaType) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Created) + n += 1 + l + sovResource(uint64(l)) + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + l = len(m.PreviousVersionId) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + l = len(m.NextVersionId) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *AlternativeUri) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovResource(uint64(l)) + } + return n +} + +func sovResource(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozResource(x uint64) (n int) { + return sovResource(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *ResourceWithMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -881,7 +852,7 @@ func (m *ResourceWithMetadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *AlternativeUri) Unmarshal(dAtA []byte) error { +func (m *Resource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -904,17 +875,17 @@ func (m *AlternativeUri) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AlternativeUri: wiretype end group for non-group") + return fmt.Errorf("proto: Resource: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AlternativeUri: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowResource @@ -924,55 +895,25 @@ func (m *AlternativeUri) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthResource } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthResource } if postIndex > l { return io.ErrUnexpectedEOF } - m.Uri = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResource - } - 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 ErrInvalidLengthResource - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResource - } - if postIndex > l { - return io.ErrUnexpectedEOF + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} } - m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1254,7 +1195,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowResource @@ -1264,23 +1205,24 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthResource } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthResource } if postIndex > l { return io.ErrUnexpectedEOF } - m.Created = string(dAtA[iNdEx:postIndex]) + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Created, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 9: if wireType != 2 { @@ -1399,6 +1341,120 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } return nil } +func (m *AlternativeUri) 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 ErrIntOverflowResource + } + 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: AlternativeUri: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AlternativeUri: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResource + } + 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 ErrInvalidLengthResource + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResource + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResource + } + 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 ErrInvalidLengthResource + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResource + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResource(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResource + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipResource(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/resource/types/resource_alternative_uri.go b/x/resource/types/resource_alternative_uri.go index de1cecfa4..1075cc07d 100644 --- a/x/resource/types/resource_alternative_uri.go +++ b/x/resource/types/resource_alternative_uri.go @@ -13,7 +13,7 @@ func (au AlternativeUri) Validate() error { ) } -func ValidAlternativeUri() *didtypes.CustomErrorRule { +func ValidAlternativeURI() *didtypes.CustomErrorRule { return didtypes.NewCustomErrorRule(func(value interface{}) error { casted, ok := value.(AlternativeUri) if !ok { diff --git a/x/resource/types/tx.pb.go b/x/resource/types/tx.pb.go index 920264c66..c37b3b895 100644 --- a/x/resource/types/tx.pb.go +++ b/x/resource/types/tx.pb.go @@ -29,8 +29,10 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgCreateResource struct { - Payload *MsgCreateResourcePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Signatures []*types.SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` + // Payload of the resource to be created + Payload *MsgCreateResourcePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Signatures of the corresponding DID Document's controller(s) + Signatures []*types.SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` } func (m *MsgCreateResource) Reset() { *m = MsgCreateResource{} } @@ -81,13 +83,20 @@ func (m *MsgCreateResource) GetSignatures() []*types.SignInfo { } type MsgCreateResourcePayload struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` - ResourceType string `protobuf:"bytes,6,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` - AlsoKnownAs []*AlternativeUri `protobuf:"bytes,7,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` + // data is a byte-representation of the actual Data the user wants to store + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + // collection_id is an identifier of the DidDocument the resource belongs to + CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + // id is an UUID of the resource + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + // name is a human-readable name of the resource + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // version is a version of the resource + Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` + // resource_type is a type of the resource + ResourceType string `protobuf:"bytes,6,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + // also_known_as is a list of URIs that can be used to get the resource + AlsoKnownAs []*AlternativeUri `protobuf:"bytes,7,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"also_known_as,omitempty"` } func (m *MsgCreateResourcePayload) Reset() { *m = MsgCreateResourcePayload{} } @@ -173,6 +182,7 @@ func (m *MsgCreateResourcePayload) GetAlsoKnownAs() []*AlternativeUri { } type MsgCreateResourceResponse struct { + // Metadata which was creted after applying to the ledger Resource *Metadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` } @@ -267,6 +277,7 @@ 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 { + // CreateResource defines a method for creating a resource. CreateResource(ctx context.Context, in *MsgCreateResource, opts ...grpc.CallOption) (*MsgCreateResourceResponse, error) } @@ -289,6 +300,7 @@ func (c *msgClient) CreateResource(ctx context.Context, in *MsgCreateResource, o // MsgServer is the server API for Msg service. type MsgServer interface { + // CreateResource defines a method for creating a resource. CreateResource(context.Context, *MsgCreateResource) (*MsgCreateResourceResponse, error) } diff --git a/x/resource/types/tx_msg_create_resource_payload.go b/x/resource/types/tx_msg_create_resource_payload.go index 29154aa6c..094adc250 100644 --- a/x/resource/types/tx_msg_create_resource_payload.go +++ b/x/resource/types/tx_msg_create_resource_payload.go @@ -41,7 +41,7 @@ func (msg MsgCreateResourcePayload) Validate() error { validation.Field(&msg.Name, validation.Required, validation.Length(1, 64)), validation.Field(&msg.Version, validation.Length(1, 64)), validation.Field(&msg.ResourceType, validation.Required, validation.Length(1, 64)), - validation.Field(&msg.AlsoKnownAs, validation.Each(ValidAlternativeUri())), + validation.Field(&msg.AlsoKnownAs, validation.Each(ValidAlternativeURI())), validation.Field(&msg.Data, validation.Required, validation.Length(1, 200*1024)), // 200KB ) } @@ -60,6 +60,6 @@ func ValidMsgCreateResourcePayload() *didtypes.CustomErrorRule { // Normalize func (msg *MsgCreateResourcePayload) Normalize() { - msg.CollectionId = didutils.NormalizeId(msg.CollectionId) + msg.CollectionId = didutils.NormalizeID(msg.CollectionId) msg.Id = didutils.NormalizeUUID(msg.Id) } diff --git a/x/resource/types/tx_msg_create_resource_payload_test.go b/x/resource/types/tx_msg_create_resource_payload_test.go index c4d069009..2edc6dc07 100644 --- a/x/resource/types/tx_msg_create_resource_payload_test.go +++ b/x/resource/types/tx_msg_create_resource_payload_test.go @@ -9,10 +9,10 @@ import ( var _ = Describe("TxMsgCreateResourcePayload", func() { var msg *resourcetypes.MsgCreateResourcePayload type TestCaseUUIDDidStruct struct { - inputCollectionId string - inputId string - expectedId string - expectedCollectionId string + inputCollectionID string + inputID string + expectedID string + expectedCollectionID string } Describe("Validate", func() { @@ -47,15 +47,15 @@ var _ = Describe("TxMsgCreateResourcePayload", func() { DescribeTable("UUID validation tests", func(testCase TestCaseUUIDDidStruct) { inputMsg := resourcetypes.MsgCreateResourcePayload{ - CollectionId: testCase.inputCollectionId, - Id: testCase.inputId, + CollectionId: testCase.inputCollectionID, + Id: testCase.inputID, Name: "Test Resource", ResourceType: "", Data: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, } expectedMsg := resourcetypes.MsgCreateResourcePayload{ - CollectionId: testCase.expectedCollectionId, - Id: testCase.expectedId, + CollectionId: testCase.expectedCollectionID, + Id: testCase.expectedID, Name: "Test Resource", ResourceType: "", Data: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, @@ -67,37 +67,37 @@ var _ = Describe("TxMsgCreateResourcePayload", func() { Entry( "base58 identifier - not changed", TestCaseUUIDDidStruct{ - inputCollectionId: "zABCDEFG123456789abcd", - inputId: "8c614475-ec20-4ff2-bcf3-e4f28b849dbc", - expectedCollectionId: "zABCDEFG123456789abcd", - expectedId: "8c614475-ec20-4ff2-bcf3-e4f28b849dbc", + inputCollectionID: "zABCDEFG123456789abcd", + inputID: "8c614475-ec20-4ff2-bcf3-e4f28b849dbc", + expectedCollectionID: "zABCDEFG123456789abcd", + expectedID: "8c614475-ec20-4ff2-bcf3-e4f28b849dbc", }), Entry( "Mixed case UUID", TestCaseUUIDDidStruct{ - inputCollectionId: "BAbbba14-f294-458a-9b9c-474d188680fd", - inputId: "BAbbba14-f294-458a-9b9c-474d188680fd", - expectedCollectionId: "babbba14-f294-458a-9b9c-474d188680fd", - expectedId: "babbba14-f294-458a-9b9c-474d188680fd", + inputCollectionID: "BAbbba14-f294-458a-9b9c-474d188680fd", + inputID: "BAbbba14-f294-458a-9b9c-474d188680fd", + expectedCollectionID: "babbba14-f294-458a-9b9c-474d188680fd", + expectedID: "babbba14-f294-458a-9b9c-474d188680fd", }), Entry( "Low case UUID", TestCaseUUIDDidStruct{ - inputCollectionId: "babbba14-f294-458a-9b9c-474d188680fd", - inputId: "babbba14-f294-458a-9b9c-474d188680fd", - expectedCollectionId: "babbba14-f294-458a-9b9c-474d188680fd", - expectedId: "babbba14-f294-458a-9b9c-474d188680fd", + inputCollectionID: "babbba14-f294-458a-9b9c-474d188680fd", + inputID: "babbba14-f294-458a-9b9c-474d188680fd", + expectedCollectionID: "babbba14-f294-458a-9b9c-474d188680fd", + expectedID: "babbba14-f294-458a-9b9c-474d188680fd", }), Entry( "Upper case UUID", TestCaseUUIDDidStruct{ - inputCollectionId: "A86F9CAE-0902-4a7c-a144-96b60ced2FC9", - inputId: "A86F9CAE-0902-4a7c-a144-96b60ced2FC9", - expectedCollectionId: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", - expectedId: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", + inputCollectionID: "A86F9CAE-0902-4a7c-a144-96b60ced2FC9", + inputID: "A86F9CAE-0902-4a7c-a144-96b60ced2FC9", + expectedCollectionID: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", + expectedID: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", }), ) }) diff --git a/x/resource/types/v1/query.pb.go b/x/resource/types/v1/query.pb.go index a130c187c..112a9e4f6 100644 --- a/x/resource/types/v1/query.pb.go +++ b/x/resource/types/v1/query.pb.go @@ -28,21 +28,21 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type QueryGetResourceRequest struct { +type QueryResourceRequest struct { CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` } -func (m *QueryGetResourceRequest) Reset() { *m = QueryGetResourceRequest{} } -func (m *QueryGetResourceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetResourceRequest) ProtoMessage() {} -func (*QueryGetResourceRequest) Descriptor() ([]byte, []int) { +func (m *QueryResourceRequest) Reset() { *m = QueryResourceRequest{} } +func (m *QueryResourceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryResourceRequest) ProtoMessage() {} +func (*QueryResourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_dcece4d32a2c67c4, []int{0} } -func (m *QueryGetResourceRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryResourceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryGetResourceRequest.Marshal(b, m, deterministic) } else { @@ -54,48 +54,48 @@ func (m *QueryGetResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryGetResourceRequest) XXX_Merge(src proto.Message) { +func (m *QueryResourceRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryGetResourceRequest.Merge(m, src) } -func (m *QueryGetResourceRequest) XXX_Size() int { +func (m *QueryResourceRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetResourceRequest) XXX_DiscardUnknown() { +func (m *QueryResourceRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryGetResourceRequest.DiscardUnknown(m) } var xxx_messageInfo_QueryGetResourceRequest proto.InternalMessageInfo -func (m *QueryGetResourceRequest) GetCollectionId() string { +func (m *QueryResourceRequest) GetCollectionId() string { if m != nil { return m.CollectionId } return "" } -func (m *QueryGetResourceRequest) GetId() string { +func (m *QueryResourceRequest) GetId() string { if m != nil { return m.Id } return "" } -type QueryGetResourceResponse struct { +type QueryResourceResponse struct { Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` } -func (m *QueryGetResourceResponse) Reset() { *m = QueryGetResourceResponse{} } -func (m *QueryGetResourceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetResourceResponse) ProtoMessage() {} -func (*QueryGetResourceResponse) Descriptor() ([]byte, []int) { +func (m *QueryResourceResponse) Reset() { *m = QueryResourceResponse{} } +func (m *QueryResourceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResourceResponse) ProtoMessage() {} +func (*QueryResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_dcece4d32a2c67c4, []int{1} } -func (m *QueryGetResourceResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryResourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetResourceResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -105,39 +105,39 @@ func (m *QueryGetResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *QueryGetResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetResourceResponse.Merge(m, src) +func (m *QueryResourceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResourceResponse.Merge(m, src) } -func (m *QueryGetResourceResponse) XXX_Size() int { +func (m *QueryResourceResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetResourceResponse.DiscardUnknown(m) +func (m *QueryResourceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResourceResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetResourceResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryResourceResponse proto.InternalMessageInfo -func (m *QueryGetResourceResponse) GetResource() *Resource { +func (m *QueryResourceResponse) GetResource() *Resource { if m != nil { return m.Resource } return nil } -type QueryGetCollectionResourcesRequest struct { +type QueryCollectionResourcesRequest struct { CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` } -func (m *QueryGetCollectionResourcesRequest) Reset() { *m = QueryGetCollectionResourcesRequest{} } -func (m *QueryGetCollectionResourcesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetCollectionResourcesRequest) ProtoMessage() {} -func (*QueryGetCollectionResourcesRequest) Descriptor() ([]byte, []int) { +func (m *QueryCollectionResourcesRequest) Reset() { *m = QueryCollectionResourcesRequest{} } +func (m *QueryCollectionResourcesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCollectionResourcesRequest) ProtoMessage() {} +func (*QueryCollectionResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_dcece4d32a2c67c4, []int{2} } -func (m *QueryGetCollectionResourcesRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryCollectionResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetCollectionResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryCollectionResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryGetCollectionResourcesRequest.Marshal(b, m, deterministic) } else { @@ -149,41 +149,41 @@ func (m *QueryGetCollectionResourcesRequest) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *QueryGetCollectionResourcesRequest) XXX_Merge(src proto.Message) { +func (m *QueryCollectionResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryGetCollectionResourcesRequest.Merge(m, src) } -func (m *QueryGetCollectionResourcesRequest) XXX_Size() int { +func (m *QueryCollectionResourcesRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetCollectionResourcesRequest) XXX_DiscardUnknown() { +func (m *QueryCollectionResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryGetCollectionResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_QueryGetCollectionResourcesRequest proto.InternalMessageInfo -func (m *QueryGetCollectionResourcesRequest) GetCollectionId() string { +func (m *QueryCollectionResourcesRequest) GetCollectionId() string { if m != nil { return m.CollectionId } return "" } -type QueryGetCollectionResourcesResponse struct { +type QueryCollectionResourcesResponse struct { Resources []*ResourceHeader `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` } -func (m *QueryGetCollectionResourcesResponse) Reset() { *m = QueryGetCollectionResourcesResponse{} } -func (m *QueryGetCollectionResourcesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetCollectionResourcesResponse) ProtoMessage() {} -func (*QueryGetCollectionResourcesResponse) Descriptor() ([]byte, []int) { +func (m *QueryCollectionResourcesResponse) Reset() { *m = QueryCollectionResourcesResponse{} } +func (m *QueryCollectionResourcesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCollectionResourcesResponse) ProtoMessage() {} +func (*QueryCollectionResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_dcece4d32a2c67c4, []int{3} } -func (m *QueryGetCollectionResourcesResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryCollectionResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetCollectionResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryCollectionResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetCollectionResourcesResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryCollectionResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -193,19 +193,19 @@ func (m *QueryGetCollectionResourcesResponse) XXX_Marshal(b []byte, deterministi return b[:n], nil } } -func (m *QueryGetCollectionResourcesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetCollectionResourcesResponse.Merge(m, src) +func (m *QueryCollectionResourcesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollectionResourcesResponse.Merge(m, src) } -func (m *QueryGetCollectionResourcesResponse) XXX_Size() int { +func (m *QueryCollectionResourcesResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetCollectionResourcesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetCollectionResourcesResponse.DiscardUnknown(m) +func (m *QueryCollectionResourcesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollectionResourcesResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetCollectionResourcesResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryCollectionResourcesResponse proto.InternalMessageInfo -func (m *QueryGetCollectionResourcesResponse) GetResources() []*ResourceHeader { +func (m *QueryCollectionResourcesResponse) GetResources() []*ResourceHeader { if m != nil { return m.Resources } @@ -317,10 +317,10 @@ func (m *QueryGetAllResourceVersionsResponse) GetResources() []*ResourceHeader { } func init() { - proto.RegisterType((*QueryGetResourceRequest)(nil), "cheqdid.cheqdnode.resource.v1.QueryGetResourceRequest") - proto.RegisterType((*QueryGetResourceResponse)(nil), "cheqdid.cheqdnode.resource.v1.QueryGetResourceResponse") - proto.RegisterType((*QueryGetCollectionResourcesRequest)(nil), "cheqdid.cheqdnode.resource.v1.QueryGetCollectionResourcesRequest") - proto.RegisterType((*QueryGetCollectionResourcesResponse)(nil), "cheqdid.cheqdnode.resource.v1.QueryGetCollectionResourcesResponse") + proto.RegisterType((*QueryResourceRequest)(nil), "cheqdid.cheqdnode.resource.v1.QueryResourceRequest") + proto.RegisterType((*QueryResourceResponse)(nil), "cheqdid.cheqdnode.resource.v1.QueryResourceResponse") + proto.RegisterType((*QueryCollectionResourcesRequest)(nil), "cheqdid.cheqdnode.resource.v1.QueryCollectionResourcesRequest") + proto.RegisterType((*QueryCollectionResourcesResponse)(nil), "cheqdid.cheqdnode.resource.v1.QueryCollectionResourcesResponse") proto.RegisterType((*QueryGetAllResourceVersionsRequest)(nil), "cheqdid.cheqdnode.resource.v1.QueryGetAllResourceVersionsRequest") proto.RegisterType((*QueryGetAllResourceVersionsResponse)(nil), "cheqdid.cheqdnode.resource.v1.QueryGetAllResourceVersionsResponse") } @@ -328,39 +328,39 @@ func init() { func init() { proto.RegisterFile("cheqd/resource/v1/query.proto", fileDescriptor_dcece4d32a2c67c4) } var fileDescriptor_dcece4d32a2c67c4 = []byte{ - // 501 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4f, 0x6b, 0x13, 0x41, - 0x1c, 0xcd, 0xa4, 0x55, 0xda, 0x69, 0xf5, 0x30, 0x3d, 0xb8, 0x04, 0x5d, 0xc2, 0xf4, 0x60, 0x2f, - 0x9d, 0xe9, 0x46, 0x68, 0x41, 0xbc, 0x34, 0x3d, 0x68, 0x10, 0x04, 0x83, 0x78, 0xf0, 0x52, 0xb6, - 0x3b, 0x3f, 0xd3, 0x81, 0xed, 0xce, 0x66, 0x67, 0x13, 0x0c, 0x21, 0x07, 0xfd, 0x04, 0x82, 0x5f, - 0xc5, 0x0f, 0xe1, 0xb1, 0xa0, 0x07, 0x8f, 0x25, 0xf1, 0x43, 0x78, 0x94, 0x9d, 0xfd, 0x93, 0x4a, - 0x93, 0xb8, 0x8b, 0xf4, 0xb2, 0xbb, 0xcc, 0xef, 0xf7, 0xde, 0xef, 0xbd, 0xd9, 0x37, 0x83, 0x1f, - 0x79, 0xe7, 0xd0, 0x17, 0x3c, 0x02, 0xad, 0x06, 0x91, 0x07, 0x7c, 0xe8, 0xf0, 0xfe, 0x00, 0xa2, - 0x11, 0x0b, 0x23, 0x15, 0x2b, 0x92, 0x96, 0xa5, 0x60, 0xe6, 0x1d, 0x28, 0x01, 0x2c, 0x6f, 0x65, - 0x43, 0xa7, 0xd1, 0xbc, 0x89, 0x2e, 0xca, 0x86, 0xa0, 0xf1, 0xb0, 0xa7, 0x54, 0xcf, 0x07, 0xee, - 0x86, 0x92, 0xbb, 0x41, 0xa0, 0x62, 0x37, 0x96, 0x2a, 0xd0, 0x69, 0x95, 0xbe, 0xc2, 0x0f, 0x5e, - 0x27, 0xd3, 0x9e, 0x43, 0xdc, 0xcd, 0x70, 0x5d, 0xe8, 0x0f, 0x40, 0xc7, 0x64, 0x17, 0xdf, 0xf3, - 0x94, 0xef, 0x83, 0x97, 0xf4, 0x9f, 0x4a, 0x61, 0xa1, 0x26, 0xda, 0xdb, 0xec, 0x6e, 0xcf, 0x17, - 0x3b, 0x82, 0xdc, 0xc7, 0x75, 0x29, 0xac, 0xba, 0xa9, 0xd4, 0xa5, 0xa0, 0xa7, 0xd8, 0xba, 0xc9, - 0xa7, 0x43, 0x15, 0x68, 0x20, 0x27, 0x78, 0x23, 0xd7, 0x66, 0xb8, 0xb6, 0x5a, 0x8f, 0xd9, 0x4a, - 0x77, 0xac, 0xa0, 0x28, 0x80, 0xb4, 0x83, 0x69, 0x3e, 0xe0, 0xa4, 0x10, 0x92, 0xf7, 0xe9, 0x2a, - 0xda, 0x69, 0x84, 0x77, 0x57, 0x52, 0x65, 0xb2, 0x5f, 0xe2, 0xcd, 0x7c, 0xba, 0xb6, 0x50, 0x73, - 0x6d, 0x6f, 0xab, 0xb5, 0x5f, 0x52, 0xf7, 0x0b, 0x70, 0x05, 0x44, 0xdd, 0x39, 0x9e, 0x7e, 0x44, - 0x73, 0xfd, 0xc7, 0xbe, 0x9f, 0x37, 0xbe, 0x85, 0x48, 0x27, 0x7f, 0xa5, 0xd2, 0xde, 0x13, 0xbc, - 0x1e, 0xb8, 0x17, 0x90, 0xed, 0xbe, 0xf9, 0x26, 0x14, 0x6f, 0xe7, 0xc3, 0xde, 0x8c, 0x42, 0xb0, - 0xd6, 0x52, 0xdc, 0xf5, 0xb5, 0xeb, 0xbe, 0x17, 0x4a, 0xb8, 0x05, 0xdf, 0xad, 0xdf, 0xeb, 0xf8, - 0x8e, 0x19, 0x4a, 0xbe, 0x22, 0xbc, 0x91, 0xf7, 0x91, 0xc3, 0x7f, 0x10, 0x2e, 0xc9, 0x66, 0xe3, - 0xa8, 0x32, 0x2e, 0x35, 0x45, 0x8f, 0x3e, 0x7d, 0xff, 0xf5, 0xa5, 0xee, 0x10, 0xce, 0x1d, 0x76, - 0xc0, 0xa5, 0x80, 0x20, 0x96, 0xef, 0x25, 0x44, 0x9a, 0x8f, 0xff, 0xda, 0xf0, 0x49, 0x71, 0x8c, - 0x34, 0x1f, 0x4b, 0x31, 0x21, 0x3f, 0x10, 0xde, 0x59, 0x90, 0x12, 0x72, 0x5c, 0x52, 0xc9, 0xf2, - 0xb0, 0x36, 0xda, 0xff, 0x43, 0x91, 0xf9, 0x3a, 0x34, 0xbe, 0x0e, 0x08, 0xab, 0xe0, 0xcb, 0xf5, - 0x7d, 0x72, 0x85, 0xf0, 0xce, 0x82, 0x10, 0x94, 0xb6, 0xb5, 0x3c, 0xc3, 0xa5, 0x6d, 0xad, 0xc8, - 0x20, 0x6d, 0x1b, 0x5b, 0xcf, 0xc8, 0xd3, 0x0a, 0xb6, 0x86, 0x19, 0x09, 0x1f, 0x27, 0x27, 0x62, - 0xd2, 0xee, 0x7c, 0x9b, 0xda, 0xe8, 0x72, 0x6a, 0xa3, 0xab, 0xa9, 0x8d, 0x3e, 0xcf, 0xec, 0xda, - 0xe5, 0xcc, 0xae, 0xfd, 0x9c, 0xd9, 0xb5, 0x77, 0xbc, 0x27, 0xe3, 0xf3, 0xc1, 0x19, 0xf3, 0xd4, - 0x05, 0x4f, 0xef, 0x51, 0xf3, 0xdc, 0x4f, 0xa4, 0xf2, 0x0f, 0xf3, 0x4b, 0x35, 0x1e, 0x85, 0x09, - 0xaf, 0x73, 0x76, 0xd7, 0x5c, 0x9a, 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb9, 0xbf, 0x61, - 0x19, 0xb4, 0x05, 0x00, 0x00, + // 509 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xdd, 0x6a, 0x13, 0x41, + 0x14, 0xc7, 0x33, 0x69, 0x95, 0x76, 0x5a, 0xbd, 0x98, 0x22, 0x86, 0x45, 0x97, 0x30, 0xbd, 0xb0, + 0x37, 0x9d, 0xe9, 0x46, 0xa9, 0x20, 0x82, 0x34, 0xbd, 0xd0, 0x20, 0x08, 0x06, 0xf1, 0x42, 0x04, + 0xd9, 0xee, 0x1c, 0xd3, 0x81, 0xed, 0xce, 0x66, 0x67, 0x13, 0x0c, 0x21, 0x17, 0xfa, 0x04, 0x82, + 0x4f, 0xe2, 0x5b, 0x78, 0x59, 0xf1, 0xc6, 0xcb, 0x92, 0xf8, 0x04, 0x3e, 0x81, 0xec, 0x64, 0x3f, + 0xfc, 0x48, 0xe2, 0x2e, 0xe2, 0x4d, 0xb2, 0xcc, 0x39, 0xe7, 0x77, 0xfe, 0xff, 0x99, 0x33, 0x83, + 0x6f, 0x7a, 0xa7, 0xd0, 0x17, 0x3c, 0x02, 0xad, 0x06, 0x91, 0x07, 0x7c, 0xe8, 0xf0, 0xfe, 0x00, + 0xa2, 0x11, 0x0b, 0x23, 0x15, 0x2b, 0x32, 0x0f, 0x4b, 0xc1, 0xcc, 0x7f, 0xa0, 0x04, 0xb0, 0x2c, + 0x95, 0x0d, 0x1d, 0xab, 0xf9, 0x67, 0x75, 0x1e, 0x36, 0x00, 0xeb, 0x46, 0x4f, 0xa9, 0x9e, 0x0f, + 0xdc, 0x0d, 0x25, 0x77, 0x83, 0x40, 0xc5, 0x6e, 0x2c, 0x55, 0xa0, 0xe7, 0x51, 0xfa, 0x04, 0x5f, + 0x7f, 0x9a, 0x74, 0x7b, 0x08, 0x71, 0x37, 0xad, 0xeb, 0x42, 0x7f, 0x00, 0x3a, 0x26, 0xbb, 0xf8, + 0x8a, 0xa7, 0x7c, 0x1f, 0xbc, 0x24, 0xff, 0x95, 0x14, 0x0d, 0xd4, 0x44, 0x7b, 0x9b, 0xdd, 0xed, + 0x62, 0xb1, 0x23, 0xc8, 0x55, 0x5c, 0x97, 0xa2, 0x51, 0x37, 0x91, 0xba, 0x14, 0xf4, 0x25, 0xbe, + 0x66, 0x78, 0x05, 0x4c, 0x87, 0x2a, 0xd0, 0x40, 0x8e, 0xf1, 0x46, 0x26, 0xcc, 0x80, 0xb6, 0x5a, + 0xb7, 0xd8, 0x4a, 0x6b, 0x2c, 0x47, 0xe4, 0x85, 0xb4, 0x83, 0x69, 0xa6, 0xf6, 0x38, 0x57, 0x91, + 0xe5, 0xe9, 0x2a, 0xc2, 0xa9, 0xc2, 0x4d, 0x83, 0x5a, 0xc8, 0x49, 0x35, 0x3f, 0xc6, 0x9b, 0x59, + 0x6b, 0xdd, 0x40, 0xcd, 0xb5, 0xbd, 0xad, 0xd6, 0x7e, 0x49, 0xd1, 0x8f, 0xc0, 0x15, 0x10, 0x75, + 0x8b, 0x7a, 0xfa, 0x16, 0x15, 0xe2, 0x8f, 0x7c, 0x3f, 0x4b, 0x7c, 0x0e, 0x91, 0x4e, 0xce, 0xa3, + 0xd2, 0xae, 0x13, 0xbc, 0x1e, 0xb8, 0x67, 0x90, 0xee, 0xbb, 0xf9, 0x26, 0x14, 0x6f, 0x67, 0xcd, + 0x9e, 0x8d, 0x42, 0x68, 0xac, 0xcd, 0xeb, 0x7e, 0x5e, 0xa3, 0x11, 0xde, 0x5d, 0x29, 0xe1, 0x3f, + 0xf8, 0x6e, 0x7d, 0x5f, 0xc7, 0x97, 0x4c, 0x53, 0xf2, 0x11, 0xe1, 0x8d, 0x2c, 0x8f, 0x1c, 0xfe, + 0x05, 0xb8, 0x64, 0x2a, 0xad, 0x3b, 0x65, 0xea, 0x7e, 0x9f, 0x3e, 0x7a, 0xf7, 0xdd, 0x97, 0x6f, + 0x1f, 0xea, 0x0e, 0xe1, 0xdc, 0x61, 0x07, 0x5c, 0x0a, 0x08, 0x62, 0xf9, 0x5a, 0x42, 0xa4, 0xf9, + 0xf8, 0x97, 0xdd, 0x9e, 0xe4, 0xb7, 0x47, 0xf3, 0xb1, 0x14, 0x13, 0xf2, 0x19, 0xe1, 0x9d, 0x05, + 0x23, 0x42, 0x8e, 0x4a, 0xca, 0x5f, 0x3e, 0xa6, 0xd6, 0x83, 0x32, 0x88, 0x15, 0xe3, 0x49, 0x0f, + 0x8d, 0xa9, 0x03, 0xc2, 0x2a, 0x98, 0x72, 0x7d, 0x9f, 0x5c, 0x20, 0xbc, 0xb3, 0xe0, 0xf8, 0x4b, + 0x7b, 0x5a, 0x3e, 0xbd, 0x56, 0xfb, 0x5f, 0x10, 0xa9, 0xad, 0xb6, 0xb1, 0x75, 0x9f, 0xdc, 0xab, + 0x60, 0x6b, 0x98, 0x42, 0xf8, 0x38, 0xb9, 0x0b, 0x93, 0x76, 0xe7, 0xd3, 0xd4, 0x46, 0xe7, 0x53, + 0x1b, 0x5d, 0x4c, 0x6d, 0xf4, 0x7e, 0x66, 0xd7, 0xce, 0x67, 0x76, 0xed, 0xeb, 0xcc, 0xae, 0xbd, + 0xe0, 0x3d, 0x19, 0x9f, 0x0e, 0x4e, 0x98, 0xa7, 0xce, 0xf8, 0xfc, 0xed, 0x34, 0xbf, 0xfb, 0x89, + 0x54, 0xfe, 0xa6, 0x78, 0x48, 0xe3, 0x51, 0x98, 0x70, 0x9d, 0x93, 0xcb, 0xe6, 0xa1, 0xbc, 0xfd, + 0x23, 0x00, 0x00, 0xff, 0xff, 0x16, 0x9e, 0xd6, 0xf3, 0xa8, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -375,8 +375,8 @@ 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 QueryClient interface { - Resource(ctx context.Context, in *QueryGetResourceRequest, opts ...grpc.CallOption) (*QueryGetResourceResponse, error) - CollectionResources(ctx context.Context, in *QueryGetCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryGetCollectionResourcesResponse, error) + Resource(ctx context.Context, in *QueryResourceRequest, opts ...grpc.CallOption) (*QueryResourceResponse, error) + CollectionResources(ctx context.Context, in *QueryCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryCollectionResourcesResponse, error) AllResourceVersions(ctx context.Context, in *QueryGetAllResourceVersionsRequest, opts ...grpc.CallOption) (*QueryGetAllResourceVersionsResponse, error) } @@ -388,8 +388,8 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Resource(ctx context.Context, in *QueryGetResourceRequest, opts ...grpc.CallOption) (*QueryGetResourceResponse, error) { - out := new(QueryGetResourceResponse) +func (c *queryClient) Resource(ctx context.Context, in *QueryResourceRequest, opts ...grpc.CallOption) (*QueryResourceResponse, error) { + out := new(QueryResourceResponse) err := c.cc.Invoke(ctx, "/cheqdid.cheqdnode.resource.v1.Query/Resource", in, out, opts...) if err != nil { return nil, err @@ -397,8 +397,8 @@ func (c *queryClient) Resource(ctx context.Context, in *QueryGetResourceRequest, return out, nil } -func (c *queryClient) CollectionResources(ctx context.Context, in *QueryGetCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryGetCollectionResourcesResponse, error) { - out := new(QueryGetCollectionResourcesResponse) +func (c *queryClient) CollectionResources(ctx context.Context, in *QueryCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryCollectionResourcesResponse, error) { + out := new(QueryCollectionResourcesResponse) err := c.cc.Invoke(ctx, "/cheqdid.cheqdnode.resource.v1.Query/CollectionResources", in, out, opts...) if err != nil { return nil, err @@ -417,8 +417,8 @@ func (c *queryClient) AllResourceVersions(ctx context.Context, in *QueryGetAllRe // QueryServer is the server API for Query service. type QueryServer interface { - Resource(context.Context, *QueryGetResourceRequest) (*QueryGetResourceResponse, error) - CollectionResources(context.Context, *QueryGetCollectionResourcesRequest) (*QueryGetCollectionResourcesResponse, error) + Resource(context.Context, *QueryResourceRequest) (*QueryResourceResponse, error) + CollectionResources(context.Context, *QueryCollectionResourcesRequest) (*QueryCollectionResourcesResponse, error) AllResourceVersions(context.Context, *QueryGetAllResourceVersionsRequest) (*QueryGetAllResourceVersionsResponse, error) } @@ -426,10 +426,10 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Resource(ctx context.Context, req *QueryGetResourceRequest) (*QueryGetResourceResponse, error) { +func (*UnimplementedQueryServer) Resource(ctx context.Context, req *QueryResourceRequest) (*QueryResourceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resource not implemented") } -func (*UnimplementedQueryServer) CollectionResources(ctx context.Context, req *QueryGetCollectionResourcesRequest) (*QueryGetCollectionResourcesResponse, error) { +func (*UnimplementedQueryServer) CollectionResources(ctx context.Context, req *QueryCollectionResourcesRequest) (*QueryCollectionResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CollectionResources not implemented") } func (*UnimplementedQueryServer) AllResourceVersions(ctx context.Context, req *QueryGetAllResourceVersionsRequest) (*QueryGetAllResourceVersionsResponse, error) { @@ -441,7 +441,7 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { } func _Query_Resource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetResourceRequest) + in := new(QueryResourceRequest) if err := dec(in); err != nil { return nil, err } @@ -453,13 +453,13 @@ func _Query_Resource_Handler(srv interface{}, ctx context.Context, dec func(inte FullMethod: "/cheqdid.cheqdnode.resource.v1.Query/Resource", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Resource(ctx, req.(*QueryGetResourceRequest)) + return srv.(QueryServer).Resource(ctx, req.(*QueryResourceRequest)) } return interceptor(ctx, in, info, handler) } func _Query_CollectionResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetCollectionResourcesRequest) + in := new(QueryCollectionResourcesRequest) if err := dec(in); err != nil { return nil, err } @@ -471,7 +471,7 @@ func _Query_CollectionResources_Handler(srv interface{}, ctx context.Context, de FullMethod: "/cheqdid.cheqdnode.resource.v1.Query/CollectionResources", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).CollectionResources(ctx, req.(*QueryGetCollectionResourcesRequest)) + return srv.(QueryServer).CollectionResources(ctx, req.(*QueryCollectionResourcesRequest)) } return interceptor(ctx, in, info, handler) } @@ -515,7 +515,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "cheqd/resource/v1/query.proto", } -func (m *QueryGetResourceRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryResourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -525,12 +525,12 @@ func (m *QueryGetResourceRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetResourceRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResourceRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -552,7 +552,7 @@ func (m *QueryGetResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryGetResourceResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -562,12 +562,12 @@ func (m *QueryGetResourceResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetResourceResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResourceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -587,7 +587,7 @@ func (m *QueryGetResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *QueryGetCollectionResourcesRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryCollectionResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -597,12 +597,12 @@ func (m *QueryGetCollectionResourcesRequest) Marshal() (dAtA []byte, err error) return dAtA[:n], nil } -func (m *QueryGetCollectionResourcesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryCollectionResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetCollectionResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryCollectionResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -617,7 +617,7 @@ func (m *QueryGetCollectionResourcesRequest) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } -func (m *QueryGetCollectionResourcesResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryCollectionResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -627,12 +627,12 @@ func (m *QueryGetCollectionResourcesResponse) Marshal() (dAtA []byte, err error) return dAtA[:n], nil } -func (m *QueryGetCollectionResourcesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryCollectionResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetCollectionResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryCollectionResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -746,7 +746,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryGetResourceRequest) Size() (n int) { +func (m *QueryResourceRequest) Size() (n int) { if m == nil { return 0 } @@ -763,7 +763,7 @@ func (m *QueryGetResourceRequest) Size() (n int) { return n } -func (m *QueryGetResourceResponse) Size() (n int) { +func (m *QueryResourceResponse) Size() (n int) { if m == nil { return 0 } @@ -776,7 +776,7 @@ func (m *QueryGetResourceResponse) Size() (n int) { return n } -func (m *QueryGetCollectionResourcesRequest) Size() (n int) { +func (m *QueryCollectionResourcesRequest) Size() (n int) { if m == nil { return 0 } @@ -789,7 +789,7 @@ func (m *QueryGetCollectionResourcesRequest) Size() (n int) { return n } -func (m *QueryGetCollectionResourcesResponse) Size() (n int) { +func (m *QueryCollectionResourcesResponse) Size() (n int) { if m == nil { return 0 } @@ -846,7 +846,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryGetResourceRequest) Unmarshal(dAtA []byte) error { +func (m *QueryResourceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -869,10 +869,10 @@ func (m *QueryGetResourceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetResourceRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResourceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -960,7 +960,7 @@ func (m *QueryGetResourceRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetResourceResponse) Unmarshal(dAtA []byte) error { +func (m *QueryResourceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -983,10 +983,10 @@ func (m *QueryGetResourceResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetResourceResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResourceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1046,7 +1046,7 @@ func (m *QueryGetResourceResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetCollectionResourcesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryCollectionResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1069,10 +1069,10 @@ func (m *QueryGetCollectionResourcesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetCollectionResourcesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryCollectionResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetCollectionResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryCollectionResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1128,7 +1128,7 @@ func (m *QueryGetCollectionResourcesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetCollectionResourcesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryCollectionResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1151,10 +1151,10 @@ func (m *QueryGetCollectionResourcesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetCollectionResourcesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryCollectionResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetCollectionResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryCollectionResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/resource/types/v1/query.pb.gw.go b/x/resource/types/v1/query.pb.gw.go index b336b4974..f194d7046 100644 --- a/x/resource/types/v1/query.pb.gw.go +++ b/x/resource/types/v1/query.pb.gw.go @@ -34,7 +34,7 @@ var _ = descriptor.ForMessage var _ = metadata.Join func request_Query_Resource_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetResourceRequest + var protoReq QueryResourceRequest var metadata runtime.ServerMetadata var ( @@ -72,7 +72,7 @@ func request_Query_Resource_0(ctx context.Context, marshaler runtime.Marshaler, } func local_request_Query_Resource_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetResourceRequest + var protoReq QueryResourceRequest var metadata runtime.ServerMetadata var ( @@ -110,7 +110,7 @@ func local_request_Query_Resource_0(ctx context.Context, marshaler runtime.Marsh } func request_Query_CollectionResources_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetCollectionResourcesRequest + var protoReq QueryCollectionResourcesRequest var metadata runtime.ServerMetadata var ( @@ -137,7 +137,7 @@ func request_Query_CollectionResources_0(ctx context.Context, marshaler runtime. } func local_request_Query_CollectionResources_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetCollectionResourcesRequest + var protoReq QueryCollectionResourcesRequest var metadata runtime.ServerMetadata var (