Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Move unit testing to Gingko [DEV-1652] #373

Merged
merged 81 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
1842b15
Introduce first ginkgo tests
Aug 17, 2022
92271e9
Add go.mod changes
Aug 17, 2022
71598d1
Disable lint
Aug 17, 2022
979b2f2
Enable tests
Aug 17, 2022
28a8637
Add tests with DescribeTable functionality
Aug 17, 2022
2e9e5eb
Fix dispatch yml
Aug 17, 2022
756c105
Fix ginko calling and add another couple of tests
Aug 17, 2022
10e9c9f
Get rid of depricated options
Aug 17, 2022
e66736b
Move to v2 for ginkgo
Aug 17, 2022
7454e88
Another portion of tests with ginkgo
Aug 23, 2022
d216421
Added test reporting (testing)
drgomesp Sep 14, 2022
4b0dce9
Finish tests for utils
Oct 5, 2022
fd500ce
Move signature verification tests
Oct 6, 2022
5dba69d
Add Signature verification and Create DID tests
Oct 6, 2022
c4a0762
Add tests for UpdateDid
Oct 7, 2022
82feaf7
Add tests for DID and Service validation
Oct 7, 2022
10fef06
Switched `x/resource` tests to Ginkgo suite
Eengineer1 Oct 7, 2022
34d9c86
Removed bloat
Eengineer1 Oct 7, 2022
6de20fa
Add tests for type module
Oct 10, 2022
909310a
Merge branch 'DEV-1652' of github.com:cheqd/cheqd-node into DEV-1652
Oct 10, 2022
425bb44
Makes linter happy
Oct 10, 2022
697479a
Enable ginkgo tests
Oct 10, 2022
80f811b
Show test results in junit format
Oct 10, 2022
0feb00d
Show test results in a pretty view
Oct 10, 2022
4075f4e
small fixes
Oct 10, 2022
c76a086
Enable lint and build stages
Oct 11, 2022
9cbf61d
Merge remote-tracking branch 'origin/develop' into DEV-1652
Oct 11, 2022
338b601
Cleaning up
askolesov Oct 11, 2022
faa0dd0
Switch wrom legacy routers to proto servers
askolesov Oct 11, 2022
f084839
Cleaning up
askolesov Oct 11, 2022
ad96be9
Improving tests structure
askolesov Oct 11, 2022
9f381d3
Improve did creation tests
askolesov Oct 11, 2022
3d773d5
Fix bug with VM update
askolesov Oct 11, 2022
3ac56e7
WIP
askolesov Oct 12, 2022
e57999b
Implementation
askolesov Oct 13, 2022
9f3fc8f
Finish cheqd module tests
askolesov Oct 14, 2022
ade7e7d
Reorganising tests
askolesov Oct 14, 2022
023edf1
The rest of resource tests
askolesov Oct 17, 2022
4d5a583
Merge remote-tracking branch 'origin/develop' into DEV-1652
askolesov Oct 17, 2022
515a2a3
Optimize ginkgo installation
askolesov Oct 17, 2022
3bd4ac3
Cleaning up
askolesov Oct 17, 2022
ca33e1a
Mod tidy + liner issues
askolesov Oct 17, 2022
d519447
Cleanup
askolesov Oct 17, 2022
83ced88
Merge branch 'develop' into DEV-1652
ankurdotb Oct 17, 2022
8645992
Update dispatch.yml
ankurdotb Oct 17, 2022
1239add
Update test.yml
ankurdotb Oct 17, 2022
67bf868
Update test.yml
ankurdotb Oct 17, 2022
668cede
Update go.mod
ankurdotb Oct 17, 2022
d54b629
Update go.sum
ankurdotb Oct 17, 2022
1e3c9e6
Update go.mod
ankurdotb Oct 17, 2022
128f248
Update dispatch.yml
ankurdotb Oct 17, 2022
c9de4db
Update test.yml
ankurdotb Oct 17, 2022
6ddda3e
Get rid of AfterEach functionality
Oct 18, 2022
38bf671
Makes linter happy
Oct 18, 2022
ad69f94
Fix tests running command
Oct 18, 2022
09de4ee
debug
Oct 18, 2022
43f1f3e
Change ginkgo for installing
Oct 18, 2022
d2350f8
Update dispatch.yml
askolesov Oct 19, 2022
a89728f
Merge remote-tracking branch 'origin/develop' into DEV-1652
Oct 19, 2022
b4feefe
Review comments
Oct 19, 2022
1a2b7e4
Add workaround for installing ginkgo
Oct 19, 2022
c9d947a
debug
Oct 19, 2022
999292e
debug
Oct 19, 2022
39cfcb3
Fix the version of ginkgo for CLI
Oct 19, 2022
856b2ca
Update ginkgo to the latest version
Oct 19, 2022
4e3c8e7
Add token for JUnit
Oct 19, 2022
2a5dd07
Move to another access token
Oct 19, 2022
97da98b
Add template for report files
Oct 19, 2022
a0308c6
Debug
Oct 19, 2022
f9bce78
Debug
Oct 19, 2022
6d412c6
Debug
Oct 19, 2022
9b0b655
Debug
Oct 20, 2022
3e7d143
Add permissions for checks
Oct 20, 2022
e847ffc
Check fails
Oct 20, 2022
7f0138d
Check failure case
Oct 20, 2022
d612273
MAke it more verbose
Oct 20, 2022
4755fa0
Move test back
Oct 20, 2022
6a8f772
Try JSON reporter
Oct 20, 2022
264555a
Try flutter reporter
Oct 20, 2022
ff71c57
Try dart JSON reporter
Oct 20, 2022
bd20ed8
Keep only JUnit reports
Oct 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ jobs:

call-lint:
name: "Lint"
uses: cheqd/cheqd-node/.github/workflows/lint.yml@develop
uses: ./.github/workflows/lint.yml

call-build:
name: "Build"
needs: call-lint
uses: cheqd/cheqd-node/.github/workflows/build.yml@develop
uses: ./.github/workflows/build.yml

# call-test:
# name: "Test"
# needs: call-build
# uses: ./.github/workflows/test.yml
# secrets: inherit
call-test:
name: "Test"
needs: call-build
uses: ./.github/workflows/test.yml
secrets: inherit

call-release:
name: "Release"
# needs: call-test
needs: call-build
needs: call-test
# needs: call-build
if: ${{ github.ref_protected == true }}
uses: cheqd/cheqd-node/.github/workflows/release.yml@develop
uses: ./.github/workflows/release.yml
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
go get github.com/onsi/gomega/...

- name: Run Ginkgo tests
run: ginkgo -r --race --randomize-all --randomize-suites --junit-report report.xml
run: go run ./ginkgo -r --race --randomize-all --randomize-suites --junit-report report.xml

# - uses: mikepenz/action-junit-report@v3
# if: success() || failure() # run this step even if previous step failed
Expand Down
20 changes: 0 additions & 20 deletions app/encoding_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (app *App) ExportAppStateAndValidators(

// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated
// in favour of export at a block height
// in favour of export at a block height
func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

Expand Down
18 changes: 12 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.18

require (
filippo.io/edwards25519 v1.0.0-beta.2
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/cosmos/cosmos-sdk v0.45.9
github.com/cosmos/ibc-go/v3 v3.3.0
github.com/gabriel-vasile/mimetype v1.4.1
Expand All @@ -16,12 +15,13 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/lestrrat-go/jwx v1.2.25
github.com/multiformats/go-multibase v0.1.1
github.com/onsi/ginkgo/v2 v2.1.6
github.com/onsi/gomega v1.22.0
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.5.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.12.0
github.com/stretchr/testify v1.8.0
github.com/tendermint/tendermint v0.34.21
github.com/tendermint/tm-db v0.6.6
google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b
Expand Down Expand Up @@ -68,6 +68,7 @@ require (
github.com/gogo/gateway v1.1.0 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand Down Expand Up @@ -98,13 +99,11 @@ require (
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/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.1.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/onsi/gomega v1.22.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
Expand All @@ -121,6 +120,7 @@ require (
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stretchr/testify v1.8.0 // indirect
github.com/subosito/gotenv v1.4.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
Expand All @@ -135,24 +135,30 @@ require (
golang.org/x/sys v0.0.0-20220727055044-e65921a090b8 // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
)

replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
// Dragonberry fix
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0

// Fee payer support
github.com/cosmos/cosmos-sdk => github.com/cheqd/cosmos-sdk v0.45.9-cheqd-tag

// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0

github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0
github.com/tecbot/gorocksdb => github.com/cosmos/gorocksdb v1.2.0

// latest grpc doesn't work with with our modified proto compiler, so we need to enforce
// the following version across all dependencies.
google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
15 changes: 8 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
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=
github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4=
Expand Down Expand Up @@ -121,7 +119,6 @@ github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+q
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts=
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ=
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o=
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/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
Expand Down Expand Up @@ -173,6 +170,8 @@ github.com/cosmos/iavl v0.19.3 h1:cESO0OwTTxQm5rmyESKW+zESheDUYI7CcZDWWDwnuxg=
github.com/cosmos/iavl v0.19.3/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
github.com/cosmos/ibc-go/v3 v3.3.0 h1:r8gYUvQreMQrf4R5RgedK9gcbjLk4uE2q6fuZGjf4n0=
github.com/cosmos/ibc-go/v3 v3.3.0/go.mod h1:VUWLHw0C3USmTQZnTdkuXXdUdLbW8zsK3lV1Ieposog=
github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU=
github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8=
github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4=
github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY=
github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI=
Expand Down Expand Up @@ -347,6 +346,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64=
Expand Down Expand Up @@ -453,7 +453,7 @@ github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH
github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98=
github.com/jhump/protoreflect v1.9.0 h1:npqHz788dryJiR/l6K/RUQAyh2SwV91+d1dnh4RjO9w=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U=
github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ=
Expand Down Expand Up @@ -546,7 +546,6 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
Expand Down Expand Up @@ -600,6 +599,8 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU=
github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk=
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
Expand Down Expand Up @@ -1202,8 +1203,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.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/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=
Expand Down
6 changes: 3 additions & 3 deletions x/cheqd/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

type msgServer struct {
type MsgServer struct {
Keeper
}

// NewMsgServer returns an implementation of the MsgServer interface for the provided Keeper.
func NewMsgServer(keeper Keeper) types.MsgServer {
return &msgServer{Keeper: keeper}
return &MsgServer{Keeper: keeper}
}

var _ types.MsgServer = msgServer{}
var _ types.MsgServer = MsgServer{}

func FindDid(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.StateValue, did string) (res types.StateValue, found bool, err error) {
// Look in inMemory dict
Expand Down
2 changes: 1 addition & 1 deletion x/cheqd/keeper/msg_server_create_did.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

func (k msgServer) CreateDid(goCtx context.Context, msg *types.MsgCreateDid) (*types.MsgCreateDidResponse, error) {
func (k MsgServer) CreateDid(goCtx context.Context, msg *types.MsgCreateDid) (*types.MsgCreateDidResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

// Validate DID doesn't exist
Expand Down
13 changes: 9 additions & 4 deletions x/cheqd/keeper/msg_server_update_did.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"context"
"reflect"

"github.com/cheqd/cheqd-node/x/cheqd/types"
"github.com/cheqd/cheqd-node/x/cheqd/utils"
Expand All @@ -10,7 +11,7 @@ import (

const UpdatedPostfix string = "-updated"

func (k msgServer) UpdateDid(goCtx context.Context, msg *types.MsgUpdateDid) (*types.MsgUpdateDidResponse, error) {
func (k MsgServer) UpdateDid(goCtx context.Context, msg *types.MsgUpdateDid) (*types.MsgUpdateDidResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

// Validate DID does exist
Expand Down Expand Up @@ -151,9 +152,13 @@ func GetSignerDIDsForDIDUpdate(existingDid types.Did, updatedDid types.Did) []st
}

// VM updated
// We don't compare ids because they will be different after replacing ids on the updated version of DID.
// Fragments equality is checked above.
if !types.CompareVerificationMethodsWithoutIds(existingVM, *updatedVM) {
// We have to revert renaming before comparing veriifcation methods.
// Otherwise we will detect id and controller change
// for non changed VMs because of `-updated` postfix.
originalUpdatedVM := *updatedVM
originalUpdatedVM.ReplaceIds(updatedDid.Id, existingDid.Id)

if !reflect.DeepEqual(existingVM, originalUpdatedVM) {
signers = append(signers, existingVM.Controller, updatedVM.Controller)
continue
}
Expand Down
6 changes: 3 additions & 3 deletions x/cheqd/keeper/query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"github.com/cheqd/cheqd-node/x/cheqd/types"
)

type queryServer struct {
type QueryServer struct {
Keeper
}

// NewQueryServer returns an implementation of the MsgServer interface for the provided Keeper.
func NewQueryServer(keeper Keeper) types.QueryServer {
return &queryServer{Keeper: keeper}
return &QueryServer{Keeper: keeper}
}

var _ types.QueryServer = queryServer{}
var _ types.QueryServer = QueryServer{}
22 changes: 0 additions & 22 deletions x/cheqd/tests/constants.go

This file was deleted.

Loading