From 52eb5abc0316290948d561acca5e3618c44413e6 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Thu, 24 Feb 2022 14:26:37 +0100 Subject: [PATCH 1/3] build(deps): updated Cosmos to v0.45.1 Signed-off-by: Riccardo Montagnin --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index c7b6a27487..ee82cf9cc6 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect - github.com/coinbase/rosetta-sdk-go v0.6.10 // indirect + github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect github.com/confio/ics23/go v0.6.6 // indirect github.com/cosmos/btcutil v1.0.4 // indirect github.com/cosmos/iavl v0.17.3 // indirect @@ -127,7 +127,7 @@ require ( replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 -replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430 +replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220224114757-ff65314523cc replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 0cc6be0cd1..6b5ebd802e 100644 --- a/go.sum +++ b/go.sum @@ -217,8 +217,9 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/rosetta-sdk-go v0.6.10 h1:rgHD/nHjxLh0lMEdfGDqpTtlvtSBwULqrrZ2qPdNaCM= github.com/coinbase/rosetta-sdk-go v0.6.10/go.mod h1:J/JFMsfcePrjJZkwQFLh+hJErkAmdm9Iyy3D5Y0LfXo= +github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg= +github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= github.com/confio/ics23/go v0.6.6 h1:pkOy18YxxJ/r0XFDCnrl4Bjv6h4LkBSpLS6F38mrKL8= github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= @@ -274,8 +275,8 @@ github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430 h1:3UdGRNqZ6nD+SIEtsC2K1UqNPz1jHjdfMT2EHqL7aA4= -github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430/go.mod h1:Yd070TQ78qcMJmKn1/cOLEYBkn23d0Ra1mKW1goRSB4= +github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220224114757-ff65314523cc h1:ed1ukU6xkLYaZzbrTorrdxK28rr0z6ndwM//Thyq2Y4= +github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220224114757-ff65314523cc/go.mod h1:jslShmwbKjZ9OfLQUeiyoC8Joe3h6otyeWR0RbhgkqI= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9 h1:b77qmphsyX3+hjJraaqLyzjt9eKqbosy4LaYScPvTAs= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= From 3ca957e0c271751b7472f9279591080eb19a7bd1 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Thu, 24 Feb 2022 14:38:55 +0100 Subject: [PATCH 2/3] build(deps): updated IBC to v3.0.0-rc0 Signed-off-by: Riccardo Montagnin --- Makefile | 4 +-- app/ante.go | 4 +-- app/app.go | 20 +++++++------- app/sim_test.go | 4 +-- go.mod | 11 +++++--- go.sum | 26 +++++++++---------- testutil/ibctesting/chain.go | 18 ++++++------- testutil/ibctesting/coordinator.go | 4 +-- testutil/ibctesting/types.go | 2 +- .../proto/ibc/core/client/v1/client.proto | 4 +-- x/profiles/client/cli/cli_app_links.go | 4 +-- x/profiles/keeper/common_test.go | 4 +-- x/profiles/keeper/keeper_ibc.go | 4 +-- x/profiles/keeper/relay_app_links.go | 6 ++--- x/profiles/keeper/relay_app_links_test.go | 6 ++--- x/profiles/module_ibc.go | 8 +++--- x/profiles/types/expected_keeper.go | 6 ++--- x/profiles/types/genesis.go | 2 +- x/profiles/types/msgs_app_links.go | 4 +-- x/profiles/types/msgs_app_links.pb.go | 2 +- x/profiles/types/msgs_app_links_test.go | 2 +- 21 files changed, 74 insertions(+), 71 deletions(-) diff --git a/Makefile b/Makefile index 977ecd0475..894600b1b9 100644 --- a/Makefile +++ b/Makefile @@ -320,10 +320,10 @@ proto-check-breaking: TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.15/proto/tendermint GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos -COSMOS_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.44.5/proto/cosmos +COSMOS_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.45.1/proto/cosmos COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.6.3 -IBC_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v2.0.2/proto/ibc +IBC_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v3.0.0-rc0/proto/ibc TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto TM_ABCI_TYPES = third_party/proto/tendermint/abci diff --git a/app/ante.go b/app/ante.go index 1059823891..9ffda978f6 100644 --- a/app/ante.go +++ b/app/ante.go @@ -4,8 +4,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" - channelkeeper "github.com/cosmos/ibc-go/v2/modules/core/04-channel/keeper" - ibcante "github.com/cosmos/ibc-go/v2/modules/core/ante" + channelkeeper "github.com/cosmos/ibc-go/v3/modules/core/04-channel/keeper" + ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" diff --git a/app/app.go b/app/app.go index 6984b77bf6..35e594853f 100644 --- a/app/app.go +++ b/app/app.go @@ -16,7 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" "github.com/cosmos/cosmos-sdk/x/feegrant" - ibcclient "github.com/cosmos/ibc-go/v2/modules/core/02-client" + ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/prometheus/client_golang/prometheus" @@ -70,15 +70,15 @@ import ( "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - ibctransfer "github.com/cosmos/ibc-go/v2/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v2/modules/core" - ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper" + ibctransfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v3/modules/core" + ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" diff --git a/app/sim_test.go b/app/sim_test.go index 4c3cd81158..1a3e3145e5 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -30,8 +30,8 @@ import ( dbm "github.com/tendermint/tm-db" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types" - ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host" + ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp" diff --git a/go.mod b/go.mod index ee82cf9cc6..7c5496ba0d 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,9 @@ require ( github.com/CosmWasm/wasmd v0.21.1-0.20220105132732-3d2affb31f82 github.com/armon/go-metrics v0.3.10 github.com/btcsuite/btcd v0.22.0-beta - github.com/cosmos/cosmos-sdk v0.44.5 + github.com/cosmos/cosmos-sdk v0.45.1 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/ibc-go/v2 v2.0.3 + github.com/cosmos/ibc-go/v3 v3.0.0-rc0 github.com/ethereum/go-ethereum v1.10.16 github.com/ghodss/yaml v1.0.0 github.com/gogo/protobuf v1.3.3 @@ -26,7 +26,7 @@ require ( github.com/tendermint/tendermint v0.34.15 github.com/tendermint/tm-db v0.6.6 google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa - google.golang.org/grpc v1.43.0 + google.golang.org/grpc v1.44.0 google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v2 v2.4.0 ) @@ -47,6 +47,7 @@ require ( github.com/confio/ics23/go v0.6.6 // indirect github.com/cosmos/btcutil v1.0.4 // indirect github.com/cosmos/iavl v0.17.3 // indirect + github.com/cosmos/ibc-go/v2 v2.0.2 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect github.com/danieljoos/wincred v1.0.2 // indirect @@ -131,6 +132,10 @@ replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43. replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 +// Fix upstream GHSA-h395-qcrw-5vmq vulnerability. +// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 +replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 + replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 replace github.com/cosmos/ledger-cosmos-go => github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9 diff --git a/go.sum b/go.sum index 6b5ebd802e..bdc0db256c 100644 --- a/go.sum +++ b/go.sum @@ -246,9 +246,10 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= +github.com/cosmos/ibc-go/v2 v2.0.2 h1:y7eUgggMEVe43wHLw9XrGbeaTWtfkJYMoL3m6YW4fIY= github.com/cosmos/ibc-go/v2 v2.0.2/go.mod h1:XUmW7wmubCRhIEAGtMGS+5IjiSSmcAwihoN/yPGd6Kk= -github.com/cosmos/ibc-go/v2 v2.0.3 h1:kZ6SAj7hyxoixsLEUBx431bVGiBW22PCHwkWHafWhXs= -github.com/cosmos/ibc-go/v2 v2.0.3/go.mod h1:XUmW7wmubCRhIEAGtMGS+5IjiSSmcAwihoN/yPGd6Kk= +github.com/cosmos/ibc-go/v3 v3.0.0-rc0 h1:kQtRMiibviP99ySdmKb8pFkbDt+JQSnW4Swh1NYf0lg= +github.com/cosmos/ibc-go/v3 v3.0.0-rc0/go.mod h1:0G/3QhYWebySAQQgBgQ4y4rqu/UmO3y9ibies3wzpsg= 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-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= @@ -353,9 +354,8 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= +github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= @@ -379,14 +379,12 @@ github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dT github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -684,11 +682,11 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -824,11 +822,13 @@ github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWEr github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= +github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k= +github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= @@ -1656,8 +1656,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/testutil/ibctesting/chain.go b/testutil/ibctesting/chain.go index 76aef7fb82..7569239a52 100644 --- a/testutil/ibctesting/chain.go +++ b/testutil/ibctesting/chain.go @@ -26,15 +26,15 @@ import ( capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v2/modules/core/23-commitment/types" - host "github.com/cosmos/ibc-go/v2/modules/core/24-host" - "github.com/cosmos/ibc-go/v2/modules/core/exported" - "github.com/cosmos/ibc-go/v2/modules/core/types" - ibctmtypes "github.com/cosmos/ibc-go/v2/modules/light-clients/07-tendermint/types" - "github.com/cosmos/ibc-go/v2/testing/mock" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + "github.com/cosmos/ibc-go/v3/modules/core/exported" + "github.com/cosmos/ibc-go/v3/modules/core/types" + ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + "github.com/cosmos/ibc-go/v3/testing/mock" simapp "github.com/desmos-labs/desmos/v2/app" diff --git a/testutil/ibctesting/coordinator.go b/testutil/ibctesting/coordinator.go index e99e527a9a..e454e0cd73 100644 --- a/testutil/ibctesting/coordinator.go +++ b/testutil/ibctesting/coordinator.go @@ -12,8 +12,8 @@ import ( abci "github.com/tendermint/tendermint/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" - "github.com/cosmos/ibc-go/v2/modules/core/exported" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + "github.com/cosmos/ibc-go/v3/modules/core/exported" ) var ( diff --git a/testutil/ibctesting/types.go b/testutil/ibctesting/types.go index 758dcdd428..03d87df07d 100644 --- a/testutil/ibctesting/types.go +++ b/testutil/ibctesting/types.go @@ -1,7 +1,7 @@ package ibctesting import ( - channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" ) // TestConnection is a testing helper struct to keep track of the connectionID, source clientID, diff --git a/third_party/proto/ibc/core/client/v1/client.proto b/third_party/proto/ibc/core/client/v1/client.proto index 0733770201..657d99ed20 100644 --- a/third_party/proto/ibc/core/client/v1/client.proto +++ b/third_party/proto/ibc/core/client/v1/client.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -23,7 +23,7 @@ message ConsensusStateWithHeight { // consensus state height Height height = 1 [(gogoproto.nullable) = false]; // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml\"consensus_state\""]; + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; } // ClientConsensusStates defines all the stored consensus states for a given diff --git a/x/profiles/client/cli/cli_app_links.go b/x/profiles/client/cli/cli_app_links.go index 77dbdca4f2..00e7ee2960 100644 --- a/x/profiles/client/cli/cli_app_links.go +++ b/x/profiles/client/cli/cli_app_links.go @@ -11,8 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/version" - clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" - channelutils "github.com/cosmos/ibc-go/v2/modules/core/04-channel/client/utils" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + channelutils "github.com/cosmos/ibc-go/v3/modules/core/04-channel/client/utils" "github.com/desmos-labs/desmos/v2/x/profiles/types" ) diff --git a/x/profiles/keeper/common_test.go b/x/profiles/keeper/common_test.go index 41d4116cd8..7aaa343e7c 100644 --- a/x/profiles/keeper/common_test.go +++ b/x/profiles/keeper/common_test.go @@ -34,8 +34,8 @@ import ( capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper" + ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" "github.com/desmos-labs/desmos/v2/x/profiles/keeper" "github.com/desmos-labs/desmos/v2/x/profiles/types" diff --git a/x/profiles/keeper/keeper_ibc.go b/x/profiles/keeper/keeper_ibc.go index 31ab82f743..26d33fc03f 100644 --- a/x/profiles/keeper/keeper_ibc.go +++ b/x/profiles/keeper/keeper_ibc.go @@ -4,8 +4,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v2/modules/core/24-host" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" "github.com/desmos-labs/desmos/v2/x/profiles/types" ) diff --git a/x/profiles/keeper/relay_app_links.go b/x/profiles/keeper/relay_app_links.go index 162598086b..14b2bc9a75 100644 --- a/x/profiles/keeper/relay_app_links.go +++ b/x/profiles/keeper/relay_app_links.go @@ -9,9 +9,9 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v2/modules/core/24-host" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" "github.com/desmos-labs/desmos/v2/pkg/obi" diff --git a/x/profiles/keeper/relay_app_links_test.go b/x/profiles/keeper/relay_app_links_test.go index e0f86fff99..56fd5429d6 100644 --- a/x/profiles/keeper/relay_app_links_test.go +++ b/x/profiles/keeper/relay_app_links_test.go @@ -10,12 +10,12 @@ import ( "github.com/desmos-labs/desmos/v2/pkg/obi" - clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" - "github.com/cosmos/ibc-go/v2/modules/core/exported" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v3/modules/core/exported" "github.com/desmos-labs/desmos/v2/testutil/ibctesting" - channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/profiles/module_ibc.go b/x/profiles/module_ibc.go index d74559ff86..08aa21eb7c 100644 --- a/x/profiles/module_ibc.go +++ b/x/profiles/module_ibc.go @@ -9,11 +9,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v2/modules/core/24-host" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v2/modules/core/exported" + ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" "github.com/desmos-labs/desmos/v2/x/profiles/keeper" "github.com/desmos-labs/desmos/v2/x/profiles/types" diff --git a/x/profiles/types/expected_keeper.go b/x/profiles/types/expected_keeper.go index 654de78a18..70ec2b3432 100644 --- a/x/profiles/types/expected_keeper.go +++ b/x/profiles/types/expected_keeper.go @@ -3,9 +3,9 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - connectiontypes "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v2/modules/core/exported" + connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" ) // DONTCOVER diff --git a/x/profiles/types/genesis.go b/x/profiles/types/genesis.go index 93708478da..f87bdbae22 100644 --- a/x/profiles/types/genesis.go +++ b/x/profiles/types/genesis.go @@ -3,7 +3,7 @@ package types import ( "fmt" - host "github.com/cosmos/ibc-go/v2/modules/core/24-host" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" ) // NewGenesisState creates a new genesis state diff --git a/x/profiles/types/msgs_app_links.go b/x/profiles/types/msgs_app_links.go index 03fc676cc5..cf325193e6 100644 --- a/x/profiles/types/msgs_app_links.go +++ b/x/profiles/types/msgs_app_links.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" - host "github.com/cosmos/ibc-go/v2/modules/core/24-host" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" ) // NewMsgLinkApplication creates a new MsgLinkApplication instance diff --git a/x/profiles/types/msgs_app_links.pb.go b/x/profiles/types/msgs_app_links.pb.go index 7c1b414eb3..c39b73e69e 100644 --- a/x/profiles/types/msgs_app_links.pb.go +++ b/x/profiles/types/msgs_app_links.pb.go @@ -5,7 +5,7 @@ package types import ( fmt "fmt" - types "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" + types "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" diff --git a/x/profiles/types/msgs_app_links_test.go b/x/profiles/types/msgs_app_links_test.go index 51dd41c84c..2d9e015799 100644 --- a/x/profiles/types/msgs_app_links_test.go +++ b/x/profiles/types/msgs_app_links_test.go @@ -4,7 +4,7 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v2/x/profiles/types" From e6874acdc1cdaf333f2e3c8304303191c6dd9578 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Mon, 28 Feb 2022 10:18:33 +0100 Subject: [PATCH 3/3] Updated the profiles to be compatible with IBC v3.0 Signed-off-by: Riccardo Montagnin --- app/app.go | 8 ++-- go.mod | 2 +- go.sum | 5 +-- x/profiles/module_ibc.go | 92 ++++++++++++++++++++-------------------- 4 files changed, 54 insertions(+), 53 deletions(-) diff --git a/app/app.go b/app/app.go index 35e594853f..3e6851b4a4 100644 --- a/app/app.go +++ b/app/app.go @@ -406,10 +406,11 @@ func NewDesmosApp( // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedIBCTransferKeeper, ) transferModule := ibctransfer.NewAppModule(app.TransferKeeper) + transferIBCModule := ibctransfer.NewIBCModule(app.TransferKeeper) // Create subspaces keeper app.SubspacesKeeper = subspaceskeeper.NewKeeper(app.appCodec, keys[subspacestypes.StoreKey]) @@ -426,11 +427,12 @@ func NewDesmosApp( scopedProfilesKeeper, ) profilesModule := profiles.NewAppModule(appCodec, legacyAmino, app.ProfileKeeper, app.SubspacesKeeper, app.AccountKeeper, app.BankKeeper) + profilesIBCModule := profiles.NewIBCModule(appCodec, app.ProfileKeeper) // Create static IBC router, add transfer route, then set and seal it ibcRouter := porttypes.NewRouter() - ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule) - ibcRouter.AddRoute(profilestypes.ModuleName, profilesModule) + ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule) + ibcRouter.AddRoute(profilestypes.ModuleName, profilesIBCModule) // create evidence keeper with router evidenceKeeper := evidencekeeper.NewKeeper( diff --git a/go.mod b/go.mod index 7c5496ba0d..543328f8cc 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/desmos-labs/desmos/v2 go 1.17 require ( - github.com/CosmWasm/wasmd v0.21.1-0.20220105132732-3d2affb31f82 + github.com/CosmWasm/wasmd v0.21.1-0.20220119145644-97e0cc91f668 github.com/armon/go-metrics v0.3.10 github.com/btcsuite/btcd v0.22.0-beta github.com/cosmos/cosmos-sdk v0.45.1 diff --git a/go.sum b/go.sum index bdc0db256c..66c5375fd4 100644 --- a/go.sum +++ b/go.sum @@ -75,8 +75,8 @@ github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi 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/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmd v0.21.1-0.20220105132732-3d2affb31f82 h1:bJzh3hNViSTQk699W9BwPtBVUGzDjjd6dFHyGoNIBjg= -github.com/CosmWasm/wasmd v0.21.1-0.20220105132732-3d2affb31f82/go.mod h1:zmg1FhN9ShqhuyfsTb4m+oPyTmG/823sx/DePqj2Uv4= +github.com/CosmWasm/wasmd v0.21.1-0.20220119145644-97e0cc91f668 h1:uo86gcOCqIgpEzoTFEUqZBViSSM9KAMmzOwI8suiPiw= +github.com/CosmWasm/wasmd v0.21.1-0.20220119145644-97e0cc91f668/go.mod h1:XZKJ+deS3zFYd5vR4K7Uw+W0nGfwVMzj0pGoYlYmAzE= github.com/CosmWasm/wasmvm v1.0.0-beta5 h1:38M8z89LB5cFMYB5vfjewMzz9Pr8TB1QBHdjnrWnkas= github.com/CosmWasm/wasmvm v1.0.0-beta5/go.mod h1:mtwKxbmsko1zdwpaKiRkRwxijMmIAtnLaX5/UT2nPFk= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -217,7 +217,6 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/rosetta-sdk-go v0.6.10/go.mod h1:J/JFMsfcePrjJZkwQFLh+hJErkAmdm9Iyy3D5Y0LfXo= github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg= github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= github.com/confio/ics23/go v0.6.6 h1:pkOy18YxxJ/r0XFDCnrl4Bjv6h4LkBSpLS6F38mrKL8= diff --git a/x/profiles/module_ibc.go b/x/profiles/module_ibc.go index 08aa21eb7c..d63dfecbf6 100644 --- a/x/profiles/module_ibc.go +++ b/x/profiles/module_ibc.go @@ -4,6 +4,8 @@ import ( "fmt" "math" + "github.com/cosmos/cosmos-sdk/codec" + oracletypes "github.com/desmos-labs/desmos/v2/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,9 +22,23 @@ import ( ) var ( - _ porttypes.IBCModule = AppModule{} + _ porttypes.IBCModule = IBCModule{} ) +// IBCModule implements the IBC module interface for profiles given the profiles keeper. +type IBCModule struct { + cdc codec.BinaryCodec + keeper keeper.Keeper +} + +// NewIBCModule creates a new IBCModule given the keeper +func NewIBCModule(cdc codec.BinaryCodec, k keeper.Keeper) IBCModule { + return IBCModule{ + cdc: cdc, + keeper: k, + } +} + // ValidateProfilesChannelParams does validation of a newly created profiles channel. A profiles // channel must be UNORDERED, use the correct port (by default 'profiles'), and use the current // supported version. Only 2^32 channels are allowed to be created. @@ -32,7 +48,6 @@ func ValidateProfilesChannelParams( order channeltypes.Order, portID string, channelID string, - version string, ) error { // NOTE: for escrow address security only 2^32 channels are allowed to be created // Issue: https://github.com/cosmos/cosmos-sdk/issues/7737 @@ -59,7 +74,7 @@ func ValidateProfilesChannelParams( // ------------------------------------------------------------------------------------------------------------------- // OnChanOpenInit implements the IBCModule interface -func (am AppModule) OnChanOpenInit( +func (im IBCModule) OnChanOpenInit( ctx sdk.Context, order channeltypes.Order, connectionHops []string, @@ -69,12 +84,12 @@ func (am AppModule) OnChanOpenInit( counterparty channeltypes.Counterparty, version string, ) error { - if err := ValidateProfilesChannelParams(ctx, am.keeper, order, portID, channelID, version); err != nil { + if err := ValidateProfilesChannelParams(ctx, im.keeper, order, portID, channelID); err != nil { return err } // Claim channel capability passed back by IBC module - if err := am.keeper.ClaimCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { + if err := im.keeper.ClaimCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { return err } @@ -82,7 +97,7 @@ func (am AppModule) OnChanOpenInit( } // OnChanOpenTry implements the IBCModule interface -func (am AppModule) OnChanOpenTry( +func (im IBCModule) OnChanOpenTry( ctx sdk.Context, order channeltypes.Order, connectionHops []string, @@ -90,31 +105,30 @@ func (am AppModule) OnChanOpenTry( channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, - version, counterpartyVersion string, -) error { +) (string, error) { - if err := ValidateProfilesChannelParams(ctx, am.keeper, order, portID, channelID, version); err != nil { - return err + if err := ValidateProfilesChannelParams(ctx, im.keeper, order, portID, channelID); err != nil { + return "", err } // Module may have already claimed capability in OnChanOpenInit in the case of crossing hellos // (ie chainA and chainB both call ChanOpenInit before one of them calls ChanOpenTry) // If module can already authenticate the capability then module already owns it so we don't need to claim // Otherwise, module does not have channel capability and we must claim it from IBC - if !am.keeper.AuthenticateCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)) { + if !im.keeper.AuthenticateCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)) { // Only claim channel capability passed back by IBC module if we do not already own it - err := am.keeper.ClaimCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)) + err := im.keeper.ClaimCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)) if err != nil { - return err + return "", err } } - return nil + return types.Version, nil } // OnChanOpenAck implements the IBCModule interface -func (am AppModule) OnChanOpenAck( +func (im IBCModule) OnChanOpenAck( ctx sdk.Context, portID, channelID string, @@ -124,7 +138,7 @@ func (am AppModule) OnChanOpenAck( } // OnChanOpenConfirm implements the IBCModule interface -func (am AppModule) OnChanOpenConfirm( +func (im IBCModule) OnChanOpenConfirm( ctx sdk.Context, portID, channelID string, @@ -133,7 +147,7 @@ func (am AppModule) OnChanOpenConfirm( } // OnChanCloseInit implements the IBCModule interface -func (am AppModule) OnChanCloseInit( +func (im IBCModule) OnChanCloseInit( ctx sdk.Context, portID, channelID string, @@ -143,7 +157,7 @@ func (am AppModule) OnChanCloseInit( } // OnChanCloseConfirm implements the IBCModule interface -func (am AppModule) OnChanCloseConfirm( +func (im IBCModule) OnChanCloseConfirm( ctx sdk.Context, portID, channelID string, @@ -154,13 +168,13 @@ func (am AppModule) OnChanCloseConfirm( // ------------------------------------------------------------------------------------------------------------------- // OnRecvPacket implements the IBCModule interface -func (am AppModule) OnRecvPacket( +func (im IBCModule) OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ) ibcexported.Acknowledgement { // Try handling the chain link packet data - ack, err := am.HandlePacket(ctx, packet, handleOracleRequestPacketData, handleLinkChainAccountPacketData) + ack, err := im.HandlePacket(ctx, packet, handleOracleRequestPacketData, handleLinkChainAccountPacketData) if err != nil { ack = channeltypes.NewErrorAcknowledgement(err.Error()) } @@ -174,17 +188,17 @@ func (am AppModule) OnRecvPacket( // tell how the execution has ended. // If the packet cannot be handled properly, false will be returned instead as first value. type PacketHandler = func( - am AppModule, ctx sdk.Context, packet channeltypes.Packet, + im IBCModule, ctx sdk.Context, packet channeltypes.Packet, ) (handled bool, ack channeltypes.Acknowledgement, err error) // HandlePacket handles the given packet by passing it to the provided packet handlers one by one until // at least one of them can handle it. // If no handler supports the given packet, it returns types.ErrInvalidPacketData. -func (am AppModule) HandlePacket( +func (im IBCModule) HandlePacket( ctx sdk.Context, packet channeltypes.Packet, packetHandlers ...PacketHandler, ) (channeltypes.Acknowledgement, error) { for _, handler := range packetHandlers { - handled, ack, err := handler(am, ctx, packet) + handled, ack, err := handler(im, ctx, packet) if handled { return ack, err } @@ -195,7 +209,7 @@ func (am AppModule) HandlePacket( // handleLinkChainAccountPacketData tries handling athe given packet by deserializing the inner data // as a LinkChainAccountPacketData instance. func handleLinkChainAccountPacketData( - am AppModule, ctx sdk.Context, packet channeltypes.Packet, + im IBCModule, ctx sdk.Context, packet channeltypes.Packet, ) (handled bool, ack channeltypes.Acknowledgement, err error) { var packetData types.LinkChainAccountPacketData if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &packetData); err != nil { @@ -204,7 +218,7 @@ func handleLinkChainAccountPacketData( var acknowledgement channeltypes.Acknowledgement - packetAck, err := am.keeper.OnRecvLinkChainAccountPacket(ctx, packetData) + packetAck, err := im.keeper.OnRecvLinkChainAccountPacket(ctx, packetData) if err != nil { acknowledgement = channeltypes.NewErrorAcknowledgement(err.Error()) } else { @@ -216,7 +230,7 @@ func handleLinkChainAccountPacketData( acknowledgement = channeltypes.NewResultAcknowledgement(packetAckBytes) } - address, err := types.UnpackAddressData(am.cdc, packetData.SourceAddress) + address, err := types.UnpackAddressData(im.cdc, packetData.SourceAddress) if err != nil { return true, channeltypes.Acknowledgement{}, err } @@ -238,7 +252,7 @@ func handleLinkChainAccountPacketData( // handleOracleRequestPacketData tries handling athe given packet by deserializing the inner data // as an OracleResponsePacketData instance. func handleOracleRequestPacketData( - am AppModule, ctx sdk.Context, packet channeltypes.Packet, + im IBCModule, ctx sdk.Context, packet channeltypes.Packet, ) (handled bool, ack channeltypes.Acknowledgement, err error) { var data oracletypes.OracleResponsePacketData if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { @@ -247,7 +261,7 @@ func handleOracleRequestPacketData( acknowledgement := channeltypes.NewResultAcknowledgement([]byte{byte(1)}) - err = am.keeper.OnRecvApplicationLinkPacketData(ctx, data) + err = im.keeper.OnRecvApplicationLinkPacketData(ctx, data) if err != nil { acknowledgement = channeltypes.NewErrorAcknowledgement(err.Error()) } @@ -270,7 +284,7 @@ func handleOracleRequestPacketData( // ------------------------------------------------------------------------------------------------------------------- // OnAcknowledgementPacket implements the IBCModule interface -func (am AppModule) OnAcknowledgementPacket( +func (im IBCModule) OnAcknowledgementPacket( ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, @@ -290,7 +304,7 @@ func (am AppModule) OnAcknowledgementPacket( "cannot unmarshal oracle request packet data: %s", err.Error()) } - err = am.keeper.OnOracleRequestAcknowledgementPacket(ctx, data, ack) + err = im.keeper.OnOracleRequestAcknowledgementPacket(ctx, data, ack) if err != nil { return err } @@ -327,7 +341,7 @@ func (am AppModule) OnAcknowledgementPacket( // ------------------------------------------------------------------------------------------------------------------- // OnTimeoutPacket implements the IBCModule interface -func (am AppModule) OnTimeoutPacket( +func (im IBCModule) OnTimeoutPacket( ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, @@ -339,7 +353,7 @@ func (am AppModule) OnTimeoutPacket( "cannot unmarshal oracle request packet data: %s", err.Error()) } - err = am.keeper.OnOracleRequestTimeoutPacket(ctx, data) + err = im.keeper.OnOracleRequestTimeoutPacket(ctx, data) if err != nil { return err } @@ -355,17 +369,3 @@ func (am AppModule) OnTimeoutPacket( return nil } - -// ------------------------------------------------------------------------------------------------------------------- - -// NegotiateAppVersion implements the IBCModule interface -func (am AppModule) NegotiateAppVersion( - ctx sdk.Context, - order channeltypes.Order, - connectionID string, - portID string, - counterparty channeltypes.Counterparty, - proposedVersion string, -) (version string, err error) { - return types.Version, nil -}