diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 42b425a8..5031eba4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,18 +13,21 @@ updates: # Maintain dependencies for NPM - package-ecosystem: "npm" + target-branch: "develop" directory: "/" schedule: interval: "weekly" # Maintain dependencies for Docker - package-ecosystem: "docker" + target-branch: "develop" directory: "/" schedule: interval: "weekly" # Maintain dependencies for Golang - package-ecosystem: "gomod" + target-branch: "develop" directory: "/" schedule: interval: "weekly" diff --git a/.github/workflows/cleanup-actions.yml b/.github/workflows/cleanup-actions.yml index ad82df31..160fc24f 100644 --- a/.github/workflows/cleanup-actions.yml +++ b/.github/workflows/cleanup-actions.yml @@ -6,12 +6,12 @@ on: description: 'Retain days' required: true type: string - default: 30 + default: "30" minimum_runs: description: 'Minimum runs to keep for each workflow' required: true type: string - default: 0 + default: "0" delete_workflow_pattern: description: 'Name/filename of workflow. Default is all.' required: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13ae04d1..33548946 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v3 + uses: goreleaser/goreleaser-action@v4 with: distribution: goreleaser version: latest @@ -63,7 +63,7 @@ jobs: id: set-version run: | VERSION=$( git describe --tags ${{ github.sha }}) - echo ::set-output name=VERSION::"$VERSION" + echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" release-docker: name: "Release Docker image" diff --git a/README.md b/README.md index 9ff41524..14004055 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/cheqd/did-resolver?include_prereleases&label=dev%20release&style=flat-square)](https://github.com/cheqd/did-resolver/releases/) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/cheqd/did-resolver/latest?style=flat-square) [![GitHub contributors](https://img.shields.io/github/contributors/cheqd/did-resolver?label=contributors%20%E2%9D%A4%EF%B8%8F&style=flat-square)](https://github.com/cheqd/did-resolver/graphs/contributors) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/cheqd/did-resolver/Workflow%20Dispatch?label=workflows&style=flat-square)](https://github.com/cheqd/did-resolver/actions/workflows/dispatch.yml) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/cheqd/did-resolver/CodeQL?label=CodeQL&style=flat-square)](https://github.com/cheqd/did-resolver/actions/workflows/codeql.yml) ![GitHub repo size](https://img.shields.io/github/repo-size/cheqd/did-resolver?style=flat-square) +[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cheqd/did-resolver/dispatch.yml?label=workflows&style=flat-square)](https://github.com/cheqd/did-resolver/actions/workflows/dispatch.yml) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cheqd/did-resolver/codeql.yml?label=CodeQL&style=flat-square)](https://github.com/cheqd/did-resolver/actions/workflows/codeql.yml) ![GitHub repo size](https://img.shields.io/github/repo-size/cheqd/did-resolver?style=flat-square) ## ℹī¸ Overview @@ -73,6 +73,10 @@ RESOLVER_LISTNER="0.0.0.0:8080" Further documentation on [cheqd DID Resolver](https://docs.cheqd.io/identity/on-ledger-identity/did-resolver) is available on the [cheqd Identity Documentation site](https://docs.cheqd.io/identity/). This includes instructions on how to do custom builds using `Dockerfile` / Docker Compose. +## 🐞 Bug reports & 🤔 feature requests + +If you notice anything not behaving how you expected, or would like to make a suggestion / request for a new feature, please create a [**new issue**](https://github.com/cheqd/did-resolver/issues/new/choose) and let us know. + ## đŸ’Ŧ Community The [**cheqd Community Slack**](http://cheqd.link/join-cheqd-slack) is our primary chat channel for the open-source community, software developers, and node operators. diff --git a/cmd/serve.go b/cmd/serve.go index 4e7701ec..c6c8f979 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -1,8 +1,6 @@ package cmd import ( - "net/http" - "github.com/cheqd/did-resolver/services" "github.com/cheqd/did-resolver/types" "github.com/cheqd/did-resolver/utils" @@ -64,12 +62,11 @@ func serve() { // Routes e.GET(types.SWAGGER_PATH, echoSwagger.WrapHandler) e.GET(types.RESOLVER_PATH+":did", requestService.ResolveDIDDoc) + e.GET(types.RESOLVER_PATH+":did"+types.DID_VERSION_PATH+":version", requestService.ResolveDIDDocVersion) + e.GET(types.RESOLVER_PATH+":did"+types.DID_VERSIONS_PATH, requestService.ResolveAllDidDocVersionsMetadata) e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+":resource", requestService.DereferenceResourceData) e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+":resource/metadata", requestService.DereferenceResourceMetadata) - e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+"all", requestService.DereferenceCollectionResources) - e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+"", func(c echo.Context) error { - return c.Redirect(http.StatusMovedPermanently, "all") - }) + e.GET(types.RESOLVER_PATH+":did"+types.DID_METADATA, requestService.DereferenceCollectionResources) log.Info().Msg("Starting listener") log.Fatal().Err(e.Start(config.ResolverListener)) diff --git a/docs/docs.go b/docs/docs.go index 3a0ccb53..afdb1cf3 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -57,6 +57,12 @@ const docTemplate = `{ "description": "#Fragment", "name": "fragmentId", "in": "query" + }, + { + "type": "string", + "description": "Version", + "name": "versionId", + "in": "query" } ], "responses": { @@ -581,8 +587,13 @@ const docTemplate = `{ "example": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47#service-1" }, "serviceEndpoint": { - "type": "string", - "example": "https://example.com/endpoint/8377464" + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "https://example.com/endpoint/8377464" + ] }, "type": { "type": "string", diff --git a/docs/swagger.json b/docs/swagger.json index f0a1c5c5..21582dcb 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -49,6 +49,12 @@ "description": "#Fragment", "name": "fragmentId", "in": "query" + }, + { + "type": "string", + "description": "Version", + "name": "versionId", + "in": "query" } ], "responses": { @@ -573,8 +579,13 @@ "example": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47#service-1" }, "serviceEndpoint": { - "type": "string", - "example": "https://example.com/endpoint/8377464" + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "https://example.com/endpoint/8377464" + ] }, "type": { "type": "string", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f3c3eb01..08d2d628 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -199,8 +199,11 @@ definitions: example: did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47#service-1 type: string serviceEndpoint: - example: https://example.com/endpoint/8377464 - type: string + example: + - https://example.com/endpoint/8377464 + items: + type: string + type: array type: example: did-communication type: string @@ -254,6 +257,10 @@ paths: in: query name: fragmentId type: string + - description: Version + in: query + name: versionId + type: string produces: - application/did+ld+json - application/ld+json diff --git a/go.mod b/go.mod index ffeda1c5..d714db42 100644 --- a/go.mod +++ b/go.mod @@ -3,39 +3,47 @@ module github.com/cheqd/did-resolver go 1.18 require ( - github.com/cheqd/cheqd-node v0.6.10 + github.com/cheqd/cheqd-node v1.2.2 github.com/labstack/echo/v4 v4.9.1 + github.com/mr-tron/base58 v1.2.0 github.com/rs/zerolog v1.28.0 github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.14.0 github.com/stretchr/testify v1.8.1 github.com/swaggo/echo-swagger v1.3.5 - github.com/swaggo/swag v1.8.8 + github.com/swaggo/swag v1.8.9 google.golang.org/grpc v1.51.0 ) +require ( + github.com/99designs/go-keychain v0.0.0-20160105221929-9cf53c87839c // indirect + github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect + github.com/cosmos/gorocksdb v1.2.0 // indirect + github.com/golang/glog v1.0.0 // indirect + github.com/klauspost/compress v1.15.11 // indirect +) + require ( github.com/google/uuid v1.3.0 - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect ) require ( - filippo.io/edwards25519 v1.0.0-beta.2 // indirect - github.com/DataDog/zstd v1.4.5 // indirect + filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/KyleBanks/depth v1.2.1 // indirect - github.com/armon/go-metrics v0.4.0 // indirect - github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcd v0.22.1 // indirect + github.com/btcsuite/btcd v0.22.2 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/confio/ics23/go v0.7.0 // indirect - github.com/cosmos/btcutil v1.0.4 // indirect - github.com/cosmos/cosmos-sdk v0.45.9 // indirect + github.com/confio/ics23/go v0.9.0 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/cosmos-sdk v0.46.8 // indirect + github.com/cosmos/gogoproto v1.4.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d // indirect - github.com/dgraph-io/badger/v2 v2.2007.2 // indirect - github.com/dgraph-io/ristretto v0.0.3 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/ristretto v0.1.0 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect @@ -51,12 +59,12 @@ require ( github.com/gogo/protobuf v1.3.3 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/golang/snappy v0.0.3 // indirect - github.com/google/btree v1.0.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.0.1 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmhodges/levigo v1.0.0 // indirect @@ -74,9 +82,8 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect + github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mr-tron/base58 v1.1.0 // indirect github.com/multiformats/go-base32 v0.0.3 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-multibase v0.1.1 // indirect @@ -88,30 +95,29 @@ require ( github.com/prometheus/client_golang v1.12.2 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.34.0 // indirect - github.com/prometheus/procfs v0.7.3 // indirect - github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect + github.com/prometheus/procfs v0.8.0 // indirect + github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/afero v1.9.2 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // indirect - github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tendermint/tendermint v0.34.21 // indirect - github.com/tendermint/tm-db v0.6.6 // indirect + github.com/tendermint/tendermint v0.34.24 // indirect + github.com/tendermint/tm-db v0.6.7 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasttemplate v1.2.1 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect + golang.org/x/crypto v0.2.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect - golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/net v0.5.0 // indirect + golang.org/x/sys v0.4.0 // indirect + golang.org/x/text v0.6.0 // indirect golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - golang.org/x/tools v0.1.12 // indirect - google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // indirect + golang.org/x/tools v0.2.0 // indirect + google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 9d705f5b..aa5c256c 100644 --- a/go.sum +++ b/go.sum @@ -36,16 +36,15 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX 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= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= -filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= -github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= +filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= +filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +github.com/99designs/go-keychain v0.0.0-20160105221929-9cf53c87839c h1:T9RAZbgkOMXn6UM1mnDrtt992kepEt/VfQKFGZx3V9c= +github.com/99designs/go-keychain v0.0.0-20160105221929-9cf53c87839c/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= +github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= @@ -53,7 +52,6 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -62,35 +60,27 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -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/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -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/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= +github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= +github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheqd/cheqd-node v0.6.10 h1:d4BMjgetLw9qGiPC5iJ80EQGKzpPaZIYXZoEnl2yCu8= -github.com/cheqd/cheqd-node v0.6.10/go.mod h1:qleVcKI+Dgj2e1Dug1wRriOrjytlrz2YKh5BrSP0quE= +github.com/cheqd/cheqd-node v1.2.2 h1:oQl732gnP2HmEmp6DKLmVsNAjoE0JnZNBRRbQmc6lPE= +github.com/cheqd/cheqd-node v1.2.2/go.mod h1:t4KptNTF4r67poQiPq9BlGZy0pOwDkRkzi7/40UnAMM= github.com/cheqd/cosmos-sdk v0.45.9-cheqd-tag h1:K1eIYxqaQ5aFSVAnPNOeU12U0B3mStYN0vrawMoUkCY= github.com/cheqd/cosmos-sdk v0.45.9-cheqd-tag/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -102,55 +92,55 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk 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-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/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -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/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/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= -github.com/cosmos/iavl v0.19.3 h1:cESO0OwTTxQm5rmyESKW+zESheDUYI7CcZDWWDwnuxg= -github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= -github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= +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/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= 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= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d h1:1iy2qD6JEhHKKhUOA9IWs7mjco7lnw2qx8FsRI2wirE= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE= -github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= -github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= +github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.3 h1:jh22xisGBjrEVnRZ1DVTpBVQm0Xndu8sMl0CWDzSIBI= -github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= +github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= +github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= 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.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.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/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= @@ -175,6 +165,7 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -199,6 +190,8 @@ github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -228,12 +221,13 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw 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/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= 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= @@ -288,24 +282,22 @@ github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCS github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM= +github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -316,10 +308,11 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= 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/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -368,9 +361,9 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -380,8 +373,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mr-tron/base58 v1.1.0 h1:Y51FGVJ91WBqCEabAi5OPUz38eAx8DakuAm5svLcsfQ= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= +github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= @@ -395,14 +388,13 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 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/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.22.0 h1:AIg2/OntwkBiCg5Tt1ayyiF1ArFrWFoCSMtMi/wdApk= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= @@ -449,10 +441,11 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= @@ -465,8 +458,8 @@ github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6us github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= +github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -515,27 +508,26 @@ github.com/swaggo/echo-swagger v1.3.5/go.mod h1:3IMHd2Z8KftdWFEEjGmv6QpWj370LwMC github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY= github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= -github.com/swaggo/swag v1.8.8 h1:/GgJmrJ8/c0z4R4hoEPZ5UeEhVGdvsII4JbVDLbR7Xc= -github.com/swaggo/swag v1.8.8/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= +github.com/swaggo/swag v1.8.9 h1:kHtaBe/Ob9AZzAANfcn5c6RyCke9gG9QpH0jky0I/sA= +github.com/swaggo/swag v1.8.9/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tendermint v0.34.21 h1:UiGGnBFHVrZhoQVQ7EfwSOLuCtarqCSsRf8VrklqB7s= -github.com/tendermint/tendermint v0.34.21/go.mod h1:XDvfg6U7grcFTDx7VkzxnhazQ/bspGJAn4DZ6DcLLjQ= -github.com/tendermint/tm-db v0.6.6 h1:EzhaOfR0bdKyATqcd5PNeyeq8r+V4bRPHBfyFdD9kGM= -github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= +github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZDI82ky+4k= +github.com/tendermint/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= +github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= +github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= +github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -543,7 +535,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= +github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= +github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -552,8 +545,6 @@ 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.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -561,7 +552,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -569,8 +559,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20221012134737-56aed061732a h1:NmSIgad6KjE6VvHciPZuNRTKxGhlPfD6OA87W/PLkqg= -golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +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-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -608,7 +598,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= 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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -653,8 +643,8 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx 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-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -740,11 +730,11 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/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.0.0-20221010170243-090e33056c14 h1:k5II8e6QD8mITdi+okbbmR/cIyEbeXLBhy5Ha4nevyc= -golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= +golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -753,8 +743,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -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/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -813,8 +803,8 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= 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= @@ -884,8 +874,8 @@ 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-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -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.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -903,8 +893,6 @@ 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.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= 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= @@ -919,8 +907,8 @@ 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.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/package-lock.json b/package-lock.json index cc79fc58..20126a47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1093,9 +1093,9 @@ } }, "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" @@ -1433,9 +1433,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" @@ -1871,9 +1871,9 @@ } }, "node_modules/marked": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.3.tgz", - "integrity": "sha512-slWRdJkbTZ+PjkyJnE30Uid64eHwbwa1Q25INCAYfZlK4o6ylagBy/Le9eWntqJFoFT93ikUKMv47GZ4gTwHkw==", + "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" @@ -1903,9 +1903,9 @@ } }, "node_modules/marked-terminal/node_modules/chalk": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", - "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" diff --git a/services/diddoc_service.go b/services/diddoc_service.go index d4e5a63e..314030bb 100644 --- a/services/diddoc_service.go +++ b/services/diddoc_service.go @@ -4,9 +4,13 @@ import ( "net/url" "strings" - cheqdTypes "github.com/cheqd/cheqd-node/x/cheqd/types" - cheqdUtils "github.com/cheqd/cheqd-node/x/cheqd/utils" + migrations "github.com/cheqd/cheqd-node/app/migrations/helpers" + didTypes "github.com/cheqd/cheqd-node/x/did/types" + didUtils "github.com/cheqd/cheqd-node/x/did/utils" + "github.com/google/uuid" + "github.com/cheqd/did-resolver/types" + "github.com/cheqd/did-resolver/utils" "github.com/rs/zerolog/log" ) @@ -43,15 +47,23 @@ func (dds DIDDocService) ProcessDIDRequest(did string, fragmentId string, querie var err *types.IdentityError var isDereferencing bool - if len(queries) > 0 || flag != nil { + version := "" + if len(queries) > 0 { + version = queries.Get("versionId") + if version == "" { + return nil, types.NewRepresentationNotSupportedError(did, contentType, nil, true) + } + } + + if flag != nil { return nil, types.NewRepresentationNotSupportedError(did, contentType, nil, true) } else if fragmentId != "" { log.Trace().Msgf("Dereferencing %s, %s, %s", did, fragmentId, queries) - result, err = dds.dereferenceSecondary(did, fragmentId, contentType) + result, err = dds.dereferenceSecondary(did, version, fragmentId, contentType) isDereferencing = true } else { log.Trace().Msgf("Resolving %s", did) - result, err = dds.Resolve(did, contentType) + result, err = dds.Resolve(did, version, contentType) isDereferencing = false } @@ -62,34 +74,62 @@ func (dds DIDDocService) ProcessDIDRequest(did string, fragmentId string, querie return result, nil } -func (dds DIDDocService) Resolve(did string, contentType types.ContentType) (*types.DidResolution, *types.IdentityError) { +func (dds DIDDocService) Resolve(did string, version string, contentType types.ContentType) (*types.DidResolution, *types.IdentityError) { if !contentType.IsSupported() { return nil, types.NewRepresentationNotSupportedError(did, types.JSON, nil, false) } didResolutionMetadata := types.NewResolutionMetadata(did, contentType, "") - if didMethod, _, _, _ := cheqdUtils.TrySplitDID(did); didMethod != dds.didMethod { + didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + + if didMethod != dds.didMethod { return nil, types.NewMethodNotSupportedError(did, contentType, nil, false) } - if !cheqdUtils.IsValidDID(did, "", dds.ledgerService.GetNamespaces()) { - return nil, types.NewInvalidDIDError(did, contentType, nil, false) + + if !didUtils.IsValidDID(did, "", dds.ledgerService.GetNamespaces()) { + err := didUtils.ValidateDID(did, "", dds.ledgerService.GetNamespaces()) + if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsValidV1ID(identifier) { + did = migrations.MigrateIndyStyleDid(did) + } else { + return nil, types.NewInvalidDIDError(did, contentType, nil, false) + } } - protoDidDoc, metadata, err := dds.ledgerService.QueryDIDDoc(did) + protoDidDocWithMetadata, err := dds.ledgerService.QueryDIDDoc(did, version) if err != nil { - err.ContentType = contentType - return nil, err + _, parsingerr := uuid.Parse(identifier) + if parsingerr == nil { + did = migrations.MigrateUUIDDid(did) + protoDidDocWithMetadata, err = dds.ledgerService.QueryDIDDoc(did, version) + if err != nil { + err.ContentType = contentType + return nil, err + } + } else { + err.ContentType = contentType + return nil, err + } } - resolvedMetadata, mErr := dds.resolveMetadata(did, *metadata, contentType) + resolvedMetadata, mErr := dds.resolveMetadata(did, *protoDidDocWithMetadata.Metadata, contentType) if mErr != nil { mErr.ContentType = contentType return nil, mErr } - didDoc := types.NewDidDoc(*protoDidDoc) + didDoc := types.NewDidDoc(*protoDidDocWithMetadata.DidDoc) result := types.DidResolution{Did: &didDoc, Metadata: *resolvedMetadata, ResolutionMetadata: didResolutionMetadata} if didResolutionMetadata.ContentType == types.DIDJSONLD || didResolutionMetadata.ContentType == types.JSONLD { didDoc.AddContext(types.DIDSchemaJSONLD) + for _, method := range didDoc.VerificationMethod { + switch method.Type { + case "Ed25519VerificationKey2020": + didDoc.AddContext(types.Ed25519VerificationKey2020JSONLD) + case "Ed25519VerificationKey2018": + didDoc.AddContext(types.Ed25519VerificationKey2018JSONLD) + case "JsonWebKey2020": + didDoc.AddContext(types.JsonWebKey2020JSONLD) + } + } result.Context = types.ResolutionSchemaJSONLD } else { didDoc.RemoveContext() @@ -97,8 +137,53 @@ func (dds DIDDocService) Resolve(did string, contentType types.ContentType) (*ty return &result, nil } -func (dds DIDDocService) dereferenceSecondary(did string, fragmentId string, contentType types.ContentType) (*types.DidDereferencing, *types.IdentityError) { - didResolution, err := dds.Resolve(did, contentType) +func (dds DIDDocService) GetAllDidDocVersionsMetadata(did string, contentType types.ContentType) (*types.DidDereferencing, *types.IdentityError) { + didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + if didMethod != dds.didMethod { + return nil, types.NewMethodNotSupportedError(did, contentType, nil, false) + } + + dereferenceMetadata := types.NewDereferencingMetadata(did, contentType, "") + + if !didUtils.IsValidDID(did, "", dds.ledgerService.GetNamespaces()) { + err := didUtils.ValidateDID(did, "", dds.ledgerService.GetNamespaces()) + if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsValidV1ID(identifier) { + did = migrations.MigrateIndyStyleDid(did) + } else { + return nil, types.NewMethodNotSupportedError(did, contentType, nil, false) + } + } + + versions, err := dds.ledgerService.QueryAllDidDocVersionsMetadata(did) + if err != nil { + _, parsingerr := uuid.Parse(identifier) + if parsingerr == nil { + did = migrations.MigrateUUIDDid(did) + versions, err = dds.ledgerService.QueryAllDidDocVersionsMetadata(did) + if err != nil { + return nil, err + } + } else { + return nil, err + } + } + + if len(versions) == 0 { + return nil, types.NewNotFoundError(did, contentType, err, false) + } + + var context string + if contentType == types.DIDJSONLD || contentType == types.JSONLD { + context = types.ResolutionSchemaJSONLD + } + + contentStream := types.NewDereferencedDidVersionsList(versions) + + return &types.DidDereferencing{Context: context, ContentStream: contentStream, DereferencingMetadata: dereferenceMetadata}, nil +} + +func (dds DIDDocService) dereferenceSecondary(did string, version string, fragmentId string, contentType types.ContentType) (*types.DidDereferencing, *types.IdentityError) { + didResolution, err := dds.Resolve(did, version, contentType) if err != nil { err.IsDereferencing = true return nil, err @@ -133,11 +218,7 @@ func (dds DIDDocService) dereferenceSecondary(did string, fragmentId string, con return &result, nil } -func (dds DIDDocService) resolveMetadata(did string, metadata cheqdTypes.Metadata, contentType types.ContentType) (*types.ResolutionDidDocMetadata, *types.IdentityError) { - if metadata.Resources == nil { - resolvedMetadata := types.NewResolutionDidDocMetadata(did, metadata, nil) - return &resolvedMetadata, nil - } +func (dds DIDDocService) resolveMetadata(did string, metadata didTypes.Metadata, contentType types.ContentType) (*types.ResolutionDidDocMetadata, *types.IdentityError) { resources, err := dds.ledgerService.QueryCollectionResources(did) if err != nil { return nil, err diff --git a/services/diddoc_service_test.go b/services/diddoc_service_test.go index efff7b5f..acc88d76 100644 --- a/services/diddoc_service_test.go +++ b/services/diddoc_service_test.go @@ -5,7 +5,7 @@ import ( "net/url" "testing" - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" + did "github.com/cheqd/cheqd-node/x/did/types" resource "github.com/cheqd/cheqd-node/x/resource/types" "github.com/cheqd/did-resolver/types" "github.com/cheqd/did-resolver/utils" @@ -77,12 +77,12 @@ func TestResolve(t *testing.T) { method: utils.ValidMethod, namespace: utils.ValidNamespace, expectedDID: &validDIDDocResolution, - expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.ResourceHeader{validResource.Header}), + expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.Metadata{validResource.Metadata}), expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, identifier: utils.ValidIdentifier, method: utils.ValidMethod, @@ -93,7 +93,7 @@ func TestResolve(t *testing.T) { }, { name: "invalid DID", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, identifier: "oooooo0000OOOO_invalid_did", method: utils.ValidMethod, @@ -104,7 +104,7 @@ func TestResolve(t *testing.T) { }, { name: "invalid method", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, identifier: utils.ValidIdentifier, method: "not_supported_method", @@ -115,7 +115,7 @@ func TestResolve(t *testing.T) { }, { name: "invalid namespace", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, identifier: utils.ValidIdentifier, method: utils.ValidMethod, @@ -139,6 +139,7 @@ func TestResolve(t *testing.T) { } for _, subtest := range subtests { + fmt.Printf("Testing %s", subtest.name) id := "did:" + subtest.method + ":" + subtest.namespace + ":" + subtest.identifier t.Run(subtest.name, func(t *testing.T) { diddocService := NewDIDDocService("cheqd", subtest.ledgerService) @@ -148,7 +149,7 @@ func TestResolve(t *testing.T) { Method: subtest.method, } if (subtest.resolutionType == "" || subtest.resolutionType == types.DIDJSONLD) && subtest.expectedError == nil { - subtest.expectedDID.Context = []string{types.DIDSchemaJSONLD} + subtest.expectedDID.Context = []string{types.DIDSchemaJSONLD, types.JsonWebKey2020JSONLD} } else if subtest.expectedDID != nil { subtest.expectedDID.Context = nil } @@ -156,7 +157,7 @@ func TestResolve(t *testing.T) { if expectedContentType == "" { expectedContentType = subtest.resolutionType } - resolutionResult, err := diddocService.Resolve(id, subtest.resolutionType) + resolutionResult, err := diddocService.Resolve(id, "", subtest.resolutionType) // print(resolutionResult.Did.Id) if subtest.expectedError != nil { require.EqualValues(t, subtest.expectedError.Code, err.Code) @@ -178,7 +179,7 @@ func TestDereferencing(t *testing.T) { validService := utils.ValidService() validResource := utils.ValidResource() validMetadata := utils.ValidMetadata() - validFragmentMetadata := types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.ResourceHeader{}) + validFragmentMetadata := types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.Metadata{}) validQuery, _ := url.ParseQuery("attr=value") subtests := []struct { name string @@ -214,7 +215,7 @@ func TestDereferencing(t *testing.T) { }, { name: "not supported query", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, did: utils.ValidDid, queries: validQuery, @@ -224,7 +225,7 @@ func TestDereferencing(t *testing.T) { }, { name: "key not found", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, did: utils.ValidDid, fragmentId: "notFoundKey", diff --git a/services/ledger_service.go b/services/ledger_service.go index bf7f82d0..1d34014d 100644 --- a/services/ledger_service.go +++ b/services/ledger_service.go @@ -8,8 +8,8 @@ import ( "google.golang.org/grpc/credentials" - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" - cheqdUtils "github.com/cheqd/cheqd-node/x/cheqd/utils" + didTypes "github.com/cheqd/cheqd-node/x/did/types" + didUtils "github.com/cheqd/cheqd-node/x/did/utils" resource "github.com/cheqd/cheqd-node/x/resource/types" "github.com/cheqd/did-resolver/types" "github.com/rs/zerolog/log" @@ -22,9 +22,10 @@ const ( ) type LedgerServiceI interface { - QueryDIDDoc(did string) (*cheqd.Did, *cheqd.Metadata, *types.IdentityError) - QueryResource(collectionDid string, resourceId string) (*resource.Resource, *types.IdentityError) - QueryCollectionResources(did string) ([]*resource.ResourceHeader, *types.IdentityError) + QueryDIDDoc(did string, version string) (*didTypes.DidDocWithMetadata, *types.IdentityError) + QueryAllDidDocVersionsMetadata(did string) ([]*didTypes.Metadata, *types.IdentityError) + QueryResource(collectionDid string, resourceId string) (*resource.ResourceWithMetadata, *types.IdentityError) + QueryCollectionResources(did string) ([]*resource.Metadata, *types.IdentityError) GetNamespaces() []string } @@ -40,43 +41,79 @@ func NewLedgerService() LedgerService { // QueryDIDDoc godoc // -// @Summary Resolve DID Document on did:cheqd -// @Description Fetch DID Document ("DIDDoc") from cheqd network -// @Tags DID Resolution -// @Accept application/did+ld+json,application/ld+json,application/did+json -// @Produce application/did+ld+json,application/ld+json,application/did+json -// @Param did path string true "Full DID with unique identifier" -// @Param service query string false "Service Type" -// @Param fragmentId query string false "#Fragment" -// @Success 200 {object} types.DidResolution -// @Failure 400 {object} types.IdentityError -// @Failure 404 {object} types.IdentityError -// @Failure 406 {object} types.IdentityError -// @Failure 500 {object} types.IdentityError -// @Router /{did} [get] -func (ls LedgerService) QueryDIDDoc(did string) (*cheqd.Did, *cheqd.Metadata, *types.IdentityError) { - method, namespace, _, _ := cheqdUtils.TrySplitDID(did) +// @Summary Resolve DID Document on did:cheqd +// @Description Fetch DID Document ("DIDDoc") from cheqd network +// @Tags DID Resolution +// @Accept application/did+ld+json,application/ld+json,application/did+json +// @Produce application/did+ld+json,application/ld+json,application/did+json +// @Param did path string true "Full DID with unique identifier" +// @Param service query string false "Service Type" +// @Param fragmentId query string false "#Fragment" +// @Param versionId query string false "Version" +// @Success 200 {object} types.DidResolution +// @Failure 400 {object} types.IdentityError +// @Failure 404 {object} types.IdentityError +// @Failure 406 {object} types.IdentityError +// @Failure 500 {object} types.IdentityError +// @Router /{did} [get] +func (ls LedgerService) QueryDIDDoc(did string, version string) (*didTypes.DidDocWithMetadata, *types.IdentityError) { + method, namespace, _, _ := didUtils.TrySplitDID(did) serverAddr, namespaceFound := ls.ledgers[method+DELIMITER+namespace] if !namespaceFound { - return nil, nil, types.NewInvalidDIDError(did, types.JSON, nil, false) + return nil, types.NewInvalidDIDError(did, types.JSON, nil, false) } conn, err := ls.openGRPCConnection(serverAddr) if err != nil { log.Error().Err(err).Msg("QueryDIDDoc: failed connection") - return nil, nil, types.NewInternalError(did, types.JSON, err, false) + return nil, types.NewInternalError(did, types.JSON, err, false) } defer mustCloseGRPCConnection(conn) log.Info().Msgf("Querying did doc: %s", did) - client := cheqd.NewQueryClient(conn) - didDocResponse, err := client.Did(context.Background(), &cheqd.QueryGetDidRequest{Id: did}) + client := didTypes.NewQueryClient(conn) + + if version == "" { + didDocResponse, err := client.DidDoc(context.Background(), &didTypes.QueryDidDocRequest{Id: did}) + if err != nil { + return nil, types.NewNotFoundError(did, types.JSON, err, false) + } + + return didDocResponse.Value, nil + } else { + didDocResponse, err := client.DidDocVersion(context.Background(), &didTypes.QueryDidDocVersionRequest{Id: did, Version: version}) + if err != nil { + return nil, types.NewNotFoundError(did, types.JSON, err, false) + } + + return didDocResponse.Value, nil + } +} + +func (ls LedgerService) QueryAllDidDocVersionsMetadata(did string) ([]*didTypes.Metadata, *types.IdentityError) { + method, namespace, _, _ := didUtils.TrySplitDID(did) + serverAddr, namespaceFound := ls.ledgers[method+DELIMITER+namespace] + if !namespaceFound { + return nil, types.NewInvalidDIDError(did, types.JSON, nil, false) + } + + conn, err := ls.openGRPCConnection(serverAddr) if err != nil { - return nil, nil, types.NewNotFoundError(did, types.JSON, err, false) + log.Error().Err(err).Msg("QueryAllDidDocVersionsMetadata: failed connection") + return nil, types.NewInternalError(did, types.JSON, err, false) + } + defer mustCloseGRPCConnection(conn) + + log.Info().Msgf("Querying all did doc versions metadata: %s", did) + client := didTypes.NewQueryClient(conn) + + response, err := client.AllDidDocVersionsMetadata(context.Background(), &didTypes.QueryAllDidDocVersionsMetadataRequest{Id: did}) + if err != nil { + return nil, types.NewNotFoundError(did, types.JSON, err, false) } - return didDocResponse.Did, didDocResponse.Metadata, nil + return response.Versions, nil } // QueryResource godoc @@ -94,8 +131,8 @@ func (ls LedgerService) QueryDIDDoc(did string) (*cheqd.Did, *cheqd.Metadata, *t // @Failure 406 {object} types.IdentityError // @Failure 500 {object} types.IdentityError // @Router /{did}/resources/{resourceId} [get] -func (ls LedgerService) QueryResource(did string, resourceId string) (*resource.Resource, *types.IdentityError) { - method, namespace, collectionId, _ := cheqdUtils.TrySplitDID(did) +func (ls LedgerService) QueryResource(did string, resourceId string) (*resource.ResourceWithMetadata, *types.IdentityError) { + method, namespace, collectionId, _ := didUtils.TrySplitDID(did) serverAddr, namespaceFound := ls.ledgers[method+DELIMITER+namespace] if !namespaceFound { return nil, types.NewInvalidDIDError(did, types.JSON, nil, true) @@ -112,7 +149,7 @@ func (ls LedgerService) QueryResource(did string, resourceId string) (*resource. log.Info().Msgf("Querying did resource: %s, %s", collectionId, resourceId) client := resource.NewQueryClient(conn) - resourceResponse, err := client.Resource(context.Background(), &resource.QueryGetResourceRequest{CollectionId: collectionId, Id: resourceId}) + resourceResponse, err := client.Resource(context.Background(), &resource.QueryResourceRequest{CollectionId: collectionId, Id: resourceId}) if err != nil { log.Info().Msgf("Resource not found %s", err.Error()) return nil, types.NewNotFoundError(did, types.JSON, err, true) @@ -134,9 +171,9 @@ func (ls LedgerService) QueryResource(did string, resourceId string) (*resource. // @Failure 404 {object} types.IdentityError // @Failure 406 {object} types.IdentityError // @Failure 500 {object} types.IdentityError -// @Router /{did}/resources/all [get] -func (ls LedgerService) QueryCollectionResources(did string) ([]*resource.ResourceHeader, *types.IdentityError) { - method, namespace, collectionId, _ := cheqdUtils.TrySplitDID(did) +// @Router /{did}/metadata [get] +func (ls LedgerService) QueryCollectionResources(did string) ([]*resource.Metadata, *types.IdentityError) { + method, namespace, collectionId, _ := didUtils.TrySplitDID(did) serverAddr, namespaceFound := ls.ledgers[method+DELIMITER+namespace] if !namespaceFound { return nil, types.NewInvalidDIDError(did, types.JSON, nil, false) @@ -151,7 +188,7 @@ func (ls LedgerService) QueryCollectionResources(did string) ([]*resource.Resour log.Info().Msgf("Querying did resources: %s", did) client := resource.NewQueryClient(conn) - resourceResponse, err := client.CollectionResources(context.Background(), &resource.QueryGetCollectionResourcesRequest{CollectionId: collectionId}) + resourceResponse, err := client.CollectionResources(context.Background(), &resource.QueryCollectionResourcesRequest{CollectionId: collectionId}) if err != nil { return nil, types.NewNotFoundError(did, types.JSON, err, false) } diff --git a/services/ledger_service_test.go b/services/ledger_service_test.go index 13c271dd..0985d21d 100644 --- a/services/ledger_service_test.go +++ b/services/ledger_service_test.go @@ -3,7 +3,7 @@ package services import ( "testing" - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" + didTypes "github.com/cheqd/cheqd-node/x/did/types" resource "github.com/cheqd/cheqd-node/x/resource/types" "github.com/cheqd/did-resolver/types" "github.com/stretchr/testify/require" @@ -11,29 +11,26 @@ import ( func TestQueryDIDDoc(t *testing.T) { subtests := []struct { - name string - did string - expectedDID *cheqd.Did - expectedMetadata *cheqd.Metadata - expectedIsFound bool - expectedError error + name string + did string + expectedDidDocWithMetada *didTypes.DidDocWithMetadata + expectedIsFound bool + expectedError error }{ { - name: "DeadlineExceeded", - did: "fake did", - expectedDID: nil, - expectedMetadata: nil, - expectedIsFound: false, - expectedError: types.NewInvalidDIDError("fake did", types.JSON, nil, false), + name: "DeadlineExceeded", + did: "fake did", + expectedDidDocWithMetada: nil, + expectedIsFound: false, + expectedError: types.NewInvalidDIDError("fake did", types.JSON, nil, false), }, } for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { ledgerService := NewLedgerService() - didDoc, metadata, err := ledgerService.QueryDIDDoc("fake did") - require.EqualValues(t, subtest.expectedDID, didDoc) - require.EqualValues(t, subtest.expectedMetadata, metadata) + didDocWithMetadata, err := ledgerService.QueryDIDDoc("fake did", "") + require.EqualValues(t, subtest.expectedDidDocWithMetada, didDocWithMetadata) require.EqualValues(t, subtest.expectedError.Error(), err.Error()) }) } @@ -44,7 +41,7 @@ func TestQueryResource(t *testing.T) { name string collectionDid string resourceId string - expectedResource *resource.Resource + expectedResource *resource.ResourceWithMetadata expectedError error }{ { diff --git a/services/request_service.go b/services/request_service.go index 29de0a63..bd927daa 100644 --- a/services/request_service.go +++ b/services/request_service.go @@ -51,6 +51,43 @@ func (rs RequestService) ResolveDIDDoc(c echo.Context) error { return c.JSONPretty(http.StatusOK, result, " ") } +func (rs RequestService) ResolveDIDDocVersion(c echo.Context) error { + requestedContentType := getContentType(c.Request().Header.Get(echo.HeaderAccept)) + + did, err := getDidParam(c) + if err != nil { + return types.NewInvalidDIDUrlError(c.Param("did"), requestedContentType, err, true) + } + + version := c.Param("version") + + result, rErr := rs.didDocService.Resolve(did, version, requestedContentType) + if rErr != nil { + return rErr + } + + c.Response().Header().Set(echo.HeaderContentType, result.GetContentType()) + + return c.JSONPretty(http.StatusOK, result, " ") +} + +func (rs RequestService) ResolveAllDidDocVersionsMetadata(c echo.Context) error { + requestedContentType := getContentType(c.Request().Header.Get(echo.HeaderAccept)) + did, err := getDidParam(c) + if err != nil { + return types.NewInvalidDIDUrlError(c.Param("did"), requestedContentType, err, true) + } + + result, rErr := rs.didDocService.GetAllDidDocVersionsMetadata(did, requestedContentType) + if rErr != nil { + return rErr + } + + c.Response().Header().Set(echo.HeaderContentType, result.GetContentType()) + + return c.JSONPretty(http.StatusOK, result, " ") +} + // DereferenceResourceMetadata godoc // // @Summary Fetch Resource-specific metadata diff --git a/services/request_service_test.go b/services/request_service_test.go index 1e4e7d63..758e07ac 100644 --- a/services/request_service_test.go +++ b/services/request_service_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" + did "github.com/cheqd/cheqd-node/x/did/types" resource "github.com/cheqd/cheqd-node/x/resource/types" "github.com/cheqd/did-resolver/types" "github.com/cheqd/did-resolver/utils" @@ -35,12 +35,12 @@ func TestResolveDIDDoc(t *testing.T) { resolutionType: types.DIDJSONLD, did: utils.ValidDid, expectedDID: &validDIDResolution, - expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.ResourceHeader{validResource.Header}), + expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.Metadata{validResource.Metadata}), expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, did: utils.ValidDid, expectedDID: nil, @@ -55,7 +55,7 @@ func TestResolveDIDDoc(t *testing.T) { requestService := NewRequestService("cheqd", subtest.ledgerService) if (subtest.resolutionType == "" || subtest.resolutionType == types.DIDJSONLD) && subtest.expectedError == nil { - subtest.expectedDID.Context = []string{types.DIDSchemaJSONLD} + subtest.expectedDID.Context = []string{types.DIDSchemaJSONLD, types.JsonWebKey2020JSONLD} } else if subtest.expectedDID != nil { subtest.expectedDID.Context = nil } @@ -84,7 +84,7 @@ func TestRequestService_DereferenceResourceData(t *testing.T) { validDIDDoc := utils.ValidDIDDoc() validMetadata := utils.ValidMetadata() validResource := utils.ValidResource() - validResourceDereferencing := types.DereferencedResourceData(validResource.Data) + validResourceDereferencing := types.DereferencedResourceData(validResource.Resource.Data) subtests := []struct { name string ledgerService utils.MockLedgerService @@ -103,12 +103,12 @@ func TestRequestService_DereferenceResourceData(t *testing.T) { did: utils.ValidDid, resourceId: utils.ValidResourceId, expectedResource: &validResourceDereferencing, - expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.ResourceHeader{validResource.Header}), + expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.Metadata{validResource.Metadata}), expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, did: utils.ValidDid, resourceId: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", @@ -125,7 +125,7 @@ func TestRequestService_DereferenceResourceData(t *testing.T) { []string{"did", "resource"}, []string{subtest.did, subtest.resourceId}, subtest.resolutionType) requestService := NewRequestService("cheqd", subtest.ledgerService) - expectedContentType := validResource.Header.MediaType + expectedContentType := validResource.Metadata.MediaType err := requestService.DereferenceResourceData(context) @@ -164,14 +164,14 @@ func TestRequestService_DereferenceResourceMetadata(t *testing.T) { resourceId: utils.ValidResourceId, expectedResource: types.NewDereferencedResourceList( utils.ValidDid, - []*resource.ResourceHeader{validResource.Header}, + []*resource.Metadata{validResource.Metadata}, ), expectedMetadata: types.ResolutionDidDocMetadata{}, expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, did: utils.ValidDid, resourceId: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", @@ -241,14 +241,14 @@ func TestRequestService_DereferenceCollectionResources(t *testing.T) { did: utils.ValidDid, expectedResource: types.NewDereferencedResourceList( utils.ValidDid, - []*resource.ResourceHeader{validResource.Header}, + []*resource.Metadata{validResource.Metadata}, ), expectedMetadata: types.ResolutionDidDocMetadata{}, expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, did: utils.ValidDid, expectedResource: nil, @@ -260,7 +260,7 @@ func TestRequestService_DereferenceCollectionResources(t *testing.T) { for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { context, rec := setupContext( - "/1.0/identifiers/:did/resources/all", + "/1.0/identifiers/:did/metadata", []string{"did"}, []string{subtest.did}, subtest.resolutionType) requestService := NewRequestService("cheqd", subtest.ledgerService) diff --git a/services/resource_dereference_service.go b/services/resource_dereference_service.go index e971436f..4992a1fa 100644 --- a/services/resource_dereference_service.go +++ b/services/resource_dereference_service.go @@ -6,7 +6,7 @@ import ( "strings" - cheqdUtils "github.com/cheqd/cheqd-node/x/cheqd/utils" + didUtils "github.com/cheqd/cheqd-node/x/did/utils" resourceTypes "github.com/cheqd/cheqd-node/x/resource/types" "github.com/cheqd/did-resolver/types" "github.com/cheqd/did-resolver/utils" @@ -38,7 +38,7 @@ func (rds ResourceService) DereferenceResourceMetadata(resourceId string, did st if contentType == types.DIDJSONLD || contentType == types.JSONLD { context = types.ResolutionSchemaJSONLD } - contentStream := types.NewDereferencedResourceList(did, []*resourceTypes.ResourceHeader{resource.Header}) + contentStream := types.NewDereferencedResourceList(did, []*resourceTypes.Metadata{resource.Metadata}) return &types.DidDereferencing{Context: context, ContentStream: contentStream, DereferencingMetadata: dereferenceMetadata}, nil } @@ -73,8 +73,8 @@ func (rds ResourceService) DereferenceResourceData(resourceId string, did string err.ContentType = contentType return nil, err } - result := types.DereferencedResourceData(resource.Data) - dereferenceMetadata.ContentType = types.ContentType(resource.Header.MediaType) + result := types.DereferencedResourceData(resource.Resource.Data) + dereferenceMetadata.ContentType = types.ContentType(resource.Metadata.MediaType) return &types.DidDereferencing{ContentStream: &result, DereferencingMetadata: dereferenceMetadata}, nil } @@ -82,7 +82,7 @@ func (rds ResourceService) validateResourceRequest(did string, resourceId *strin if !contentType.IsSupported() { return types.NewRepresentationNotSupportedError(did, types.JSON, nil, true) } - if !cheqdUtils.IsValidDID(did, rds.didMethod, rds.ledgerService.GetNamespaces()) || (resourceId != nil && !utils.IsValidResourceId(*resourceId)) { + if !didUtils.IsValidDID(did, rds.didMethod, rds.ledgerService.GetNamespaces()) || (resourceId != nil && !utils.IsValidResourceId(*resourceId)) { return types.NewInvalidDIDUrlError(did, contentType, nil, true) } return nil diff --git a/services/resource_dereference_service_test.go b/services/resource_dereference_service_test.go index eeb95f69..aa100f72 100644 --- a/services/resource_dereference_service_test.go +++ b/services/resource_dereference_service_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" + did "github.com/cheqd/cheqd-node/x/did/types" resource "github.com/cheqd/cheqd-node/x/resource/types" "github.com/cheqd/did-resolver/types" "github.com/cheqd/did-resolver/utils" @@ -57,7 +57,7 @@ func getSubtest(validContentStream types.ContentStreamI) []TestCase { }, { name: "resource not found", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, identifier: utils.ValidIdentifier, method: utils.ValidMethod, @@ -68,7 +68,7 @@ func getSubtest(validContentStream types.ContentStreamI) []TestCase { }, { name: "invalid resource id", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, identifier: utils.ValidIdentifier, method: utils.ValidMethod, @@ -79,7 +79,7 @@ func getSubtest(validContentStream types.ContentStreamI) []TestCase { }, { name: "invalid type", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), dereferencingType: types.JSON, identifier: utils.ValidIdentifier, method: utils.ValidMethod, @@ -90,7 +90,7 @@ func getSubtest(validContentStream types.ContentStreamI) []TestCase { }, { name: "invalid namespace", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, identifier: utils.ValidIdentifier, method: utils.ValidMethod, @@ -101,7 +101,7 @@ func getSubtest(validContentStream types.ContentStreamI) []TestCase { }, { name: "invalid method", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, identifier: utils.ValidIdentifier, method: "invalid-method", @@ -112,7 +112,7 @@ func getSubtest(validContentStream types.ContentStreamI) []TestCase { }, { name: "invalid identifier", - ledgerService: utils.NewMockLedgerService(cheqd.Did{}, cheqd.Metadata{}, resource.Resource{}), + ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, identifier: "invalid-identifier", method: utils.ValidMethod, @@ -126,7 +126,7 @@ func getSubtest(validContentStream types.ContentStreamI) []TestCase { func TestDereferenceResourceMetadata(t *testing.T) { validResource := utils.ValidResource() - subtests := getSubtest(types.NewDereferencedResourceList(utils.ValidDid, []*resource.ResourceHeader{validResource.Header})) + subtests := getSubtest(types.NewDereferencedResourceList(utils.ValidDid, []*resource.Metadata{validResource.Metadata})) for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { @@ -166,7 +166,7 @@ func TestDereferenceResourceMetadata(t *testing.T) { func TestDereferenceCollectionResources(t *testing.T) { validResource := utils.ValidResource() - subtests := getSubtest(types.NewDereferencedResourceList(utils.ValidDid, []*resource.ResourceHeader{validResource.Header})) + subtests := getSubtest(types.NewDereferencedResourceList(utils.ValidDid, []*resource.Metadata{validResource.Metadata})) for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { @@ -208,7 +208,7 @@ func TestDereferenceCollectionResources(t *testing.T) { func TestDereferenceResourceData(t *testing.T) { validResource := utils.ValidResource() - validResourceData := types.DereferencedResourceData(validResource.Data) + validResourceData := types.DereferencedResourceData(validResource.Resource.Data) subtests := getSubtest(&validResourceData) for _, subtest := range subtests { @@ -224,7 +224,7 @@ func TestDereferenceResourceData(t *testing.T) { Method: utils.ValidMethod, } } - expectedContentType := validResource.Header.MediaType + expectedContentType := validResource.Metadata.MediaType dereferencingResult, err := resourceService.DereferenceResourceData(subtest.resourceId, id, subtest.dereferencingType) fmt.Println(subtest.name + ": dereferencingResult:") diff --git a/tests/pytest/helpers.py b/tests/pytest/helpers.py index 67ee4b8c..2d9b91e8 100644 --- a/tests/pytest/helpers.py +++ b/tests/pytest/helpers.py @@ -7,21 +7,28 @@ RESOLVER_URL = "http://localhost:8080" PATH = "/1.0/identifiers/" -TESTNET_DID = "did:cheqd:testnet:DAzMQo4MDMxCjgwM" -TESTNET_FRAGMENT = TESTNET_DID + "#key1" -FAKE_TESTNET_DID = "did:cheqd:testnet:zF7rhDBfUt9d1gJPjx7s1JXfUY7oVWkY" -TESTNET_RESOURCE = TESTNET_DID + "/resources/44547089-170b-4f5a-bcbc-06e46e0089e4" +TESTNET_DID = "did:cheqd:testnet:c1685ca0-1f5b-439c-8eb8-5c0e85ab7cd0" +TESTNET_DID_VERSION_ID = "e5615fc2-6f13-42b1-989c-49576a574cef" +TESTNET_DID_VERSION = TESTNET_DID + "/version/" + TESTNET_DID_VERSION_ID +TESTNET_DID_VERSIONS = TESTNET_DID + "/versions" +TESTNET_FRAGMENT = TESTNET_DID + "#key-1" +FAKE_TESTNET_DID = "did:cheqd:testnet:76471e8c-0d1c-4b97-9b11-17b65e024133" +FAKE_TESTNET_VERSION_ID = "e5615fc2-6f13-42b1-989c-49576a574ced" +FAKE_TESTNET_VERSION = FAKE_TESTNET_DID + "/version/" + FAKE_TESTNET_VERSION_ID +FAKE_TESTNET_DID_VERSIONS = FAKE_TESTNET_DID + "/versions" +TESTNET_RESOURCE = TESTNET_DID + "/resources/9ba3922e-d5f5-4f53-b265-fc0d4e988c77" TESTNET_RESOURCE_METADATA = TESTNET_RESOURCE + "/metadata" -TESTNET_RESOURCE_LIST = TESTNET_DID + "/resources/all" -TESTNET_RESOURCE_LIST_REDIRECT = TESTNET_DID + "/resources/" +TESTNET_RESOURCE_LIST = TESTNET_DID + "/metadata" TESTNET_RESOURCE_NAME = "Demo Resource" -RESOURCE_DATA = "{ \"content\": \"test data\" }" +RESOURCE_DATA = "{ \r\n \"content\": \"test data\"\r\n}" FAKE_TESTNET_FRAGMENT = TESTNET_DID + "#fake_key" FAKE_TESTNET_RESOURCE = TESTNET_DID + "/resources/76471e8c-0d1c-4b97-9b11-17b65e024334" +INDY_TESTNET_DID = "did:cheqd:testnet:zHqbcXb3irKRCMst" +MIGRATED_INDY_TESTNET_DID = "did:cheqd:testnet:CpeMubv5yw63jXyrgRRsxR" -MAINNET_DID = "did:cheqd:mainnet:zF7rhDBfUt9d1gJPjx7s1JXfUY7oVWkY" +MAINNET_DID = "did:cheqd:mainnet:76471e8c-0d1c-4b97-9b11-17b65e024335" MAINNET_FRAGMENT = MAINNET_DID + "#key1" -FAKE_MAINNET_DID = "did:cheqd:mainnet:zFWM1mKVGGU2gHYuLAQcTJfZBebqBpGf" +FAKE_MAINNET_DID = "did:cheqd:mainnet:76471e8c-0d1c-4b27-9b11-17b65e024133" FAKE_MAINNET_FRAGMENT = MAINNET_DID + "#fake_key" DIDJSON = "application/did+json" diff --git a/tests/pytest/test_resolution.py b/tests/pytest/test_resolution.py index 1380c19c..44d3d1e8 100644 --- a/tests/pytest/test_resolution.py +++ b/tests/pytest/test_resolution.py @@ -6,7 +6,8 @@ from helpers import run, TESTNET_DID, MAINNET_DID, TESTNET_FRAGMENT, MAINNET_FRAGMENT, \ FAKE_TESTNET_DID, FAKE_MAINNET_DID, FAKE_TESTNET_FRAGMENT, FAKE_MAINNET_FRAGMENT, RESOLVER_URL, PATH, \ LDJSON, DIDJSON, DIDLDJSON, HTML, FAKE_TESTNET_RESOURCE, TESTNET_RESOURCE_METADATA, TESTNET_RESOURCE_NAME, JSON, \ - TESTNET_RESOURCE, RESOURCE_DATA, TESTNET_RESOURCE_LIST, TESTNET_RESOURCE_LIST_REDIRECT + TESTNET_RESOURCE, RESOURCE_DATA, TESTNET_RESOURCE_LIST, INDY_TESTNET_DID, MIGRATED_INDY_TESTNET_DID, \ + TESTNET_DID_VERSION, TESTNET_DID_VERSION_ID, FAKE_TESTNET_VERSION, TESTNET_DID_VERSIONS, FAKE_TESTNET_DID_VERSIONS @pytest.mark.parametrize( @@ -14,7 +15,10 @@ [ (TESTNET_DID, fr"didResolutionMetadata(.*?)didDocument(.*?)\"id\": \"{TESTNET_DID}\"(.*?)didDocumentMetadata(.*?){TESTNET_RESOURCE_NAME}"), - (MAINNET_DID, fr"didResolutionMetadata(.*?)didDocument(.*?)\"id\": \"{MAINNET_DID}\"(.*?)didDocumentMetadata"), + + # mainnet DID currently use another format of DID, when mainnet network will be same like testnet network you can run this test too. + # (MAINNET_DID, fr"didResolutionMetadata(.*?)didDocument(.*?)\"id\": \"{MAINNET_DID}\"(.*?)didDocumentMetadata"), + (FAKE_TESTNET_DID, r"\"didResolutionMetadata(.*?)\"error\": \"notFound\"(.*?)" r"didDocument\": null,(.*?)\"didDocumentMetadata\": \{\}"), (FAKE_MAINNET_DID, r"\"didResolutionMetadata(.*?)\"error\": \"notFound\"(.*?)" @@ -24,8 +28,11 @@ (TESTNET_FRAGMENT, r"(.*?)dereferencingMetadata\"(.*?)" fr"\"contentStream\":(.*?)\"id\": \"{TESTNET_FRAGMENT}\"(.*?)contentMetadata"), - (MAINNET_FRAGMENT, r"(.*?)dereferencingMetadata\"(.*?)" - fr"\"contentStream\":(.*?)\"id\": \"{MAINNET_FRAGMENT}\"(.*?)contentMetadata"), + + # mainnet DID currently use another format of DID, when mainnet network will be same like testnet network you can run this test too. + # (MAINNET_FRAGMENT, r"(.*?)dereferencingMetadata\"(.*?)" + # fr"\"contentStream\":(.*?)\"id\": \"{MAINNET_FRAGMENT}\"(.*?)contentMetadata"), + (FAKE_TESTNET_FRAGMENT, r"\"dereferencingMetadata(.*?)\"error\": \"notFound\"(.*?)" r"\"contentStream\": null,(.*?)\"contentMetadata\": \{\}"), (FAKE_MAINNET_FRAGMENT, r"\"dereferencingMetadata(.*?)\"error\": \"notFound\"(.*?)" @@ -38,6 +45,15 @@ (TESTNET_RESOURCE, RESOURCE_DATA), (FAKE_TESTNET_RESOURCE, r"\"dereferencingMetadata(.*?)\"error\": \"notFound\"(.*?)" r"\"contentStream\": null,(.*?)\"contentMetadata\": \{\}"), + (INDY_TESTNET_DID, fr"didResolutionMetadata(.*?)didDocument(.*?)\"id\": \"{MIGRATED_INDY_TESTNET_DID}\""), + (MIGRATED_INDY_TESTNET_DID, fr"didResolutionMetadata(.*?)didDocument(.*?)\"id\": \"{MIGRATED_INDY_TESTNET_DID}\""), + (TESTNET_DID_VERSION, + fr"didResolutionMetadata(.*?)didDocument(.*?)\"id\": \"{TESTNET_DID}\"(.*?)didDocumentMetadata(.*?)\"versionId\": \"{TESTNET_DID_VERSION_ID}\""), + (FAKE_TESTNET_VERSION, r"\"didResolutionMetadata(.*?)\"error\": \"notFound\"(.*?)" + r"didDocument\": null,(.*?)\"didDocumentMetadata\": \{\}"), + (TESTNET_DID_VERSIONS, r"\"dereferencingMetadata(.*?)\"contentStream\":(.*?)\"contentMetadata\":(.*?)"), + (FAKE_TESTNET_DID_VERSIONS, r"\"didResolutionMetadata(.*?)\"error\": \"notFound\"(.*?)" + r"didDocument\": null,(.*?)\"didDocumentMetadata\": \{\}"), ] ) def test_resolution(did_url, expected_output): @@ -164,21 +180,6 @@ def test_dereferencing_content_type_resource(accept, expected_header, expected_s r = requests.get(url, headers=header) assert r.headers["Content-Type"] == expected_header - -@pytest.mark.parametrize( - "accept, expected_header, expected_status_code, expected_body", - [(LDJSON, DIDLDJSON, 301, - r"(.*?)\"dereferencingMetadata(.*?)\"contentStream\":(.*?)" - r"resourceCollectionId(.*?)\"contentMetadata\":(.*?)"), ] -) -def test_dereferencing_content_type_resource_redirect(accept, expected_header, expected_status_code, expected_body): - url = RESOLVER_URL + PATH + TESTNET_RESOURCE_LIST_REDIRECT - header = {"Accept": accept} if accept else {} - r = requests.get(url, headers=header) - assert r.headers["Content-Type"] == expected_header - assert re.match(expected_body, r.text.replace("\n", "\\n")) - - @pytest.mark.parametrize( "did_url, expected_status_code", [ diff --git a/types/constants.go b/types/constants.go index 798ed9db..5624cd66 100644 --- a/types/constants.go +++ b/types/constants.go @@ -19,13 +19,19 @@ func (cType ContentType) IsSupported() bool { } const ( - DIDSchemaJSONLD = "https://www.w3.org/ns/did/v1" - ResolutionSchemaJSONLD = "https://w3id.org/did-resolution/v1" + DIDSchemaJSONLD = "https://www.w3.org/ns/did/v1" + ResolutionSchemaJSONLD = "https://w3id.org/did-resolution/v1" + Ed25519VerificationKey2020JSONLD = "https://w3id.org/security/suites/ed25519-2020/v1" + Ed25519VerificationKey2018JSONLD = "https://w3id.org/security/suites/ed25519-2018/v1" + JsonWebKey2020JSONLD = "https://w3id.org/security/suites/jws-2020/v1" ) const ( - DID_METHOD = "cheqd" - RESOLVER_PATH = "/1.0/identifiers/" - RESOURCE_PATH = "/resources/" - SWAGGER_PATH = "/swagger/" + DID_METHOD = "cheqd" + RESOLVER_PATH = "/1.0/identifiers/" + DID_VERSION_PATH = "/version/" + DID_VERSIONS_PATH = "/versions" + DID_METADATA = "/metadata" + RESOURCE_PATH = "/resources/" + SWAGGER_PATH = "/swagger/" ) diff --git a/types/dereferecing_metadata.go b/types/dereferecing_metadata.go index e444df9d..fb4c9960 100644 --- a/types/dereferecing_metadata.go +++ b/types/dereferecing_metadata.go @@ -1,5 +1,9 @@ package types +import ( + didTypes "github.com/cheqd/cheqd-node/x/did/types" +) + type DereferencingMetadata ResolutionMetadata type DidDereferencing struct { @@ -23,3 +27,17 @@ func (d DidDereferencing) GetBytes() []byte { } return d.ContentStream.GetBytes() } + +type DereferencedDidVersionsList struct { + Versions []*didTypes.Metadata `json:"versions,omitempty"` +} + +func NewDereferencedDidVersionsList(versions []*didTypes.Metadata) *DereferencedDidVersionsList { + return &DereferencedDidVersionsList{ + Versions: versions, + } +} + +func (e *DereferencedDidVersionsList) AddContext(newProtocol string) {} +func (e *DereferencedDidVersionsList) RemoveContext() {} +func (e *DereferencedDidVersionsList) GetBytes() []byte { return []byte{} } diff --git a/types/dereferencing_content_stream.go b/types/dereferencing_content_stream.go index 9f256942..79cb50ed 100644 --- a/types/dereferencing_content_stream.go +++ b/types/dereferencing_content_stream.go @@ -1,21 +1,25 @@ package types -import resource "github.com/cheqd/cheqd-node/x/resource/types" +import ( + "time" + + resource "github.com/cheqd/cheqd-node/x/resource/types" +) type DereferencedResource struct { - ResourceURI string `json:"resourceURI" example:"did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b"` - CollectionId string `json:"resourceCollectionId" example:"55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"` - ResourceId string `json:"resourceId" example:"398cee0a-efac-4643-9f4c-74c48c72a14b"` - Name string `json:"resourceName" example:"Image Resource"` - ResourceType string `json:"resourceType" example:"Image"` - MediaType string `json:"mediaType" example:"image/png"` - Created string `json:"created" example:"2021-09-01T12:00:00Z"` - Checksum string `json:"checksum" example:"a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559"` - PreviousVersionId *string `json:"previousVersionId" example:"ad7a8442-3531-46eb-a024-53953ec6e4ff"` - NextVersionId *string `json:"nextVersionId" example:"d4829ac7-4566-478c-a408-b44767eddadc"` + ResourceURI string `json:"resourceURI" example:"did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b"` + CollectionId string `json:"resourceCollectionId" example:"55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"` + ResourceId string `json:"resourceId" example:"398cee0a-efac-4643-9f4c-74c48c72a14b"` + Name string `json:"resourceName" example:"Image Resource"` + ResourceType string `json:"resourceType" example:"Image"` + MediaType string `json:"mediaType" example:"image/png"` + Created time.Time `json:"created" example:"2021-09-01T12:00:00Z"` + Checksum string `json:"checksum" example:"a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559"` + PreviousVersionId *string `json:"previousVersionId" example:"ad7a8442-3531-46eb-a024-53953ec6e4ff"` + NextVersionId *string `json:"nextVersionId" example:"d4829ac7-4566-478c-a408-b44767eddadc"` } -func NewDereferencedResource(did string, resource *resource.ResourceHeader) *DereferencedResource { +func NewDereferencedResource(did string, resource *resource.Metadata) *DereferencedResource { var previousVersionId, nextVersionId *string if resource.PreviousVersionId != "" { previousVersionId = &resource.PreviousVersionId @@ -31,7 +35,7 @@ func NewDereferencedResource(did string, resource *resource.ResourceHeader) *Der ResourceType: resource.ResourceType, MediaType: resource.MediaType, Created: resource.Created, - Checksum: FixResourceChecksum(resource.Checksum), + Checksum: resource.Checksum, PreviousVersionId: previousVersionId, NextVersionId: nextVersionId, } @@ -41,7 +45,7 @@ type DereferencedResourceList struct { Resources []DereferencedResource `json:"linkedResourceMetadata,omitempty"` } -func NewDereferencedResourceList(did string, protoResources []*resource.ResourceHeader) *DereferencedResourceList { +func NewDereferencedResourceList(did string, protoResources []*resource.Metadata) *DereferencedResourceList { resourceList := []DereferencedResource{} for _, r := range protoResources { resourceList = append(resourceList, *NewDereferencedResource(did, r)) diff --git a/types/did_doc.go b/types/did_doc.go index 492f8ab8..37f3246d 100644 --- a/types/did_doc.go +++ b/types/did_doc.go @@ -1,7 +1,9 @@ package types import ( - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" + "encoding/json" + + did "github.com/cheqd/cheqd-node/x/did/types" ) type DidDoc struct { @@ -19,22 +21,25 @@ type DidDoc struct { } type VerificationMethod struct { - Context []string `json:"@context,omitempty"` - Id string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Controller string `json:"controller,omitempty"` - PublicKeyJwk map[string]string `json:"publicKeyJwk,omitempty"` - PublicKeyMultibase string `json:"publicKeyMultibase,omitempty"` + Context []string `json:"@context,omitempty"` + Id string `json:"id,omitempty"` + Type string `json:"type,omitempty"` + Controller string `json:"controller,omitempty"` + PublicKeyJwk interface{} `json:"publicKeyJwk,omitempty"` + PublicKeyMultibase string `json:"publicKeyMultibase,omitempty"` + PublicKeyBase58 string `json:"publicKeyBase58,omitempty"` } +type VerificationMaterial interface{} + type Service struct { Context []string `json:"@context,omitempty"` Id string `json:"id,omitempty" example:"did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47#service-1"` Type string `json:"type,omitempty" example:"did-communication"` - ServiceEndpoint string `json:"serviceEndpoint,omitempty" example:"https://example.com/endpoint/8377464"` + ServiceEndpoint []string `json:"serviceEndpoint,omitempty" example:"https://example.com/endpoint/8377464"` } -func NewDidDoc(protoDidDoc cheqd.Did) DidDoc { +func NewDidDoc(protoDidDoc did.DidDoc) DidDoc { verificationMethods := []VerificationMethod{} for _, vm := range protoDidDoc.VerificationMethod { verificationMethods = append(verificationMethods, *NewVerificationMethod(vm)) @@ -59,20 +64,35 @@ func NewDidDoc(protoDidDoc cheqd.Did) DidDoc { } } -func NewVerificationMethod(protoVerificationMethod *cheqd.VerificationMethod) *VerificationMethod { - return &VerificationMethod{ - Id: protoVerificationMethod.Id, - Type: protoVerificationMethod.Type, - Controller: protoVerificationMethod.Controller, - PublicKeyJwk: cheqd.PubKeyJWKToMap(protoVerificationMethod.PublicKeyJwk), - PublicKeyMultibase: protoVerificationMethod.PublicKeyMultibase, +func NewVerificationMethod(protoVerificationMethod *did.VerificationMethod) *VerificationMethod { + verificationMethod := &VerificationMethod{ + Id: protoVerificationMethod.Id, + Type: protoVerificationMethod.VerificationMethodType, + Controller: protoVerificationMethod.Controller, } + + switch protoVerificationMethod.VerificationMethodType { + case "Ed25519VerificationKey2020": + verificationMethod.PublicKeyMultibase = protoVerificationMethod.VerificationMaterial + case "Ed25519VerificationKey2018": + verificationMethod.PublicKeyBase58 = protoVerificationMethod.VerificationMaterial + case "JsonWebKey2020": + var publicKeyJwk interface{} + err := json.Unmarshal([]byte(protoVerificationMethod.VerificationMaterial), &publicKeyJwk) + if err != nil { + println("Invalid verification material !!!") + panic(err) + } + verificationMethod.PublicKeyJwk = publicKeyJwk + } + + return verificationMethod } -func NewService(protoService *cheqd.Service) *Service { +func NewService(protoService *did.Service) *Service { return &Service{ Id: protoService.Id, - Type: protoService.Type, + Type: protoService.ServiceType, ServiceEndpoint: protoService.ServiceEndpoint, } } diff --git a/types/did_doc_metadata.go b/types/did_doc_metadata.go index ce90eba4..23fba0ab 100644 --- a/types/did_doc_metadata.go +++ b/types/did_doc_metadata.go @@ -1,28 +1,39 @@ package types import ( - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" + "time" + + did "github.com/cheqd/cheqd-node/x/did/types" resource "github.com/cheqd/cheqd-node/x/resource/types" ) +// Changed "Created time.Time" to "Create *time.Time". +// It needs to skip Created field when is empty. type ResolutionDidDocMetadata struct { - Created string `json:"created,omitempty" example:"2021-09-01T12:00:00Z"` - Updated string `json:"updated,omitempty" example:"2021-09-10T12:00:00Z"` + Created *time.Time `json:"created,omitempty" example:"2021-09-01T12:00:00Z"` + Updated *time.Time `json:"updated,omitempty" example:"2021-09-10T12:00:00Z"` Deactivated bool `json:"deactivated,omitempty" example:"false"` VersionId string `json:"versionId,omitempty" example:"4979BAF49599FEF0BAD5ED0849FDD708156761EBBC8EBE78D0907F8BECC9CB2E"` Resources []DereferencedResource `json:"linkedResourceMetadata,omitempty"` } -func NewResolutionDidDocMetadata(did string, metadata cheqd.Metadata, resources []*resource.ResourceHeader) ResolutionDidDocMetadata { +func NewResolutionDidDocMetadata(did string, metadata did.Metadata, resources []*resource.Metadata) ResolutionDidDocMetadata { + created := &metadata.Created + if created.IsZero() { + created = nil + } + newMetadata := ResolutionDidDocMetadata{ - Created: metadata.Created, + Created: created, Updated: metadata.Updated, Deactivated: metadata.Deactivated, VersionId: metadata.VersionId, } - if metadata.Resources == nil || len(resources) == 0 { + + if len(resources) == 0 { return newMetadata } + newMetadata.Resources = NewDereferencedResourceList(did, resources).Resources return newMetadata } diff --git a/types/did_doc_metadata_test.go b/types/did_doc_metadata_test.go index 84874f5d..94ede396 100644 --- a/types/did_doc_metadata_test.go +++ b/types/did_doc_metadata_test.go @@ -2,56 +2,56 @@ package types import ( "crypto/sha256" + "fmt" "testing" - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" + did "github.com/cheqd/cheqd-node/x/did/types" resource "github.com/cheqd/cheqd-node/x/resource/types" "github.com/stretchr/testify/require" ) func TestNewResolutionDidDocMetadata(t *testing.T) { - validIdentifier := "N22KY2Dyvmuu2Pyy" + validIdentifier := "fb53dd05-329b-4614-a3f2-c0a8c7554ee3" validDid := "did:cheqd:mainnet:" + validIdentifier - validResourceId := "18e9d838-0bea-435b-964b-c6529ede6d2b" + validResourceId := "a09abea0-22e0-4b35-8f70-9cc3a6d0b5fd" resourceData := []byte("test_checksum") h := sha256.New() h.Write(resourceData) - resourceHeader := resource.ResourceHeader{ + resourceMetadata := resource.Metadata{ CollectionId: validIdentifier, Id: validResourceId, Name: "Existing Resource Name", ResourceType: "CL-Schema", MediaType: "application/json", - Checksum: h.Sum(nil), + Checksum: fmt.Sprintf("%x", h.Sum(nil)), } validMetadataResource := DereferencedResource{ - ResourceURI: validDid + RESOURCE_PATH + resourceHeader.Id, - CollectionId: resourceHeader.CollectionId, - ResourceId: resourceHeader.Id, - Name: resourceHeader.Name, - ResourceType: resourceHeader.ResourceType, - MediaType: resourceHeader.MediaType, - Created: resourceHeader.Created, - Checksum: FixResourceChecksum(resourceHeader.Checksum), + ResourceURI: validDid + RESOURCE_PATH + resourceMetadata.Id, + CollectionId: resourceMetadata.CollectionId, + ResourceId: resourceMetadata.Id, + Name: resourceMetadata.Name, + ResourceType: resourceMetadata.ResourceType, + MediaType: resourceMetadata.MediaType, + Created: resourceMetadata.Created, + Checksum: resourceMetadata.Checksum, PreviousVersionId: nil, NextVersionId: nil, } subtests := []struct { name string - metadata cheqd.Metadata - resources []*resource.ResourceHeader + metadata did.Metadata + resources []*resource.Metadata expectedResult ResolutionDidDocMetadata }{ { - name: "matadata with resource", - metadata: cheqd.Metadata{ + name: "metadata with resource", + metadata: did.Metadata{ VersionId: "test_version_id", Deactivated: false, - Resources: []string{validResourceId}, }, - resources: []*resource.ResourceHeader{&resourceHeader}, + resources: []*resource.Metadata{&resourceMetadata}, expectedResult: ResolutionDidDocMetadata{ VersionId: "test_version_id", Deactivated: false, @@ -59,24 +59,11 @@ func TestNewResolutionDidDocMetadata(t *testing.T) { }, }, { - name: "matadata without resource in metadata", - metadata: cheqd.Metadata{ + name: "metadata without resources", + metadata: did.Metadata{ VersionId: "test_version_id", Deactivated: false, }, - resources: []*resource.ResourceHeader{&resourceHeader}, - expectedResult: ResolutionDidDocMetadata{ - VersionId: "test_version_id", - Deactivated: false, - }, - }, - { - name: "matadata without resources", - metadata: cheqd.Metadata{ - VersionId: "test_version_id", - Deactivated: false, - Resources: []string{validResourceId}, - }, expectedResult: ResolutionDidDocMetadata{ VersionId: "test_version_id", Deactivated: false, diff --git a/types/errors.go b/types/errors.go index df3a752f..25b874a2 100644 --- a/types/errors.go +++ b/types/errors.go @@ -1,6 +1,9 @@ package types -import "fmt" +import ( + "errors" + "fmt" +) type IdentityError struct { Code int @@ -68,3 +71,7 @@ func NewMethodNotSupportedError(did string, contentType ContentType, err error, func NewInternalError(did string, contentType ContentType, err error, isDereferencing bool) *IdentityError { return NewIdentityError(500, "internalError", isDereferencing, did, contentType, err) } + +func NewInvalidIdentifierError() error { + return errors.New("unique id should be one of: 16 bytes of decoded base58 string or UUID") +} diff --git a/types/helper.go b/types/helper.go index 9830aece..ac458f4f 100644 --- a/types/helper.go +++ b/types/helper.go @@ -1,20 +1,5 @@ package types -import ( - "crypto/sha256" - "fmt" -) - -func FixResourceChecksum(inputChecksum []byte) (hash string) { - if len(fmt.Sprintf("%x", inputChecksum)) == 64 { - return fmt.Sprintf("%x", inputChecksum) - } - h := sha256.New() - data := inputChecksum[:len(inputChecksum)-len(h.Sum(nil))] - h.Write(data) - return fmt.Sprintf("%x", h.Sum(nil)) -} - func AddElemToSet(set []string, newElement string) []string { if set == nil { set = []string{} diff --git a/types/resolution_metadata.go b/types/resolution_metadata.go index e172daf4..52a14cd1 100644 --- a/types/resolution_metadata.go +++ b/types/resolution_metadata.go @@ -3,7 +3,7 @@ package types import ( "time" - cheqdUtils "github.com/cheqd/cheqd-node/x/cheqd/utils" + didUtils "github.com/cheqd/cheqd-node/x/did/utils" ) type ResolutionMetadata struct { @@ -27,8 +27,8 @@ type DidResolution struct { } func NewResolutionMetadata(didUrl string, contentType ContentType, resolutionError string) ResolutionMetadata { - did, _, _, _, err1 := cheqdUtils.TrySplitDIDUrl(didUrl) - method, _, id, err2 := cheqdUtils.TrySplitDID(did) + did, _, _, _, err1 := didUtils.TrySplitDIDUrl(didUrl) + method, _, id, err2 := didUtils.TrySplitDID(did) var didProperties DidProperties if err1 == nil && err2 == nil { didProperties = DidProperties{ diff --git a/utils/did_url.go b/utils/did_url.go index 9be8eb5a..1ed19d6b 100644 --- a/utils/did_url.go +++ b/utils/did_url.go @@ -1,16 +1,18 @@ package utils import ( + "errors" "regexp" - cheqdUtils "github.com/cheqd/cheqd-node/x/cheqd/utils" + didUtils "github.com/cheqd/cheqd-node/x/did/utils" + didutils "github.com/cheqd/cheqd-node/x/did/utils" "github.com/google/uuid" ) var ResourceId, _ = regexp.Compile(`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`) func IsDidUrl(didUrl string) bool { - _, path, query, fragmentId, err := cheqdUtils.TrySplitDIDUrl(didUrl) + _, path, query, fragmentId, err := didUtils.TrySplitDIDUrl(didUrl) return err == nil && (path != "" || query != "" || fragmentId != "") } @@ -18,3 +20,20 @@ func IsValidResourceId(u string) bool { _, err := uuid.Parse(u) return err == nil } + +func ValidateV1ID(id string) error { + isValidId := len(id) == 16 && didutils.IsValidBase58(id) || + len(id) == 32 && didutils.IsValidBase58(id) || + didutils.IsValidUUID(id) + + if !isValidId { + return errors.New("unique id should be one of: 16 symbols base58 string, 32 symbols base58 string, or UUID") + } + + return nil +} + +func IsValidV1ID(id string) bool { + err := ValidateV1ID(id) + return err == nil +} diff --git a/utils/test_utils.go b/utils/test_utils.go index 74668d26..a8c2cb48 100644 --- a/utils/test_utils.go +++ b/utils/test_utils.go @@ -2,14 +2,15 @@ package utils import ( "crypto/sha256" + "fmt" - cheqd "github.com/cheqd/cheqd-node/x/cheqd/types" + didTypes "github.com/cheqd/cheqd-node/x/did/types" resource "github.com/cheqd/cheqd-node/x/resource/types" "github.com/cheqd/did-resolver/types" ) const ( - ValidIdentifier = "N22KY2Dyvmuu2Pyy" + ValidIdentifier = "fb53dd05-329b-4614-a3f2-c0a8c7554ee3" ValidMethod = "cheqd" ValidNamespace = "mainnet" ValidDid = "did:" + ValidMethod + ":" + ValidNamespace + ":" + ValidIdentifier @@ -22,60 +23,63 @@ const ( "}" ) -func ValidVerificationMethod() cheqd.VerificationMethod { - return cheqd.VerificationMethod{ - Id: ValidDid + "#key-1", - Type: "JsonWebKey2020", - Controller: ValidDid, - PublicKeyJwk: cheqd.JSONToPubKeyJWK(ValidPubKeyJWK), +func ValidVerificationMethod() didTypes.VerificationMethod { + return didTypes.VerificationMethod{ + Id: ValidDid + "#key-1", + VerificationMethodType: "JsonWebKey2020", + Controller: ValidDid, + VerificationMaterial: ValidPubKeyJWK, } } -func ValidService() cheqd.Service { - return cheqd.Service{ +func ValidService() didTypes.Service { + return didTypes.Service{ Id: ValidDid + "#service-1", - Type: "DIDCommMessaging", - ServiceEndpoint: "endpoint", + ServiceType: "DIDCommMessaging", + ServiceEndpoint: []string{"http://example.com"}, } } -func ValidDIDDoc() cheqd.Did { +func ValidDIDDoc() didTypes.DidDoc { service := ValidService() verificationMethod := ValidVerificationMethod() - return cheqd.Did{ + return didTypes.DidDoc{ Id: ValidDid, - VerificationMethod: []*cheqd.VerificationMethod{&verificationMethod}, - Service: []*cheqd.Service{&service}, + VerificationMethod: []*didTypes.VerificationMethod{&verificationMethod}, + Service: []*didTypes.Service{&service}, } } -func ValidResource() resource.Resource { +func ValidResource() resource.ResourceWithMetadata { data := []byte("{\"attr\":[\"name\",\"age\"]}") - return resource.Resource{ - Header: &resource.ResourceHeader{ + checksum := sha256.New().Sum(data) + return resource.ResourceWithMetadata{ + Resource: &resource.Resource{ + Data: data, + }, + Metadata: &resource.Metadata{ CollectionId: ValidIdentifier, Id: ValidResourceId, - Name: "Existing_Resource_Name", - ResourceType: "CL-Schema", + Name: ValidResourceId, + ResourceType: "string", MediaType: "application/json", - Checksum: sha256.New().Sum(data), + Checksum: fmt.Sprintf("%x", checksum), }, - Data: data, } } -func ValidMetadata() cheqd.Metadata { - return cheqd.Metadata{VersionId: "test_version_id", Deactivated: false, Resources: []string{ValidResourceId}} +func ValidMetadata() didTypes.Metadata { + return didTypes.Metadata{VersionId: "test_version_id", Deactivated: false} } type MockLedgerService struct { - Did cheqd.Did - Metadata cheqd.Metadata - Resource resource.Resource + Did didTypes.DidDoc + Metadata didTypes.Metadata + Resource resource.ResourceWithMetadata } -func NewMockLedgerService(did cheqd.Did, metadata cheqd.Metadata, resource resource.Resource) MockLedgerService { +func NewMockLedgerService(did didTypes.DidDoc, metadata didTypes.Metadata, resource resource.ResourceWithMetadata) MockLedgerService { return MockLedgerService{ Did: did, Metadata: metadata, @@ -83,26 +87,34 @@ func NewMockLedgerService(did cheqd.Did, metadata cheqd.Metadata, resource resou } } -func (ls MockLedgerService) QueryDIDDoc(did string) (*cheqd.Did, *cheqd.Metadata, *types.IdentityError) { +func (ls MockLedgerService) QueryDIDDoc(did string, version string) (*didTypes.DidDocWithMetadata, *types.IdentityError) { if did == ls.Did.Id { println("query !!!" + ls.Did.Id) - return &ls.Did, &ls.Metadata, nil + return &didTypes.DidDocWithMetadata{DidDoc: &ls.Did, Metadata: &ls.Metadata}, nil + } + return nil, types.NewNotFoundError(did, types.JSON, nil, true) +} + +func (ls MockLedgerService) QueryAllDidDocVersionsMetadata(did string) ([]*didTypes.Metadata, *types.IdentityError) { + if did == ls.Did.Id { + return []*didTypes.Metadata{&ls.Metadata}, nil } - return nil, nil, types.NewNotFoundError(did, types.JSON, nil, true) + + return nil, types.NewNotFoundError(did, types.JSON, nil, true) } -func (ls MockLedgerService) QueryResource(did string, resourceId string) (*resource.Resource, *types.IdentityError) { - if ls.Resource.Header == nil || ls.Resource.Header.Id != resourceId { +func (ls MockLedgerService) QueryResource(did string, resourceId string) (*resource.ResourceWithMetadata, *types.IdentityError) { + if ls.Resource.Metadata == nil || ls.Resource.Metadata.Id != resourceId { return nil, types.NewNotFoundError(did, types.JSON, nil, true) } return &ls.Resource, nil } -func (ls MockLedgerService) QueryCollectionResources(did string) ([]*resource.ResourceHeader, *types.IdentityError) { - if ls.Metadata.Resources == nil { - return []*resource.ResourceHeader{}, types.NewNotFoundError(did, types.JSON, nil, true) +func (ls MockLedgerService) QueryCollectionResources(did string) ([]*resource.Metadata, *types.IdentityError) { + if ls.Resource.Metadata == nil { + return []*resource.Metadata{}, types.NewNotFoundError(did, types.JSON, nil, true) } - return []*resource.ResourceHeader{ls.Resource.Header}, nil + return []*resource.Metadata{ls.Resource.Metadata}, nil } func (ls MockLedgerService) GetNamespaces() []string {