diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 262425a1..703fc137 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -56,11 +56,8 @@ jobs: test-e2e: runs-on: ubuntu-latest - timeout-minutes: 25 + timeout-minutes: 30 steps: - - uses: actions/setup-go@v3 - with: - go-version: 1.18 - uses: actions/checkout@v3 - uses: technote-space/get-diff-action@v6.1.0 with: @@ -68,11 +65,26 @@ jobs: **/**.go go.mod go.sum + - uses: actions/setup-go@v3 + if: env.GIT_DIFF + with: + go-version: 1.18 + cache: true + + # In this step, this action saves a list of existing images, + # the cache is created without them in the post run. + # It also restores the cache if it exists. + - name: cache docker layer + uses: satackey/action-docker-layer-caching@v0.0.11 + if: env.GIT_DIFF + # Ignore the failure of a step and avoid terminating the job. + continue-on-error: true + - name: Build Docker Image - run: | - make docker-build-debug if: env.GIT_DIFF + run: | + DOCKER_BUILDKIT=1 make docker-build-debug - name: Test E2E + if: env.GIT_DIFF run: | make test-e2e - if: env.GIT_DIFF diff --git a/.golangci.yml b/.golangci.yml index 0692bd72..7303b110 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,9 +1,8 @@ run: tests: false skip-dirs: - - test - - diagrams - go: '1.19' + - test/e2e + - tests/simulation govet: # Enable analyzers by name (in addition to default). @@ -14,37 +13,39 @@ run: linters: enable: + # - dupl + # - nestif + # - rowserrcheck -- enable when it will support generics + # - whitespace + # - wsl + - asciicheck - bodyclose - - deadcode - depguard - dogsled - errcheck + - exportloopref - goconst - gocritic - gofmt - goimports - - revive - gosec - gosimple - govet + - grouper - ineffassign - lll - misspell - nakedret + - nolintlint - prealloc - - exportloopref + - revive - staticcheck - - structcheck - stylecheck - typecheck - unconvert - unparam - unused - - varcheck - - nolintlint - - asciicheck - # - whitespace - # - wsl + - usestdlibvars issues: exclude-rules: @@ -68,7 +69,5 @@ linters-settings: locale: US nolintlint: allow-unused: false - # Disable to ensure that nolint directives don't have a leading space. Default is true. allow-leading-space: true require-explanation: false - require-specific: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb53b7a..a1997238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +[#362](https://github.com/umee-network/peggo/pull/362) Update umeed to v3. [#343](https://github.com/umee-network/peggo/pull/343) Upgrade to cosmos-sdk v0.46.1. [#341](https://github.com/umee-network/peggo/pull/341) Fix linter. [#334](https://github.com/umee-network/peggo/pull/334) Update to go 1.18. diff --git a/Dockerfile b/Dockerfile index a22ef5c9..8ea0ab03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN make install # Fetch umeed binary FROM base-builder AS umeed-builder -ARG UMEE_VERSION=main +ARG UMEE_VERSION=v3.0.0-beta1 ENV PACKAGES curl eudev-dev RUN apk add --no-cache $PACKAGES WORKDIR /downloads/ diff --git a/cmd/peggo/client/context.go b/cmd/peggo/client/context.go index f7fc43d2..cc8d3148 100644 --- a/cmd/peggo/client/context.go +++ b/cmd/peggo/client/context.go @@ -9,7 +9,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/pkg/errors" - umeeapp "github.com/umee-network/umee/v2/app" + umeeapp "github.com/umee-network/umee/v3/app" ) // NewClientContext creates a new Cosmos Client context, where chainID diff --git a/cmd/peggo/flags.go b/cmd/peggo/flags.go index 9ada682b..66db0251 100644 --- a/cmd/peggo/flags.go +++ b/cmd/peggo/flags.go @@ -10,7 +10,7 @@ import ( "github.com/rs/zerolog" "github.com/spf13/pflag" - umeeapp "github.com/umee-network/umee/v2/app" + umeeparams "github.com/umee-network/umee/v3/app/params" ) const ( @@ -65,7 +65,7 @@ func cosmosFlagSet() *pflag.FlagSet { fs.String(flagTendermintRPC, "http://localhost:26657", "The Tendermint RPC endpoint of a Cosmos node") fs.String( flagCosmosGasPrices, - fmt.Sprintf("0.001%s", umeeapp.BondDenom), + fmt.Sprintf("0.05%s", umeeparams.BondDenom), "The gas prices to use for Cosmos transaction fees", ) diff --git a/cmd/peggo/keys.go b/cmd/peggo/keys.go index 6d4cd835..05611376 100644 --- a/cmd/peggo/keys.go +++ b/cmd/peggo/keys.go @@ -29,7 +29,7 @@ import ( "github.com/umee-network/peggo/orchestrator/ethereum/keystore" "golang.org/x/term" - umeeapp "github.com/umee-network/umee/v2/app" + umeeapp "github.com/umee-network/umee/v3/app" ) const defaultKeyringKeyName = "validator" diff --git a/go.mod b/go.mod index 6ef62c78..41f5c383 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,12 @@ module github.com/umee-network/peggo go 1.18 require ( + cosmossdk.io/math v1.0.0-beta.3 github.com/Gravity-Bridge/Gravity-Bridge/module v1.5.3 github.com/avast/retry-go v3.0.0+incompatible github.com/cosmos/cosmos-sdk v0.46.1 github.com/cosmos/go-bip39 v1.0.0 - github.com/ethereum/go-ethereum v1.10.23 + github.com/ethereum/go-ethereum v1.10.25 github.com/golang/mock v1.6.0 github.com/golangci/golangci-lint v1.49.0 github.com/hashicorp/go-multierror v1.1.1 @@ -19,11 +20,11 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/spf13/cobra v1.5.0 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.12.0 + github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.0 github.com/tendermint/tendermint v0.34.21 - github.com/umee-network/umee/price-feeder v0.0.0-20220825153408-0ce3e20c310c - github.com/umee-network/umee/v2 v2.0.0-20220825153408-0ce3e20c310c + github.com/umee-network/umee/price-feeder v1.0.1-0.20220919160536-0c0db8c7c112 + github.com/umee-network/umee/v3 v3.0.0-rc1 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 google.golang.org/grpc v1.49.0 @@ -37,7 +38,6 @@ require ( cloud.google.com/go/iam v0.3.0 // indirect cloud.google.com/go/storage v1.14.0 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect - cosmossdk.io/math v1.0.0-beta.3 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -56,7 +56,7 @@ require ( github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect - github.com/armon/go-metrics v0.4.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/ashanbrown/forbidigo v1.3.0 // indirect github.com/ashanbrown/makezero v1.1.1 // indirect github.com/aws/aws-sdk-go v1.40.45 // indirect @@ -84,7 +84,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/iavl v0.19.1 // indirect - github.com/cosmos/ibc-go/v3 v3.1.0 // indirect + github.com/cosmos/ibc-go/v5 v5.0.0-rc2 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect @@ -120,7 +120,7 @@ require ( github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.11.0 // indirect + github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/go-stack/stack v1.8.0 // indirect github.com/go-toolsmith/astcast v1.0.0 // indirect github.com/go-toolsmith/astcopy v1.0.1 // indirect @@ -177,7 +177,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect - github.com/ignite/cli v0.23.0 // indirect + github.com/ignite/cli v0.24.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect @@ -229,7 +229,7 @@ require ( github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect github.com/opencontainers/runc v1.1.3 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -269,7 +269,7 @@ require ( github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect github.com/stretchr/objx v0.4.0 // indirect - github.com/subosito/gotenv v1.4.0 // indirect + github.com/subosito/gotenv v1.4.1 // indirect github.com/sylvia7788/contextcheck v1.0.6 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tdakkota/asciicheck v0.1.1 // indirect @@ -309,12 +309,12 @@ require ( golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/tools v0.1.12 // indirect - golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect + golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/api v0.81.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9 // indirect + google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect honnef.co/go/tools v0.3.3 // indirect @@ -327,10 +327,9 @@ require ( ) replace ( - github.com/Gravity-Bridge/Gravity-Bridge/module => github.com/umee-network/Gravity-Bridge/module v1.4.2-0.20220805205452-2445605a0377 - github.com/cosmos/cosmos-sdk => github.com/umee-network/cosmos-sdk v0.46.0-umee.0.20220812010629-4d5bb2e3f73c - github.com/cosmos/ibc-go/v3 => github.com/umee-network/ibc-go/v3 v3.1.1-0.20220805152159-67d4d37d2d84 + github.com/Gravity-Bridge/Gravity-Bridge/module => github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-1 + github.com/cosmos/cosmos-sdk => github.com/umee-network/cosmos-sdk v0.46.1-umee github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/osmosis-labs/bech32-ibc => github.com/umee-network/bech32-ibc v0.3.0-rc1.0.20220726223124-958071525f39 + github.com/osmosis-labs/bech32-ibc => github.com/umee-network/bech32-ibc v0.3.0-rc1.0.20220831212913-42baad053f6e ) diff --git a/go.sum b/go.sum index df883476..299d080a 100644 --- a/go.sum +++ b/go.sum @@ -143,8 +143,8 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= @@ -304,6 +304,8 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.1 h1:3gaq9b6SjiB0KBTygRnAvEGml2pQlu1TH8uma5g63Ys= github.com/cosmos/iavl v0.19.1/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/ibc-go/v5 v5.0.0-rc2 h1:7rGkZwojUwK1Dvgze3ZP5K1upIKygudxU3WaeFFU2ts= +github.com/cosmos/ibc-go/v5 v5.0.0-rc2/go.mod h1:Wqsguq98Iuns8tgTv8+xaGYbC+Q8zJfbpjzT6IgMJbs= 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= @@ -398,8 +400,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= -github.com/ethereum/go-ethereum v1.10.23 h1:Xk8XAT4/UuqcjMLIMF+7imjkg32kfVFKoeyQDaO2yWM= -github.com/ethereum/go-ethereum v1.10.23/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= +github.com/ethereum/go-ethereum v1.10.25 h1:5dFrKJDnYf8L6/5o42abCE6a9yJm9cs4EJVRyYMr55s= +github.com/ethereum/go-ethereum v1.10.25/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= @@ -475,8 +477,8 @@ github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.11.0 h1:0W+xRM511GY47Yy3bZUbJVitCNg2BOGlCyvTqsp/xIw= -github.com/go-playground/validator/v10 v10.11.0/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= 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= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -615,8 +617,8 @@ 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= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -785,8 +787,8 @@ github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= 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/ignite/cli v0.23.0 h1:k8jDwG+hMd54KDvSrnEbo76ANM4NT9B9ReuuK/3md20= -github.com/ignite/cli v0.23.0/go.mod h1:8HH/rwaLsPis2M7wAyAQOG8j4MhpdWmtWC4lR8MoV5s= +github.com/ignite/cli v0.24.0 h1:2cggSIsT4MT9IIS4/8XqlwgekI0YWPMYeULLGrTgCUY= +github.com/ignite/cli v0.24.0/go.mod h1:XlqM9HK751rcKZg7RfrP9KiJRAVi4XfZskhGnHPgLr0= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -1089,8 +1091,8 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= -github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -1278,8 +1280,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= +github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= @@ -1302,11 +1304,10 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= -github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/sylvia7788/contextcheck v1.0.6 h1:o2EZgVPyMKE/Mtoqym61DInKEjwEbsmyoxg3VrmjNO4= github.com/sylvia7788/contextcheck v1.0.6/go.mod h1:9XDxwvxyuKD+8N+a7Gs7bfWLityh5t70g/GjdEt2N2M= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -1368,18 +1369,16 @@ github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iL github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/umee-network/Gravity-Bridge/module v1.4.2-0.20220805205452-2445605a0377 h1:qiUU8ueC1y0qlLD+uGJpte0n0fwFrsnRRbAU9btg6hU= -github.com/umee-network/Gravity-Bridge/module v1.4.2-0.20220805205452-2445605a0377/go.mod h1:4dZMXZMBQBXgxi/fnqvGLfofHSmiO8f5iWHIdjyWiWw= -github.com/umee-network/bech32-ibc v0.3.0-rc1.0.20220726223124-958071525f39 h1:iOsfJaoEDoasECHtJ3QAfJ5Scbi4TIKwwArDdWhRTdc= -github.com/umee-network/bech32-ibc v0.3.0-rc1.0.20220726223124-958071525f39/go.mod h1:UyY7PrlrfAD8HVQvsC62xM/wgApQ3qzycDB8odKqjX8= -github.com/umee-network/cosmos-sdk v0.46.0-umee.0.20220812010629-4d5bb2e3f73c h1:m5HWg/iZg8PH9/ffdKwrREvBDjJugRFaKgaXdIrlqms= -github.com/umee-network/cosmos-sdk v0.46.0-umee.0.20220812010629-4d5bb2e3f73c/go.mod h1:u6Ci6+V+srijJhzctEEPYBygUz3O2YXP5ZijPnV6mt0= -github.com/umee-network/ibc-go/v3 v3.1.1-0.20220805152159-67d4d37d2d84 h1:p6b0aqaHJuAE86X66g6/T+3yRiOCFvLoRi+MsBIe6qI= -github.com/umee-network/ibc-go/v3 v3.1.1-0.20220805152159-67d4d37d2d84/go.mod h1:3AlQMMd8WShb6sTPzc78LHh52UKg1V37pwkZKnSvMAY= -github.com/umee-network/umee/price-feeder v0.0.0-20220825153408-0ce3e20c310c h1:9/QckSeHM3O4fASYTUzpG6u9Q/iY1E57BLPRo8DnK0U= -github.com/umee-network/umee/price-feeder v0.0.0-20220825153408-0ce3e20c310c/go.mod h1:mWQooCJqOC7CxPk5Pg/ZANEHkVlbPKexg/YZ60P0evA= -github.com/umee-network/umee/v2 v2.0.0-20220825153408-0ce3e20c310c h1:XKmk6viH2sswg00/nfQqouUMvlXWGBJEQC8/IWduG8o= -github.com/umee-network/umee/v2 v2.0.0-20220825153408-0ce3e20c310c/go.mod h1:vt1vo/T84iXG6Wz4S9/iRF5M/CvCVcix2613oUbItls= +github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-1 h1:a4OGAGfmZ+jcHH//HuQCLeDYpLy3282t3deVKRPt+RU= +github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-1/go.mod h1:UN4ehDuy5PA1YY7juvBMMulyiKv7uBMLUbTV/vONzH0= +github.com/umee-network/bech32-ibc v0.3.0-rc1.0.20220831212913-42baad053f6e h1:RCxnO359ieolUDIT1cF7Ic3ms4epgmZxzNiz1a2IBeU= +github.com/umee-network/bech32-ibc v0.3.0-rc1.0.20220831212913-42baad053f6e/go.mod h1:Prssr3u1p2ICcgkhtMaX55NZv7A7E2ernO6fKrpolSg= +github.com/umee-network/cosmos-sdk v0.46.1-umee h1:htt48oCN/i0An5z8AS8ttXU3Dk7fiE/gWNvwQGGOJgs= +github.com/umee-network/cosmos-sdk v0.46.1-umee/go.mod h1:2+o8Qw8qnE02V+lQVZDJFQ8tri/hsiA5GmWaPERqVa0= +github.com/umee-network/umee/price-feeder v1.0.1-0.20220919160536-0c0db8c7c112 h1:djYVbmSzcYaO+pVwZW0aljmbuTPW0RcI/w/JP48y/v4= +github.com/umee-network/umee/price-feeder v1.0.1-0.20220919160536-0c0db8c7c112/go.mod h1:gN6k2Y54HswN8qhSsqT3KIrNwIAp7nZrngRmYeXKUxg= +github.com/umee-network/umee/v3 v3.0.0-rc1 h1:PfIRqzcwplMT/+xrIeTaXqqeXkT+xpk4r5yS2gSSMew= +github.com/umee-network/umee/v3 v3.0.0-rc1/go.mod h1:Ynig8YxdUZGguEWVKQmSeI5B/cUGsE2S2JmR0PSs7KI= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -1447,8 +1446,8 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -1880,8 +1879,9 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -2021,8 +2021,8 @@ google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9 h1:d3fKQZK+1rWQMg3xLKQbPMirUCo29I/NRdI2WarSzTg= -google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc h1:Nf+EdcTLHR8qDNN/KfkQL0u0ssxt9OhbaWCl5C0ucEI= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -2095,8 +2095,8 @@ gopkg.in/cheggaaa/pb.v1 v1.0.27/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/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= diff --git a/test/e2e/chain.go b/test/e2e/chain.go index ece7c650..9d500c43 100644 --- a/test/e2e/chain.go +++ b/test/e2e/chain.go @@ -12,8 +12,8 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" tmrand "github.com/tendermint/tendermint/libs/rand" - umeeapp "github.com/umee-network/umee/v2/app" - "github.com/umee-network/umee/v2/app/params" + umeeapp "github.com/umee-network/umee/v3/app" + "github.com/umee-network/umee/v3/app/params" ) const ( diff --git a/test/e2e/e2e_setup_test.go b/test/e2e/e2e_setup_test.go index 7f057574..40fd94ce 100644 --- a/test/e2e/e2e_setup_test.go +++ b/test/e2e/e2e_setup_test.go @@ -29,14 +29,14 @@ import ( tmconfig "github.com/tendermint/tendermint/config" tmjson "github.com/tendermint/tendermint/libs/json" rpchttp "github.com/tendermint/tendermint/rpc/client/http" - "github.com/umee-network/umee/v2/app" - leveragetypes "github.com/umee-network/umee/v2/x/leverage/types" + umeeparams "github.com/umee-network/umee/v3/app/params" + leveragetypes "github.com/umee-network/umee/v3/x/leverage/types" ) const ( photonDenom = "photon" initBalanceStr = "110000000000uumee,100000000000photon" - minGasPrice = "0.00001" + minGasPrice = "0.05" gaiaChainID = "test-gaia-chain" ethChainID uint = 15 @@ -45,7 +45,7 @@ const ( var ( stakeAmount, _ = sdk.NewIntFromString("100000000000") - stakeAmountCoin = sdk.NewCoin(app.BondDenom, stakeAmount) + stakeAmountCoin = sdk.NewCoin(umeeparams.BondDenom, stakeAmount) ) type IntegrationTestSuite struct { @@ -222,8 +222,8 @@ func (s *IntegrationTestSuite) initGenesis() { s.Require().NoError(cdc.UnmarshalJSON(appGenState[leveragetypes.ModuleName], &leverageGenState)) leverageGenState.Registry = append(leverageGenState.Registry, leveragetypes.Token{ - BaseDenom: app.BondDenom, - SymbolDenom: app.DisplayDenom, + BaseDenom: umeeparams.BondDenom, + SymbolDenom: umeeparams.DisplayDenom, Exponent: 6, ReserveFactor: sdk.MustNewDecFromStr("0.100000000000000000"), CollateralWeight: sdk.MustNewDecFromStr("0.050000000000000000"), @@ -357,7 +357,7 @@ func (s *IntegrationTestSuite) initValidatorConfigs() { } func (s *IntegrationTestSuite) getMinGasPrice() string { - return fmt.Sprintf("%s%s", minGasPrice, photonDenom) + return fmt.Sprintf("%s%s", minGasPrice, umeeparams.BondDenom) } func (s *IntegrationTestSuite) runGanacheContainer() { @@ -690,7 +690,7 @@ func (s *IntegrationTestSuite) runOrchestrators() { "--tendermint-rpc", fmt.Sprintf("http://%s:26657", s.valResources[i].Container.Name[1:]), "--cosmos-gas-prices", - fmt.Sprintf("%s%s", minGasPrice, photonDenom), + fmt.Sprintf("%s%s", minGasPrice, umeeparams.BondDenom), "--cosmos-from", s.chain.orchestrators[i].keyInfo.Name, "--oracle-providers=mock", diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 2e31c453..6eda6b46 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -1,9 +1,9 @@ package e2e import ( - "context" - "fmt" - "time" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + umeeparams "github.com/umee-network/umee/v3/app/params" ) func (s *IntegrationTestSuite) TestPhotonTokenTransfers() { @@ -15,68 +15,23 @@ func (s *IntegrationTestSuite) TestPhotonTokenTransfers() { // send 100 photon tokens from Umee to Ethereum s.Run("send_photon_tokens_to_eth", func() { - ethRecipient := s.chain.orchestrators[1].ethereumKey.address - s.sendFromUmeeToEth(0, ethRecipient, "100photon", "10photon", "3photon") + umeeValIdxSender := 0 + orchestratorIdxReceiver := 1 + amount := sdk.NewCoin(photonDenom, math.NewInt(100)) + umeeFee := sdk.NewCoin(umeeparams.BondDenom, math.NewInt(10000)) + gravityFee := sdk.NewCoin(photonDenom, math.NewInt(3)) - umeeEndpoint := fmt.Sprintf("http://%s", s.valResources[0].GetHostPort("1317/tcp")) - fromAddr, err := s.chain.validators[0].keyInfo.GetAddress() - s.Require().NoError(err) - - // require the sender's (validator) balance decreased - balance, err := queryUmeeDenomBalance(umeeEndpoint, fromAddr.String(), "photon") - s.Require().NoError(err) - s.Require().GreaterOrEqual(balance.Amount.Int64(), int64(99999998237)) - - // require the Ethereum recipient balance increased - var latestBalance int - s.Require().Eventuallyf( - func() bool { - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - defer cancel() - - b, err := queryEthTokenBalance(ctx, s.ethClient, photonERC20Addr, ethRecipient) - if err != nil { - return false - } - - latestBalance = b - - // The balance could differ if the receiving address was the orchestrator - // that sent the batch tx and got the gravity fee. - return b >= 100 && b <= 103 - }, - 2*time.Minute, - 5*time.Second, - "unexpected balance: %d", latestBalance, - ) + s.sendFromUmeeToEthCheck(umeeValIdxSender, orchestratorIdxReceiver, photonERC20Addr, amount, umeeFee, gravityFee) }) // send 100 photon tokens from Ethereum back to Umee s.Run("send_photon_tokens_from_eth", func() { - toAddr, err := s.chain.validators[0].keyInfo.GetAddress() - s.Require().NoError(err) - s.sendFromEthToUmee(1, photonERC20Addr, toAddr.String(), "100") - - umeeEndpoint := fmt.Sprintf("http://%s", s.valResources[0].GetHostPort("1317/tcp")) - expBalance := int64(99999998334) - - // require the original sender's (validator) balance increased - var latestBalance int64 - s.Require().Eventuallyf( - func() bool { - b, err := queryUmeeDenomBalance(umeeEndpoint, toAddr.String(), "photon") - if err != nil { - return false - } - - latestBalance = b.Amount.Int64() + s.T().Skip("paused due to Ethereum PoS migration and PoW fork") + umeeValIdxReceiver := 0 + orchestratorIdxSender := 1 + amount := uint64(100) - return latestBalance >= expBalance - }, - 2*time.Minute, - 5*time.Second, - "unexpected balance: %d", latestBalance, - ) + s.sendFromEthToUmeeCheck(orchestratorIdxSender, umeeValIdxReceiver, photonERC20Addr, photonDenom, amount) }) } @@ -89,66 +44,21 @@ func (s *IntegrationTestSuite) TestUmeeTokenTransfers() { // send 300 umee tokens from Umee to Ethereum s.Run("send_uumee_tokens_to_eth", func() { - ethRecipient := s.chain.orchestrators[1].ethereumKey.address - s.sendFromUmeeToEth(0, ethRecipient, "300uumee", "10photon", "7uumee") + umeeValIdxSender := 0 + orchestratorIdxReceiver := 1 + amount := sdk.NewCoin(umeeparams.BondDenom, math.NewInt(300)) + umeeFee := sdk.NewCoin(umeeparams.BondDenom, math.NewInt(10000)) + gravityFee := sdk.NewCoin(umeeparams.BondDenom, math.NewInt(7)) - endpoint := fmt.Sprintf("http://%s", s.valResources[0].GetHostPort("1317/tcp")) - fromAddr, err := s.chain.validators[0].keyInfo.GetAddress() - s.Require().NoError(err) - - balance, err := queryUmeeDenomBalance(endpoint, fromAddr.String(), "uumee") - s.Require().NoError(err) - s.Require().Equal(int64(9999999693), balance.Amount.Int64()) - - // require the Ethereum recipient balance increased - var latestBalance int - s.Require().Eventuallyf( - func() bool { - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - defer cancel() - - b, err := queryEthTokenBalance(ctx, s.ethClient, umeeERC20Addr, ethRecipient) - if err != nil { - return false - } - - latestBalance = b - - // The balance could differ if the receiving address was the orchestrator - // that sent the batch tx and got the gravity fee. - return b >= 300 && b <= 307 - }, - 5*time.Minute, - 5*time.Second, - "unexpected balance: %d", latestBalance, - ) + s.sendFromUmeeToEthCheck(umeeValIdxSender, orchestratorIdxReceiver, umeeERC20Addr, amount, umeeFee, gravityFee) }) // send 300 umee tokens from Ethereum back to Umee s.Run("send_uumee_tokens_from_eth", func() { - toAddr, err := s.chain.validators[0].keyInfo.GetAddress() - s.Require().NoError(err) - s.sendFromEthToUmee(1, umeeERC20Addr, toAddr.String(), "300") - - umeeEndpoint := fmt.Sprintf("http://%s", s.valResources[0].GetHostPort("1317/tcp")) - expBalance := int64(9999999993) - - // require the original sender's (validator) balance increased - var latestBalance int64 - s.Require().Eventuallyf( - func() bool { - b, err := queryUmeeDenomBalance(umeeEndpoint, toAddr.String(), "uumee") - if err != nil { - return false - } - - latestBalance = b.Amount.Int64() + umeeValIdxReceiver := 0 + orchestratorIdxSender := 1 + amount := uint64(300) - return latestBalance == expBalance - }, - 2*time.Minute, - 5*time.Second, - "unexpected balance: %d", latestBalance, - ) + s.sendFromEthToUmeeCheck(orchestratorIdxSender, umeeValIdxReceiver, umeeERC20Addr, umeeparams.BondDenom, amount) }) } diff --git a/test/e2e/e2e_util_test.go b/test/e2e/e2e_util_test.go index cecd3fd8..23ccfce7 100644 --- a/test/e2e/e2e_util_test.go +++ b/test/e2e/e2e_util_test.go @@ -9,6 +9,7 @@ import ( "net/http" "regexp" "strconv" + "strings" "time" gravitytypes "github.com/Gravity-Bridge/Gravity-Bridge/module/x/gravity/types" @@ -339,7 +340,85 @@ func queryEthTx(ctx context.Context, c *ethclient.Client, txHash string) error { return nil } -func queryEthTokenBalance(ctx context.Context, c *ethclient.Client, contractAddr, recipientAddr string) (int, error) { +func (s *IntegrationTestSuite) sendFromUmeeToEthCheck( + umeeValIdxSender, + orchestratorIdxReceiver int, + ethTokenAddr string, + amount, umeeFee, gravityFee sdk.Coin, +) { + if !strings.EqualFold(amount.Denom, gravityFee.Denom) { + s.T().Error("Amount and gravityFee should be the same denom", amount, gravityFee) + } + + // if all the coins are on the same denom + allSameDenom := strings.EqualFold(amount.Denom, umeeFee.Denom) && strings.EqualFold(amount.Denom, gravityFee.Denom) + var umeeFeeBalanceBeforeSend sdk.Coin + if !allSameDenom { + umeeFeeBalanceBeforeSend, _ = s.queryUmeeBalance(umeeValIdxSender, umeeFee.Denom) + } + + umeeAmountBalanceBeforeSend, ethBalanceBeforeSend, _, ethAddr := s.queryUmeeEthBalance(umeeValIdxSender, orchestratorIdxReceiver, amount.Denom, ethTokenAddr) // 3300000000 + + s.sendFromUmeeToEth(umeeValIdxSender, ethAddr, amount.String(), umeeFee.String(), gravityFee.String()) + umeeAmountBalanceAfterSend, ethBalanceAfterSend, _, _ := s.queryUmeeEthBalance(umeeValIdxSender, orchestratorIdxReceiver, amount.Denom, ethTokenAddr) // 3299999693 + + if allSameDenom { + s.Require().Equal(umeeAmountBalanceBeforeSend.Sub(amount).Sub(umeeFee).Sub(gravityFee).Amount.Int64(), umeeAmountBalanceAfterSend.Amount.Int64()) + } else { // the umeeFee and amount have different denom + s.Require().Equal(umeeAmountBalanceBeforeSend.Sub(amount).Sub(gravityFee).Amount.Int64(), umeeAmountBalanceAfterSend.Amount.Int64()) + umeeFeeBalanceAfterSend, _ := s.queryUmeeBalance(umeeValIdxSender, umeeFee.Denom) + s.Require().Equal(umeeFeeBalanceBeforeSend.Sub(umeeFee).Amount.Int64(), umeeFeeBalanceAfterSend.Amount.Int64()) + } + + // require the Ethereum recipient balance increased + // peggo needs time to read the event and cross the tx + ethLatestBalance := ethBalanceAfterSend + expectedAmount := (ethBalanceBeforeSend + int64(amount.Amount.Int64())) + s.Require().Eventuallyf( + func() bool { + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + + b, err := queryEthTokenBalance(ctx, s.ethClient, ethTokenAddr, ethAddr) + if err != nil { + return false + } + + ethLatestBalance = b + + // The balance could differ if the receiving address was the orchestrator + // that sent the batch tx and got the gravity fee. + return b >= expectedAmount && b <= expectedAmount+gravityFee.Amount.Int64() + }, + 2*time.Minute, + 5*time.Second, + "unexpected balance: %d", ethLatestBalance, + ) +} + +func (s *IntegrationTestSuite) queryUmeeEthBalance( + umeeValIdx, + orchestratorIdx int, + umeeTokenDenom, + ethTokenAddr string, +) (umeeBalance sdk.Coin, ethBalance int64, umeeAddr, ethAddr string) { + umeeBalance, umeeAddr = s.queryUmeeBalance(umeeValIdx, umeeTokenDenom) + + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + ethAddr = s.chain.orchestrators[orchestratorIdx].ethereumKey.address + + ethBalance, err := queryEthTokenBalance(ctx, s.ethClient, ethTokenAddr, ethAddr) + s.Require().NoError(err) + s.T().Logf( + "ETh Balance of tokens; index: %d, addr: %s, amount: %d, denom: %s, erc20Addr: %s", + orchestratorIdx, ethAddr, ethBalance, umeeTokenDenom, ethTokenAddr, + ) + + return umeeBalance, ethBalance, umeeAddr, ethAddr +} + +func queryEthTokenBalance(ctx context.Context, c *ethclient.Client, contractAddr, recipientAddr string) (int64, error) { data, err := ethABI.Pack(abiMethodNameBalanceOf, ethcmn.HexToAddress(recipientAddr)) if err != nil { return 0, fmt.Errorf("failed to pack ABI method call: %w", err) @@ -361,5 +440,59 @@ func queryEthTokenBalance(ctx context.Context, c *ethclient.Client, contractAddr return 0, fmt.Errorf("failed to parse balance: %w", err) } - return int(balance), nil + return balance, nil +} + +func (s *IntegrationTestSuite) queryUmeeBalance( + umeeValIdx int, + umeeTokenDenom string, +) (umeeBalance sdk.Coin, umeeAddr string) { + umeeEndpoint := fmt.Sprintf("http://%s", s.valResources[umeeValIdx].GetHostPort("1317/tcp")) + umeeAddress, err := s.chain.validators[umeeValIdx].keyInfo.GetAddress() + s.Require().NoError(err) + umeeAddr = umeeAddress.String() + + umeeBalance, err = queryUmeeDenomBalance(umeeEndpoint, umeeAddr, umeeTokenDenom) + s.Require().NoError(err) + s.T().Logf( + "Umee Balance of tokens validator; index: %d, addr: %s, amount: %s, denom: %s", + umeeValIdx, umeeAddr, umeeBalance.String(), umeeTokenDenom, + ) + + return umeeBalance, umeeAddr +} + +func (s *IntegrationTestSuite) sendFromEthToUmeeCheck( + orchestratorIdxSender, + umeeValIdxReceiver int, + ethTokenAddr, + umeeTokenDenom string, + amount uint64, +) { + umeeBalanceBeforeSend, ethBalanceBeforeSend, umeeAddr, _ := s.queryUmeeEthBalance(umeeValIdxReceiver, orchestratorIdxSender, umeeTokenDenom, ethTokenAddr) + s.sendFromEthToUmee(orchestratorIdxSender, ethTokenAddr, umeeAddr, fmt.Sprintf("%d", amount)) + umeeBalanceAfterSend, ethBalanceAfterSend, _, _ := s.queryUmeeEthBalance(umeeValIdxReceiver, orchestratorIdxSender, umeeTokenDenom, ethTokenAddr) + + s.Require().Equal(ethBalanceBeforeSend-int64(amount), ethBalanceAfterSend) + + umeeEndpoint := fmt.Sprintf("http://%s", s.valResources[umeeValIdxReceiver].GetHostPort("1317/tcp")) + // require the original sender's (validator) balance increased + // peggo needs time to read the event and cross the tx + umeeLatestBalance := umeeBalanceAfterSend.Amount + s.Require().Eventuallyf( + func() bool { + b, err := queryUmeeDenomBalance(umeeEndpoint, umeeAddr, umeeTokenDenom) + if err != nil { + s.T().Logf("Error at sendFromEthToUmeeCheck.queryUmeeDenomBalance %+v", err) + return false + } + + umeeLatestBalance = b.Amount + + return umeeBalanceBeforeSend.Amount.AddRaw(int64(amount)).Equal(umeeLatestBalance) + }, + 2*time.Minute, + 5*time.Second, + "unexpected balance: %d", umeeLatestBalance.Int64(), + ) } diff --git a/test/e2e/orchestrator.go b/test/e2e/orchestrator.go index d09a30aa..d5b1d4fe 100644 --- a/test/e2e/orchestrator.go +++ b/test/e2e/orchestrator.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" - umeeapp "github.com/umee-network/umee/v2/app" + umeeapp "github.com/umee-network/umee/v3/app" ) type orchestrator struct { diff --git a/test/e2e/validator.go b/test/e2e/validator.go index e34cbe4b..5cd13dd3 100644 --- a/test/e2e/validator.go +++ b/test/e2e/validator.go @@ -25,7 +25,7 @@ import ( "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/privval" - umeeapp "github.com/umee-network/umee/v2/app" + umeeapp "github.com/umee-network/umee/v3/app" ) type validator struct {