diff --git a/Makefile b/Makefile index 3d9b31a52f..9716ed19b7 100644 --- a/Makefile +++ b/Makefile @@ -234,7 +234,8 @@ test-e2e-cov: $(TEST_E2E_DEPS) test-e2e-clean: docker stop umee0 umee1 umee2 umee-gaia-relayer gaiaval0 umee-price-feeder || true - docker rm umee0 umee1 umee2 umee-gaia-relayer gaiaval0 umee-price-feeder + docker rm umee0 umee1 umee2 umee-gaia-relayer gaiaval0 umee-price-feeder || true + docker network prune -f test-qa: @go test ./tests/qa/... -timeout 30m -v -tags='test_qa' diff --git a/client/client.go b/client/client.go index bcfecbdbcd..d94e44aaff 100644 --- a/client/client.go +++ b/client/client.go @@ -36,6 +36,10 @@ func NewClient( }, nil } +func (c Client) WithAccSeq(seq uint64) { + c.Client.Tx = c.Client.Tx.WithAccSeq(seq) +} + func (c Client) NewQCtx() (context.Context, context.CancelFunc) { return c.Query.NewCtx() } diff --git a/go.mod b/go.mod index 462de06b5a..954c7a4c4b 100644 --- a/go.mod +++ b/go.mod @@ -25,12 +25,12 @@ require ( github.com/rs/zerolog v1.31.0 github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.17.0 + github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.34.29 github.com/tendermint/tm-db v0.6.7 - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb + golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea + google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 google.golang.org/grpc v1.58.2 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v3 v3.0.1 @@ -41,8 +41,8 @@ require ( require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect - cloud.google.com/go v0.110.7 // indirect - cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go v0.110.4 // indirect + cloud.google.com/go/compute v1.21.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.1 // indirect cloud.google.com/go/storage v1.30.1 // indirect @@ -102,7 +102,7 @@ require ( github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/daixiang0/gci v0.11.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/denis-tingaikin/go-header v0.4.3 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect @@ -157,11 +157,11 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/s2a-go v0.1.7 // indirect + github.com/google/s2a-go v0.1.4 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.3.1 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/googleapis/gax-go/v2 v2.11.0 // indirect github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect @@ -196,7 +196,7 @@ require ( github.com/kisielk/errcheck v1.6.3 // indirect github.com/kisielk/gotool v1.0.0 // indirect github.com/kkHAIKE/contextcheck v1.1.4 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.16.0 // indirect github.com/kulti/thelper v0.6.3 // indirect github.com/kunwardeep/paralleltest v1.0.8 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect @@ -234,10 +234,10 @@ require ( github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.5 // indirect github.com/otiai10/copy v1.9.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polyfloyd/go-errorlint v1.4.4 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect @@ -252,8 +252,6 @@ require ( github.com/rs/cors v1.8.2 // indirect github.com/ryancurrah/gomodguard v1.3.0 // indirect github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect - github.com/sagikazarmark/locafero v0.3.0 // indirect - github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect @@ -265,14 +263,14 @@ require ( github.com/sivchari/nosnakecase v1.7.0 // indirect github.com/sivchari/tenv v1.7.1 // indirect github.com/sonatard/noctx v0.0.2 // indirect - github.com/sourcegraph/conc v0.3.0 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect - github.com/spf13/afero v1.10.0 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect 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.5.0 // indirect - github.com/subosito/gotenv v1.6.0 // indirect + github.com/subosito/gotenv v1.4.2 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect @@ -303,7 +301,7 @@ require ( go.tmz.dev/musttag v0.7.2 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/goleak v1.1.12 // indirect - go.uber.org/multierr v1.9.0 // indirect + go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.14.0 // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect @@ -316,10 +314,10 @@ require ( golang.org/x/text v0.13.0 // indirect golang.org/x/tools v0.13.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.143.0 // indirect + google.golang.org/api v0.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect + google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect honnef.co/go/tools v0.4.5 // indirect diff --git a/go.sum b/go.sum index d710a2d18e..3fa055e624 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= -cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk= +cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -77,8 +77,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.21.0 h1:JNBsyXVoOoNJtTQcnEY5uYpZIbeCTYIeDe0Xh1bySMk= +cloud.google.com/go/compute v1.21.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -472,9 +472,8 @@ github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnG github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= @@ -790,22 +789,21 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= -github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ= -github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -815,8 +813,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -991,8 +989,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= @@ -1212,8 +1210,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= 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= @@ -1231,9 +1229,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polyfloyd/go-errorlint v1.4.4 h1:A9gytp+p6TYqeALTYRoxJESYP8wJRETRX2xzGWFsEBU= github.com/polyfloyd/go-errorlint v1.4.4/go.mod h1:ry5NqF7l9Q77V+XqAfUg1zfryrEtyac3G5+WVpIK0xU= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -1319,10 +1316,6 @@ github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28 github.com/ryanrolds/sqlclosecheck v0.4.0 h1:i8SX60Rppc1wRuyQjMciLqIzV3xnoHB7/tXbr6RGYNI= github.com/ryanrolds/sqlclosecheck v0.4.0/go.mod h1:TBRRjzL31JONc9i4XMinicuo+s+E8yKZ5FN8X3G6CKQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= -github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= -github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= -github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= @@ -1365,16 +1358,14 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= -github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= @@ -1383,13 +1374,15 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= -github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= 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/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= @@ -1413,10 +1406,11 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= -github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -1546,14 +1540,15 @@ go.tmz.dev/musttag v0.7.2/go.mod h1:m6q5NiiSKMnQYokefa2xGoyoXnrswCbJ0AWYzf4Zs28= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= 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.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -1584,6 +1579,7 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= @@ -1602,8 +1598,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= +golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 h1:jWGQJV4niP+CCmFW9ekjA9Zx8vYORzOUH2/Nl5WPuLQ= @@ -1897,6 +1893,7 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -2057,8 +2054,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.143.0 h1:o8cekTkqhywkbZT6p1UHJPZ9+9uuCAJs/KYomxZB8fA= -google.golang.org/api v0.143.0/go.mod h1:FoX9DO9hT7DLNn97OuoZAGSDuNAXdJRuGK98rSUgurk= +google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2178,12 +2175,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI= -google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= diff --git a/tests/e2e/e2e_ibc_test.go b/tests/e2e/e2e_ibc_test.go index 6d5040b969..128099cf93 100644 --- a/tests/e2e/e2e_ibc_test.go +++ b/tests/e2e/e2e_ibc_test.go @@ -1,6 +1,7 @@ package e2e import ( + "fmt" "time" "cosmossdk.io/math" @@ -13,8 +14,26 @@ import ( "github.com/umee-network/umee/v6/x/uibc" ) +const ( + // ibc hash of gaia stake token on umee + stakeIBCHash = "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878" + // ibc hash of uumee token on gaia + umeeIBCHash = "ibc/9F53D255F5320A4BE124FF20C29D46406E126CE8A09B00CA8D3CFF7905119728" + // ibc hash of uatom token on umee + uatomIBCHash = "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" + + atomSymbol = "ATOM" + umeeSymbol = "UMEE" +) + var powerReduction = sdk.MustNewDecFromStr("10").Power(6) +// mulCoin multiplies the amount of a coin by a dec (given as string) +func mulCoin(c sdk.Coin, d string) sdk.Coin { + newAmount := sdk.MustNewDecFromStr(d).MulInt(c.Amount).RoundInt() + return sdk.NewCoin(c.Denom, newAmount) +} + func (s *E2ETest) checkOutflowByPercentage(endpoint, excDenom string, outflow, amount, perDiff sdk.Dec) { // get historic average price for denom (SYMBOL_DENOM) histoAvgPrice, err := s.QueryHistAvgPrice(endpoint, excDenom) @@ -45,122 +64,116 @@ func (s *E2ETest) checkOutflows(umeeAPIEndpoint, denom string, checkWithExcRate } func (s *E2ETest) checkSupply(endpoint, ibcDenom string, amount math.Int) { + attempt := 1 s.Require().Eventually( func() bool { + attempt++ supply, err := s.QueryTotalSupply(endpoint) if err != nil { return false } - - return supply.AmountOf(ibcDenom).Equal(amount) + if supply.AmountOf(ibcDenom).Equal(amount) { + return true + } + if attempt == 59 { + // if we're nearing the end of our attempts, print expected and actual values + s.T().Logf("expected: %s, got: %s", amount, supply.AmountOf(ibcDenom)) + } + return false }, 2*time.Minute, - time.Second, + 2*time.Second, + fmt.Sprintf("check supply: %s (expected %s)", ibcDenom, amount), ) } func (s *E2ETest) TestIBCTokenTransfer() { + s.T().Skip("TODO: Re-enable ibc e2e") // IBC inbound transfer of non x/leverage registered tokens must fail, because // because we won't have price for it. s.Run("send_stake_to_umee", func() { // require the recipient account receives the IBC tokens (IBC packets ACKd) - stakeIBCHash := "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878" umeeAPIEndpoint := s.UmeeREST() - - valAddr, err := s.Chain.Validators[0].KeyInfo.GetAddress() - s.Require().NoError(err) - recipient := valAddr.String() + recipient := s.AccountAddr(0).String() token := sdk.NewInt64Coin("stake", 3300000000) // 3300stake - s.SendIBC(setup.GaiaChainID, s.Chain.ID, recipient, token, false) - - s.checkSupply(umeeAPIEndpoint, stakeIBCHash, token.Amount) + s.SendIBC(setup.GaiaChainID, s.Chain.ID, recipient, token, false, "") + // Zero, since not a registered token + s.checkSupply(umeeAPIEndpoint, stakeIBCHash, sdk.ZeroInt()) }) s.Run("ibc_transfer_quota", func() { // require the recipient account receives the IBC tokens (IBC packets ACKd) gaiaAPIEndpoint := s.GaiaREST() umeeAPIEndpoint := s.UmeeREST() - atomSymbol := "ATOM" - umeeSymbol := "UMEE" - totalQuota := math.NewInt(120) + // totalQuota := math.NewInt(120) tokenQuota := math.NewInt(100) - // ibc hash of uumee token - umeeIBCHash := "ibc/9F53D255F5320A4BE124FF20C29D46406E126CE8A09B00CA8D3CFF7905119728" - // ibc hash of uatom token - uatomIBCHash := "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" - // send uatom from gaia to umee - // Note : gaia -> umee (ibc_quota will not check token limit) + // compute the amount of ATOM sent from umee to gaia which would meet atom's token quota atomPrice, err := s.QueryHistAvgPrice(umeeAPIEndpoint, atomSymbol) s.Require().NoError(err) - emOfAtom := sdk.NewDecFromInt(totalQuota).Quo(atomPrice) - c := sdk.NewInt64Coin("uatom", emOfAtom.Mul(powerReduction).RoundInt64()) - s.Require().True(atomPrice.GT(sdk.OneDec()), "price should be non zero, and expecting higher than 1, got: %s", atomPrice) - s.Require().True(c.Amount.GT(sdk.NewInt(2_000_000)), "amount should be non zero, and expecting much higher than 2 atom = 2e6 uatom, got: %s", c.Amount) + s.Require().True(atomPrice.GT(sdk.OneDec()), + "atom price should be non zero, and expecting higher than 1, got: %s", atomPrice) + atomQuota := sdk.NewCoin(uatomIBCHash, + sdk.NewDecFromInt(tokenQuota).Quo(atomPrice).Mul(powerReduction).RoundInt(), + ) - s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", c, false) - s.checkSupply(umeeAPIEndpoint, uatomIBCHash, c.Amount) + // send $500 ATOM from gaia to umee. (ibc_quota will not check token limit) + atomFromGaia := mulCoin(atomQuota, "5.0") + atomFromGaia.Denom = "uatom" + s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", atomFromGaia, false, "") + s.checkSupply(umeeAPIEndpoint, uatomIBCHash, atomFromGaia.Amount) - // sending more tokens than token_quota limit of umee (token_quota is 100$) - histoAvgPriceOfUmee, err := s.QueryHistAvgPrice(umeeAPIEndpoint, umeeSymbol) + // compute the amout of UMEE sent to gaia which would meet umee's token quota + umeePrice, err := s.QueryHistAvgPrice(umeeAPIEndpoint, umeeSymbol) s.Require().NoError(err) - exceedAmountOfUmee := sdk.NewDecFromInt(totalQuota).Quo(histoAvgPriceOfUmee) - s.T().Logf("sending %s amount %s more than %s", umeeSymbol, exceedAmountOfUmee.String(), totalQuota.String()) - exceedAmountCoin := sdk.NewInt64Coin(appparams.BondDenom, exceedAmountOfUmee.Mul(powerReduction).RoundInt64()) - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedAmountCoin, true) - // check the ibc (umee) quota after ibc txs + s.Require().True(umeePrice.GT(sdk.MustNewDecFromStr("0.001")), + "umee price should be non zero, and expecting higher than 0.001, got: %s", umeePrice) + umeeQuota := sdk.NewCoin(appparams.BondDenom, + sdk.NewDecFromInt(tokenQuota).Quo(atomPrice).Mul(powerReduction).RoundInt(), + ) + + // send $90 UMEE from umee to gaia (ibc_quota will check) + // Note: receiver is null so hermes will default send to key_name (from config) of target chain (gaia) + sendUmee := mulCoin(umeeQuota, "0.9") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", sendUmee, false, fmt.Sprintf( + "sending %s (less than token quota) ", sendUmee.String())) + s.checkOutflows(umeeAPIEndpoint, appparams.BondDenom, true, sdk.NewDecFromInt(sendUmee.Amount), appparams.Name) + s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, sendUmee.Amount) + + // send $110 ATOM from umee to gaia + exceedAtom := mulCoin(atomQuota, "1.1") + // supply will be not be decreased because sending amount is more than token quota so it will fail + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedAtom, true, "uatom from umee to gaia") + s.checkSupply(umeeAPIEndpoint, uatomIBCHash, atomFromGaia.Amount) + + // send $110 UMEE from umee to gaia (token_quota is 100$) + exceedUmee := mulCoin(umeeQuota, "1.1") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedUmee, true, "") + // check the ibc (umee) quota after ibc txs - this one should have failed s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, math.ZeroInt()) - // send 100UMEE from umee to gaia - // Note: receiver is null means hermes will default send to key_name (from config) of target chain (gaia) - // umee -> gaia (ibc_quota will check) - umeeInitialQuota := math.NewInt(90) - belowTokenQuota := sdk.NewDecFromInt(umeeInitialQuota).Quo(histoAvgPriceOfUmee) - s.T().Logf("sending %s amount %s less than token quota %s", "UMEE", belowTokenQuota.String(), tokenQuota.String()) - token := sdk.NewInt64Coin(appparams.BondDenom, belowTokenQuota.Mul(powerReduction).RoundInt64()) - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", token, false) - s.checkOutflows(umeeAPIEndpoint, appparams.BondDenom, true, sdk.NewDecFromInt(token.Amount), appparams.Name) - s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, token.Amount) - - // send uatom (ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2) from umee to gaia - uatomIBCToken := sdk.NewInt64Coin(uatomIBCHash, c.Amount.Int64()) - // supply will be not be decreased because sending uatomIBCToken amount is more than token quota so it will fail - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", uatomIBCToken, true) - s.checkSupply(umeeAPIEndpoint, uatomIBCHash, uatomIBCToken.Amount) - - // send uatom below the token quota - /* - umee -> gaia - umee token_quot = 90$ - total_quota = 120$ - */ - belowTokenQuotabutNotBelowTotalQuota := sdk.NewDecFromInt(math.NewInt(90)).Quo(atomPrice) - uatomIBCToken.Amount = math.NewInt(belowTokenQuotabutNotBelowTotalQuota.Mul(powerReduction).RoundInt64()) - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", uatomIBCToken, true) + // send $40 ATOM from umee to gaia + atom40 := mulCoin(atomQuota, "0.4") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", atom40, true, "below token quota but not total quota") // supply will be not be decreased because sending more than total quota from umee to gaia - s.checkSupply(umeeAPIEndpoint, uatomIBCHash, c.Amount) - // making sure below the total quota - belowTokenQuotaInUSD := totalQuota.Sub(umeeInitialQuota).Sub(math.NewInt(2)) - belowTokenQuotaforAtom := sdk.NewDecFromInt(belowTokenQuotaInUSD).Quo(atomPrice) - uatomIBCToken.Amount = math.NewInt(belowTokenQuotaforAtom.Mul(powerReduction).RoundInt64()) - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", uatomIBCToken, false) - // remaing supply still exists for uatom in umee - s.checkSupply(umeeAPIEndpoint, uatomIBCHash, c.Amount.Sub(uatomIBCToken.Amount)) - s.checkOutflows(umeeAPIEndpoint, uatomIBCHash, true, sdk.NewDecFromInt(uatomIBCToken.Amount), atomSymbol) - - // sending more tokens then token_quota limit of umee - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedAmountCoin, true) - // check the ibc (umee) supply after ibc txs, it will same as previous because it will fail because to quota limit exceed - s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, token.Amount) - - /* sending back some amount from receiver to sender (ibc/XXX) - gaia -> umee - */ - s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewInt64Coin(umeeIBCHash, 1000), false) - s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, token.Amount.Sub(math.NewInt(1000))) - // sending back remaining ibc amount from receiver to sender (ibc/XXX) - s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewInt64Coin(umeeIBCHash, token.Amount.Sub(math.NewInt(1000)).Int64()), false) + s.checkSupply(umeeAPIEndpoint, uatomIBCHash, atomFromGaia.Amount) + + // send $15 ATOM from umee to gaia + sendAtom := mulCoin(atomQuota, "0.15") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", sendAtom, false, "below both quotas") + // remaing supply decreased uatom on umee + s.checkSupply(umeeAPIEndpoint, uatomIBCHash, atomFromGaia.Amount.Sub(sendAtom.Amount)) + s.checkOutflows(umeeAPIEndpoint, uatomIBCHash, true, sdk.NewDecFromInt(sendAtom.Amount), atomSymbol) + + // send $45 UMEE from gaia to umee + returnUmee := mulCoin(sendUmee, "0.5") + returnUmee.Denom = umeeIBCHash + s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", returnUmee, false, "send back some umee") + s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, returnUmee.Amount) // half was returned, so half remains + + // sending back remaining amount + s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", returnUmee, false, "send back remaining umee") s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, math.ZeroInt()) // reset the outflows @@ -187,30 +200,20 @@ func (s *E2ETest) TestIBCTokenTransfer() { ***/ // Make gov proposal to disable the quota check on ibc-transfer - for i := 0; i < 5; i++ { - err = grpc.UIBCIBCTransferSatusUpdate( - s.Umee, - uibc.IBCTransferStatus_IBC_TRANSFER_STATUS_QUOTA_DISABLED, - ) - - if err == nil { - break - } - - time.Sleep(1 * time.Second) - } - + err = grpc.UIBCIBCTransferStatusUpdate( + s.AccountClient(0), + uibc.IBCTransferStatus_IBC_TRANSFER_STATUS_QUOTA_DISABLED, + ) s.Require().NoError(err) // Get the uibc params for quota checking - uibcParams, err := s.Umee.QueryUIBCParams() + uibcParams, err := s.AccountClient(0).QueryUIBCParams() s.Require().NoError(err) s.Require().Equal(uibcParams.IbcStatus, uibc.IBCTransferStatus_IBC_TRANSFER_STATUS_QUOTA_DISABLED) - token = sdk.NewInt64Coin("uumee", 100000000) // 100 Umee - // sending the umee tokens - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", token, false) + // sending the umee tokens - they would have exceeded quota before + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedUmee, false, "sending umee") + s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, exceedUmee.Amount) // Check the outflows - s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, token.Amount) s.Require().Eventually( func() bool { a, err := s.QueryOutflows(umeeAPIEndpoint, appparams.BondDenom) @@ -222,8 +225,5 @@ func (s *E2ETest) TestIBCTokenTransfer() { 30*time.Second, 1*time.Second, ) - // resend the umee token from gaia to umee - s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewInt64Coin(umeeIBCHash, token.Amount.Int64()), false) - s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, sdk.ZeroInt()) }) } diff --git a/tests/e2e/e2e_leverage_test.go b/tests/e2e/e2e_leverage_test.go index 536a1e392f..e73a1545f0 100644 --- a/tests/e2e/e2e_leverage_test.go +++ b/tests/e2e/e2e_leverage_test.go @@ -9,56 +9,82 @@ import ( leveragetypes "github.com/umee-network/umee/v6/x/leverage/types" ) -func (s *E2ETest) leverageSupply(addr sdk.AccAddress, denom string, amount uint64) { +// sends a msgSupply from one of the suite's test accounts +func (s *E2ETest) leverageSupply(accountIndex int, denom string, amount uint64) { + addr := s.AccountAddr(accountIndex) asset := sdk.NewCoin(denom, sdk.NewIntFromUint64(amount)) - s.mustSucceedTx(leveragetypes.NewMsgSupply(addr, asset)) + s.mustSucceedTx(leveragetypes.NewMsgSupply(addr, asset), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageWithdraw(addr sdk.AccAddress, denom string, amount uint64) { +// sends a msgWithdraw from one of the suite's test accounts +func (s *E2ETest) leverageWithdraw(accountIndex int, denom string, amount uint64) { + addr := s.AccountAddr(accountIndex) asset := sdk.NewCoin(denom, sdk.NewIntFromUint64(amount)) - s.mustSucceedTx(leveragetypes.NewMsgWithdraw(addr, asset)) + s.mustSucceedTx(leveragetypes.NewMsgWithdraw(addr, asset), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageMaxWithdraw(addr sdk.AccAddress, denom string) { - s.mustSucceedTx(leveragetypes.NewMsgMaxWithdraw(addr, denom)) +// sends a msgMaxWithdraw from one of the suite's test accounts +func (s *E2ETest) leverageMaxWithdraw(accountIndex int, denom string) { + addr := s.AccountAddr(accountIndex) + s.mustSucceedTx(leveragetypes.NewMsgMaxWithdraw(addr, denom), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageCollateralize(addr sdk.AccAddress, denom string, amount uint64) { +// sends a msgCollateralize from one of the suite's test accounts +func (s *E2ETest) leverageCollateralize(accountIndex int, denom string, amount uint64) { + addr := s.AccountAddr(accountIndex) asset := sdk.NewCoin(denom, sdk.NewIntFromUint64(amount)) - s.mustSucceedTx(leveragetypes.NewMsgCollateralize(addr, asset)) + s.mustSucceedTx(leveragetypes.NewMsgCollateralize(addr, asset), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageDecollateralize(addr sdk.AccAddress, denom string, amount uint64) { +// sends a msgDecollateralize from one of the suite's test accounts +func (s *E2ETest) leverageDecollateralize(accountIndex int, denom string, amount uint64) { + addr := s.AccountAddr(accountIndex) asset := sdk.NewCoin(denom, sdk.NewIntFromUint64(amount)) - s.mustSucceedTx(leveragetypes.NewMsgDecollateralize(addr, asset)) + s.mustSucceedTx(leveragetypes.NewMsgDecollateralize(addr, asset), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageSupplyCollateral(addr sdk.AccAddress, denom string, amount uint64) { +// sends a msgSupplyCollateral from one of the suite's test accounts +func (s *E2ETest) leverageSupplyCollateral(accountIndex int, denom string, amount uint64) { + addr := s.AccountAddr(accountIndex) asset := sdk.NewCoin(denom, sdk.NewIntFromUint64(amount)) - s.mustSucceedTx(leveragetypes.NewMsgSupplyCollateral(addr, asset)) + s.mustSucceedTx(leveragetypes.NewMsgSupplyCollateral(addr, asset), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageBorrow(addr sdk.AccAddress, denom string, amount uint64) { +// sends a msgBorrow from one of the suite's test accounts +func (s *E2ETest) leverageBorrow(accountIndex int, denom string, amount uint64) { + addr := s.AccountAddr(accountIndex) asset := sdk.NewCoin(denom, sdk.NewIntFromUint64(amount)) - s.mustSucceedTx(leveragetypes.NewMsgBorrow(addr, asset)) + s.mustSucceedTx(leveragetypes.NewMsgBorrow(addr, asset), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageMaxBorrow(addr sdk.AccAddress, denom string) { - s.mustSucceedTx(leveragetypes.NewMsgMaxBorrow(addr, denom)) +// sends a msgMaxBorrow from one of the suite's test accounts +func (s *E2ETest) leverageMaxBorrow(accountIndex int, denom string) { + addr := s.AccountAddr(accountIndex) + s.mustSucceedTx(leveragetypes.NewMsgMaxBorrow(addr, denom), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageRepay(addr sdk.AccAddress, denom string, amount uint64) { +// sends a msgRepay from one of the suite's test accounts +func (s *E2ETest) leverageRepay(accountIndex int, denom string, amount uint64) { + addr := s.AccountAddr(accountIndex) asset := sdk.NewCoin(denom, sdk.NewIntFromUint64(amount)) - s.mustSucceedTx(leveragetypes.NewMsgRepay(addr, asset)) + s.mustSucceedTx(leveragetypes.NewMsgRepay(addr, asset), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageLiquidate(addr, target sdk.AccAddress, repayDenom string, repayAmount uint64, reward string) { +// sends a msgLiquidate from one of the suite's test accounts targeting another +func (s *E2ETest) leverageLiquidate(accountIndex, targetIndex int, repayDenom string, repayAmount uint64, reward string) { + addr := s.AccountAddr(accountIndex) + target := s.AccountAddr(targetIndex) repay := sdk.NewCoin(repayDenom, sdk.NewIntFromUint64(repayAmount)) - s.mustSucceedTx(leveragetypes.NewMsgLiquidate(addr, target, repay, reward)) + s.mustSucceedTx(leveragetypes.NewMsgLiquidate(addr, target, repay, reward), s.AccountClient(accountIndex)) } -func (s *E2ETest) leverageLeveragedLiquidate(addr, target sdk.AccAddress, repay, reward string) { - s.mustSucceedTx(leveragetypes.NewMsgLeveragedLiquidate(addr, target, repay, reward, sdk.ZeroDec())) +// sends a msgLeveragedLiquidate from one of the suite's test accounts targeting another +func (s *E2ETest) leverageLeveragedLiquidate(accountIndex, targetIndex int, repay, reward string) { + addr := s.AccountAddr(accountIndex) + target := s.AccountAddr(targetIndex) + s.mustSucceedTx(leveragetypes.NewMsgLeveragedLiquidate( + addr, target, repay, reward, sdk.ZeroDec()), s.AccountClient(accountIndex), + ) } func (s *E2ETest) TestLeverageBasics() { @@ -71,7 +97,7 @@ func (s *E2ETest) TestLeverageBasics() { s.Run( "leverage update registry", func() { s.Require().NoError( - grpc.LeverageRegistryUpdate(s.Umee, []leveragetypes.Token{}, updateTokens), + grpc.LeverageRegistryUpdate(s.AccountClient(0), []leveragetypes.Token{}, updateTokens), ) }, ) @@ -81,27 +107,27 @@ func (s *E2ETest) TestLeverageBasics() { s.Run( "initial leverage supply", func() { - s.leverageSupply(valAddr, appparams.BondDenom, 100_000_000) + s.leverageSupply(0, appparams.BondDenom, 100_000_000) }, ) s.Run( "initial leverage withdraw", func() { - s.leverageWithdraw(valAddr, "u/"+appparams.BondDenom, 10_000_000) + s.leverageWithdraw(0, "u/"+appparams.BondDenom, 10_000_000) }, ) s.Run( "initial leverage collateralize", func() { - s.leverageCollateralize(valAddr, "u/"+appparams.BondDenom, 80_000_000) + s.leverageCollateralize(0, "u/"+appparams.BondDenom, 80_000_000) }, ) s.Run( "initial leverage borrow", func() { - s.leverageBorrow(valAddr, appparams.BondDenom, 12_000_000) + s.leverageBorrow(0, appparams.BondDenom, 12_000_000) }, ) s.Run( "initial leverage repay", func() { - s.leverageRepay(valAddr, appparams.BondDenom, 2_000_000) + s.leverageRepay(0, appparams.BondDenom, 2_000_000) }, ) s.Run( @@ -110,7 +136,11 @@ func (s *E2ETest) TestLeverageBasics() { appparams.BondDenom, sdk.NewIntFromUint64(30_000_000), ) - s.mustFailTx(leveragetypes.NewMsgBorrow(valAddr, asset), "undercollateralized") + s.mustFailTx( + leveragetypes.NewMsgBorrow(s.AccountAddr(0), asset), + s.AccountClient(0), + "undercollateralized", + ) }, ) s.Run( @@ -125,7 +155,7 @@ func (s *E2ETest) TestLeverageBasics() { }, } s.Require().NoError( - grpc.LeverageSpecialPairsUpdate(s.Umee, []leveragetypes.SpecialAssetSet{}, pairs), + grpc.LeverageSpecialPairsUpdate(s.AccountClient(0), []leveragetypes.SpecialAssetSet{}, pairs), ) }, ) @@ -135,7 +165,7 @@ func (s *E2ETest) TestLeverageBasics() { appparams.BondDenom, sdk.NewIntFromUint64(30_000_000), ) - s.mustSucceedTx(leveragetypes.NewMsgBorrow(valAddr, asset)) + s.mustSucceedTx(leveragetypes.NewMsgBorrow(valAddr, asset), s.AccountClient(0)) }, ) } diff --git a/tests/e2e/e2e_metoken_test.go b/tests/e2e/e2e_metoken_test.go index f604624162..7835612de0 100644 --- a/tests/e2e/e2e_metoken_test.go +++ b/tests/e2e/e2e_metoken_test.go @@ -16,8 +16,7 @@ import ( func (s *E2ETest) TestMetokenSwapAndRedeem() { var index metoken.Index - valAddr, err := s.Chain.Validators[0].KeyInfo.GetAddress() - s.Require().NoError(err) + testAddr := s.AccountAddr(0) expectedBalance := mocks.EmptyUSDIndexBalances(mocks.MeUSDDenom) s.Run( @@ -28,14 +27,14 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { mocks.ValidToken(mocks.ISTBaseDenom, mocks.ISTSymbolDenom, 6), } - err = grpc.LeverageRegistryUpdate(s.Umee, tokens, nil) + err := grpc.LeverageRegistryUpdate(s.AccountClient(0), tokens, nil) s.Require().NoError(err) meUSD := mocks.StableIndex(mocks.MeUSDDenom) - err = grpc.MetokenRegistryUpdate(s.Umee, []metoken.Index{meUSD}, nil) + err = grpc.MetokenRegistryUpdate(s.AccountClient(0), []metoken.Index{meUSD}, nil) s.Require().NoError(err) - s.checkMetokenBalance(valAddr.String(), mocks.MeUSDDenom) + s.checkMetokenBalance(testAddr.String(), mocks.MeUSDDenom) }, ) @@ -57,7 +56,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { s.Require().NoError(err) returned := usdtPrice.SwapRate.MulInt(amountToSwap).TruncateInt() - s.executeSwap(valAddr.String(), hundredUSDT, mocks.MeUSDDenom) + s.executeSwap(testAddr.String(), hundredUSDT, mocks.MeUSDDenom) expectedBalance.MetokenSupply.Amount = expectedBalance.MetokenSupply.Amount.Add(returned) usdtBalance, i := expectedBalance.AssetBalance(mocks.USDTBaseDenom) @@ -67,7 +66,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { usdtBalance.Leveraged = usdtBalance.Leveraged.Add(amountToLeverage) expectedBalance.SetAssetBalance(usdtBalance) - s.checkMetokenBalance(valAddr.String(), mocks.MeUSDDenom) + s.checkMetokenBalance(testAddr.String(), mocks.MeUSDDenom) }, ) @@ -76,13 +75,13 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { twoHundredsMeUSD := sdk.NewCoin(mocks.MeUSDDenom, sdkmath.NewInt(200_000000)) s.executeRedeemWithFailure( - valAddr.String(), + testAddr.String(), twoHundredsMeUSD, mocks.USDTBaseDenom, "not enough", ) - s.checkMetokenBalance(valAddr.String(), mocks.MeUSDDenom) + s.checkMetokenBalance(testAddr.String(), mocks.MeUSDDenom) }, ) @@ -91,7 +90,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { prices := s.getPrices(mocks.MeUSDDenom) fiftyMeUSD := sdk.NewCoin(mocks.MeUSDDenom, sdkmath.NewInt(50_000000)) - s.executeRedeemSuccess(valAddr.String(), fiftyMeUSD, mocks.USDTBaseDenom) + s.executeRedeemSuccess(testAddr.String(), fiftyMeUSD, mocks.USDTBaseDenom) usdtToRedeem, err := prices[0].RedeemRate(fiftyMeUSD, mocks.USDTBaseDenom) s.Require().NoError(err) @@ -111,7 +110,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { usdtBalance.Leveraged = usdtBalance.Leveraged.Sub(amountFromLeverage) expectedBalance.SetAssetBalance(usdtBalance) - s.checkMetokenBalance(valAddr.String(), mocks.MeUSDDenom) + s.checkMetokenBalance(testAddr.String(), mocks.MeUSDDenom) }, ) } @@ -119,7 +118,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { func (s *E2ETest) checkMetokenBalance(valAddr, denom string) { s.Require().Eventually( func() bool { - resp, err := s.Umee.QueryMetokenIndexBalances(denom) + resp, err := s.AccountClient(0).QueryMetokenIndexBalances(denom) if err != nil { return false } @@ -170,7 +169,7 @@ func (s *E2ETest) getPrices(denom string) []metoken.IndexPrices { var prices []metoken.IndexPrices s.Require().Eventually( func() bool { - resp, err := s.Umee.QueryMetokenIndexPrices(denom) + resp, err := s.AccountClient(0).QueryMetokenIndexPrices(denom) if err != nil { return false } @@ -188,7 +187,7 @@ func (s *E2ETest) getMetokenIndex(denom string) metoken.Index { index := metoken.Index{} s.Require().Eventually( func() bool { - resp, err := s.Umee.QueryMetokenIndexes(denom) + resp, err := s.AccountClient(0).QueryMetokenIndexes(denom) if err != nil { return false } @@ -254,7 +253,7 @@ func (s *E2ETest) TxMetokenSwap(umeeAddr string, asset sdk.Coin, meTokenDenom st MetokenDenom: meTokenDenom, } - return s.BroadcastTxWithRetry(req) + return s.BroadcastTxWithRetry(req, s.AccountClient(0)) } func (s *E2ETest) TxMetokenRedeem(umeeAddr string, meToken sdk.Coin, assetDenom string) error { @@ -264,5 +263,5 @@ func (s *E2ETest) TxMetokenRedeem(umeeAddr string, meToken sdk.Coin, assetDenom AssetDenom: assetDenom, } - return s.BroadcastTxWithRetry(req) + return s.BroadcastTxWithRetry(req, s.AccountClient(0)) } diff --git a/tests/e2e/e2e_oracle_test.go b/tests/e2e/e2e_oracle_test.go index 32790e9a98..b4fed8d9bd 100644 --- a/tests/e2e/e2e_oracle_test.go +++ b/tests/e2e/e2e_oracle_test.go @@ -4,19 +4,51 @@ import ( "time" "github.com/umee-network/umee/v6/tests/grpc" + leveragetypes "github.com/umee-network/umee/v6/x/leverage/types" ) +// TestAllPrices wairs for all tokens in the leverage registry to have prices. +func (s *E2ETest) TestAllPrices() { + tokens := []leveragetypes.Token{} + s.Require().Eventually( + func() bool { + var err error + tokens, err = s.QueryRegisteredTokens(s.UmeeREST()) + if err != nil { + return false + } + return true + }, + time.Minute, time.Second, "get registered tokens", + ) + s.Require().Eventually( + func() bool { + exchangeRates, err := s.QueryExchangeRate(s.UmeeREST(), "") + if err != nil { + return false + } + for _, t := range tokens { + if exchangeRates.AmountOf(t.SymbolDenom).IsZero() { + return false + } + } + return true + }, + time.Minute, time.Second, "ensure all tokens have prices", + ) +} + // TestMedians queries for the oracle params, collects historical // prices based on those params, checks that the stored medians and // medians deviations are correct, updates the oracle params with // a gov prop, then checks the medians and median deviations again. func (s *E2ETest) TestMedians() { - err := grpc.MedianCheck(s.Umee) + err := grpc.MedianCheck(s.AccountClient(0)) s.Require().NoError(err) } func (s *E2ETest) TestUpdateOracleParams() { - params, err := s.Umee.QueryOracleParams() + params, err := s.AccountClient(0).QueryOracleParams() s.Require().NoError(err) s.Require().Equal(uint64(5), params.HistoricStampPeriod) @@ -26,7 +58,7 @@ func (s *E2ETest) TestUpdateOracleParams() { // simple retry loop to submit and pass a proposal for i := 0; i < 3; i++ { err = grpc.SubmitAndPassProposal( - s.Umee, + s.AccountClient(0), grpc.OracleParamChanges(10, 2, 20), ) if err == nil { @@ -38,7 +70,7 @@ func (s *E2ETest) TestUpdateOracleParams() { s.Require().NoError(err, "submit and pass proposal") - params, err = s.Umee.QueryOracleParams() + params, err = s.AccountClient(0).QueryOracleParams() s.Require().NoError(err) s.Require().Equal(uint64(10), params.HistoricStampPeriod) diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index fbd054544b..16180c5e3e 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/umee-network/umee/v6/client" setup "github.com/umee-network/umee/v6/tests/e2e/setup" ) @@ -28,10 +29,10 @@ func TestE2ETestSuite(t *testing.T) { // and requires that the transaction eventually succeeded with nil error. Since this function // retries for 5 seconds and ignores errors, it is suitable for scenario setup transaction or // those which might require a few blocks elapsing before they succeed. -func (s *E2ETest) mustEventuallySucceedTx(msg sdk.Msg) { +func (s *E2ETest) mustEventuallySucceedTx(msg sdk.Msg, cli client.Client) { s.Require().Eventually( func() bool { - return s.BroadcastTxWithRetry(msg) == nil + return s.BroadcastTxWithRetry(msg, cli) == nil }, 5*time.Second, 500*time.Millisecond, @@ -40,16 +41,16 @@ func (s *E2ETest) mustEventuallySucceedTx(msg sdk.Msg) { // mustSucceedTx executes an sdk.Msg (retrying several times if receiving incorrect account sequence) and // requires that the error returned is nil. -func (s *E2ETest) mustSucceedTx(msg sdk.Msg) { - s.Require().NoError(s.BroadcastTxWithRetry(msg)) +func (s *E2ETest) mustSucceedTx(msg sdk.Msg, cli client.Client) { + s.Require().NoError(s.BroadcastTxWithRetry(msg, cli)) } // mustFailTx executes an sdk.Msg (retrying several times if receiving incorrect account sequence) and // requires that the error returned contains a given substring. If the substring is empty, simply requires // non-nil error. -func (s *E2ETest) mustFailTx(msg sdk.Msg, errSubstring string) { +func (s *E2ETest) mustFailTx(msg sdk.Msg, cli client.Client, errSubstring string) { s.Require().ErrorContains( - s.BroadcastTxWithRetry(msg), + s.BroadcastTxWithRetry(msg, cli), errSubstring, ) } diff --git a/tests/e2e/setup/accounts.go b/tests/e2e/setup/accounts.go index 599ebd4232..d5a210a7e2 100644 --- a/tests/e2e/setup/accounts.go +++ b/tests/e2e/setup/accounts.go @@ -1,10 +1,12 @@ package setup import ( + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" appparams "github.com/umee-network/umee/v6/app/params" + "github.com/umee-network/umee/v6/client" "github.com/umee-network/umee/v6/util/coin" "github.com/umee-network/umee/v6/x/metoken/mocks" ) @@ -13,17 +15,48 @@ type testAccount struct { mnemonic string keyInfo keyring.Record addr sdk.AccAddress + client client.Client } var ( - // Initial coins to give to validators + // Initial coins to give to each validator valCoins = sdk.NewCoins( coin.New(appparams.BondDenom, 1_000000_000000), - coin.New(PhotonDenom, 1_000000_000000), - coin.New(mocks.USDTBaseDenom, 1_000000_000000), ) - // TODO: stake less on the validators, and instead delegate from a test account - stakeAmountCoin = coin.New(appparams.BondDenom, 1_000000) - stakeAmountCoin2 = coin.New(appparams.BondDenom, 5_000000) + // Number of test accounts to initialize in chain.TestAccounts + numTestAccounts = 1 + + // Initial coins to give to each test account. + testAccountCoins = sdk.NewCoins( + coin.New(appparams.BondDenom, 100000_000000), + coin.New(PhotonDenom, 100000_000000), + coin.New(mocks.USDTBaseDenom, 100000_000000), + ) + + // initial validator stakes (before delegation from test account 0) + stakeAmountCoin = coin.New(appparams.BondDenom, 1_000000) ) + +// create a test account, which is an address with a mnemonic stored only in memory, to be used with the network. +// these are created randomly each time and added to the suite, so they should be accessed by c.TestAccounts[i >= 0] +// and queries by the desired account's address +func (c *chain) createTestAccount(cdc codec.Codec) error { + mnemonic, info, err := createMemoryKey(cdc) + if err != nil { + return err + } + ta := testAccount{} + ta.keyInfo = *info + ta.mnemonic = mnemonic + ta.addr, err = info.GetAddress() + if err != nil { + return err + } + ta.client, err = c.initDedicatedClient("testAccount"+ta.addr.String(), mnemonic) + if err != nil { + return err + } + c.TestAccounts = append(c.TestAccounts, &ta) + return nil +} diff --git a/tests/e2e/setup/chain.go b/tests/e2e/setup/chain.go index 375ef76599..aa147b5434 100644 --- a/tests/e2e/setup/chain.go +++ b/tests/e2e/setup/chain.go @@ -41,6 +41,7 @@ type chain struct { dataDir string ID string Validators []*validator + TestAccounts []*testAccount GaiaValidators []*gaiaValidator } @@ -93,6 +94,13 @@ func (c *chain) createAndInitValidators(cdc codec.Codec, count int) error { return err } + // create a client which contains only this validator's keys + var err error + node.Client, err = c.initDedicatedClient(fmt.Sprint("val", i), node.mnemonic) + if err != nil { + return err + } + c.Validators = append(c.Validators, &node) } diff --git a/tests/e2e/setup/setup.go b/tests/e2e/setup/setup.go index 3c6d96200d..9797ff67ea 100644 --- a/tests/e2e/setup/setup.go +++ b/tests/e2e/setup/setup.go @@ -49,11 +49,28 @@ type E2ETestSuite struct { HermesResource *dockertest.Resource priceFeederResource *dockertest.Resource ValResources []*dockertest.Resource - Umee client.Client cdc codec.Codec MinNetwork bool // MinNetwork defines which runs only validator wihtout price-feeder, gaia and ibc-relayer } +// AccountClient returns the client associated with the a (non-validator) test account +// at the given index, panicking if the account does not exist. +func (s *E2ETestSuite) AccountClient(index int) client.Client { + if s.Chain == nil || len(s.Chain.TestAccounts) <= index { + panic(fmt.Sprint("no test client at index", index)) + } + return s.Chain.TestAccounts[index].client +} + +// AccountAddr returns the address associated with the a (non-validator) test account +// at the given index, panicking if the account does not exist. +func (s *E2ETestSuite) AccountAddr(index int) sdk.AccAddress { + if s.Chain == nil || len(s.Chain.TestAccounts) <= index { + panic(fmt.Sprint("no test client at index", index)) + } + return s.Chain.TestAccounts[index].addr +} + func (s *E2ETestSuite) SetupSuite() { var err error s.T().Log("setting up e2e integration test suite...") @@ -84,7 +101,14 @@ func (s *E2ETestSuite) SetupSuite() { } else { s.T().Log("running minimum network withut gaia,price-feeder and ibc-relayer") } - s.initUmeeClient() + + // Delegate to validators so that test account 0 has majority voting power on the network, + // allowing gov actions without validator votes. + s.T().Log("Delegating from test account 0 to validators") + s.Require().NoError(s.Delegate(0, 0, 10_000000)) + s.Require().NoError(s.Delegate(0, 1, 10_000000)) + s.Require().NoError(s.Delegate(0, 2, 50_000000)) // majority to validator 2, as it votes on prices + s.T().Log("Setup Complete") } func (s *E2ETestSuite) TearDownSuite() { @@ -126,11 +150,20 @@ func (s *E2ETestSuite) initNodes() { for _, val := range s.Chain.Validators { valAddr, err := val.KeyInfo.GetAddress() s.Require().NoError(err) + // modify genesis file to include new balances s.Require().NoError( addGenesisAccount(s.cdc, val0ConfigDir, "", valCoins, valAddr), ) } + // create test accounts and keys, and fund with multiple tokens + for i := 0; i < numTestAccounts; i++ { + s.Require().NoError(s.Chain.createTestAccount(s.cdc)) + s.Require().NoError( + addGenesisAccount(s.cdc, val0ConfigDir, "", testAccountCoins, s.AccountAddr(i)), + ) + } + // copy the genesis file to the remaining validators for _, val := range s.Chain.Validators[1:] { _, err := copyFile( @@ -255,12 +288,7 @@ func (s *E2ETestSuite) initGenesis() { s.T().Log("creating genesis txs") genTxs := make([]json.RawMessage, len(s.Chain.Validators)) for i, val := range s.Chain.Validators { - var createValmsg sdk.Msg - if i == 2 { - createValmsg, err = val.buildCreateValidatorMsg(stakeAmountCoin2) - } else { - createValmsg, err = val.buildCreateValidatorMsg(stakeAmountCoin) - } + createValmsg, err := val.buildCreateValidatorMsg(stakeAmountCoin) s.Require().NoError(err) signedTx, err := val.signMsg(s.cdc, createValmsg) @@ -398,29 +426,26 @@ func (s *E2ETestSuite) runValidators() { return true }, - 5*time.Minute, + 1*time.Minute, time.Second, "umee node failed to produce blocks", ) } -func (s *E2ETestSuite) initUmeeClient() { - var err error - mnemonics := make(map[string]string) - for index, v := range s.Chain.Validators { - mnemonics[fmt.Sprintf("val%d", index)] = v.mnemonic - } - ecfg := app.MakeEncodingConfig() - s.Umee, err = client.NewClient( - s.Chain.dataDir, - s.Chain.ID, +// create a client which has only a single mnemonic stored. This client can be safely +// passed into e2e functions which use a single unspecified key (i.e. client.keyringRecord[0]) +// to submit their transactions, as is currently the case. +func (c *chain) initDedicatedClient(name, mnemonic string) (client.Client, error) { + mnemonics := map[string]string{name: mnemonic} + return client.NewClient( + c.dataDir, + c.ID, "tcp://localhost:26657", "tcp://localhost:9090", mnemonics, 1, - ecfg, + app.MakeEncodingConfig(), ) - s.Require().NoError(err) } func noRestart(config *docker.HostConfig) { diff --git a/tests/e2e/setup/utils.go b/tests/e2e/setup/utils.go index ec371259e0..b1636b088f 100644 --- a/tests/e2e/setup/utils.go +++ b/tests/e2e/setup/utils.go @@ -8,6 +8,7 @@ import ( "io" "net/http" "regexp" + "strconv" "strings" "time" @@ -16,9 +17,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdktx "github.com/cosmos/cosmos-sdk/types/tx" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/gogo/protobuf/proto" "github.com/ory/dockertest/v3/docker" + appparams "github.com/umee-network/umee/v6/app/params" + "github.com/umee-network/umee/v6/client" + leveragetypes "github.com/umee-network/umee/v6/x/leverage/types" oracletypes "github.com/umee-network/umee/v6/x/oracle/types" "github.com/umee-network/umee/v6/x/uibc" ) @@ -31,14 +36,37 @@ func (s *E2ETestSuite) GaiaREST() string { return fmt.Sprintf("http://%s", s.GaiaResource.GetHostPort("1317/tcp")) } -func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token sdk.Coin, failDueToQuota bool) { +// Delegates an amount of uumee from the test account at a given index to a specified validator. +func (s *E2ETestSuite) Delegate(testAccount, valIndex int, amount uint64) error { + addr := s.AccountAddr(testAccount) + + if len(s.Chain.Validators) <= valIndex { + return fmt.Errorf("validator %d not found", valIndex) + } + valAddr, err := s.Chain.Validators[valIndex].KeyInfo.GetAddress() + if err != nil { + return err + } + valOperAddr := sdk.ValAddress(valAddr) + + asset := sdk.NewCoin(appparams.BondDenom, sdk.NewIntFromUint64(amount)) + msg := stakingtypes.NewMsgDelegate(addr, valOperAddr, asset) + + return s.BroadcastTxWithRetry(msg, s.AccountClient(testAccount)) +} + +func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token sdk.Coin, failDueToQuota bool, desc string) { + s.T().Logf("sending %s from %s to %s (exceed quota: %t) %s", token, srcChainID, dstChainID, failDueToQuota, desc) // ibctransfertypes.NewMsgTransfer() ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() // retry up to 5 times for i := 0; i < 5; i++ { - s.T().Logf("sending %s from %s to %s (%s). Try %d", token, srcChainID, dstChainID, recipient, i+1) + if i > 0 { + s.T().Logf("...try %d", i+1) + } + cmd := []string{ "hermes", "tx", @@ -102,9 +130,7 @@ func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token s continue } - s.T().Log("successfully sent IBC tokens") s.Require().NotEmptyf(txHash, "failed to find transaction hash in output outBuf: %s errBuf: %s", outBuf.String(), errBuf.String()) - s.T().Log("Waiting for Tx to be included in a block", txHash, srcChainID) endpoint := s.UmeeREST() if strings.Contains(srcChainID, "gaia") { endpoint = s.GaiaREST() @@ -116,7 +142,7 @@ func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token s s.T().Log("Tx Query Error", err) } return err == nil - }, 5*time.Second, 200*time.Millisecond) + }, 5*time.Second, 200*time.Millisecond, "require tx to be included in block") return } } @@ -182,6 +208,16 @@ func (s *E2ETestSuite) QueryExchangeRate(endpoint, denom string) (sdk.DecCoins, return resp.ExchangeRates, nil } +func (s *E2ETestSuite) QueryRegisteredTokens(endpoint string) ([]leveragetypes.Token, error) { + endpoint = fmt.Sprintf("%s/umee/leverage/v1/registered_tokens", endpoint) + var resp leveragetypes.QueryRegisteredTokensResponse + if err := s.QueryREST(endpoint, &resp); err != nil { + return nil, err + } + + return resp.Registry, nil +} + func (s *E2ETestSuite) QueryHistAvgPrice(endpoint, denom string) (sdk.Dec, error) { endpoint = fmt.Sprintf("%s/umee/historacle/v1/avg_price/%s", endpoint, strings.ToUpper(denom)) var resp oracletypes.QueryAvgPriceResponse @@ -231,11 +267,11 @@ func (s *E2ETestSuite) QueryUmeeBalance( return umeeBalance, umeeAddr } -func (s *E2ETestSuite) BroadcastTxWithRetry(msg sdk.Msg) error { +func (s *E2ETestSuite) BroadcastTxWithRetry(msg sdk.Msg, cli client.Client) error { var err error for retry := 0; retry < 3; retry++ { // retry if txs fails, because sometimes account sequence mismatch occurs due to txs pending - _, err = s.Umee.Tx.BroadcastTx(0, msg) + _, err = cli.Tx.BroadcastTx(0, msg) if err == nil { return nil } @@ -243,6 +279,16 @@ func (s *E2ETestSuite) BroadcastTxWithRetry(msg sdk.Msg) error { if err != nil && !strings.Contains(err.Error(), "incorrect account sequence") { return err } + + // if we were told an expected account sequence, we should use it next time + s := err.Error() + re := regexp.MustCompile("expected [\\d]+") + n, err := strconv.Atoi(strings.TrimPrefix(re.FindString(s), "expected ")) + if err == nil { + return nil + } + cli.WithAccSeq(uint64(n)) + time.Sleep(time.Millisecond * 300) } diff --git a/tests/e2e/setup/validator.go b/tests/e2e/setup/validator.go index ae23312a0f..d0007dee35 100644 --- a/tests/e2e/setup/validator.go +++ b/tests/e2e/setup/validator.go @@ -27,6 +27,7 @@ import ( umeeapp "github.com/umee-network/umee/v6/app" appparams "github.com/umee-network/umee/v6/app/params" + "github.com/umee-network/umee/v6/client" ) type validator struct { @@ -38,6 +39,7 @@ type validator struct { privateKey cryptotypes.PrivKey consensusKey privval.FilePVKey nodeKey p2p.NodeKey + Client client.Client } // instanceName is diff --git a/tests/grpc/gov.go b/tests/grpc/gov.go index 45796175bc..2e44f8de6d 100644 --- a/tests/grpc/gov.go +++ b/tests/grpc/gov.go @@ -58,7 +58,7 @@ func OracleParamChanges( } } -func UIBCIBCTransferSatusUpdate(umeeClient client.Client, status uibc.IBCTransferStatus) error { +func UIBCIBCTransferStatusUpdate(umeeClient client.Client, status uibc.IBCTransferStatus) error { msg := uibc.MsgGovSetIBCStatus{ Authority: checkers.GovModuleAddr, Description: "",