From f56f3bfa8baf52cbfc471552ac57379ce8420ed8 Mon Sep 17 00:00:00 2001 From: Adam Moser <63419657+toteki@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:48:30 -0600 Subject: [PATCH 01/14] fix: gov special assets fix for 6.0 (#2247) * fix 6.0 * nil test cases --- x/leverage/keeper/msg_server.go | 7 +- x/leverage/keeper/msg_server_test.go | 129 +++++++++++++++++++++++++++ x/leverage/types/token.go | 15 +++- 3 files changed, 146 insertions(+), 5 deletions(-) diff --git a/x/leverage/keeper/msg_server.go b/x/leverage/keeper/msg_server.go index 832906b800..55768e9748 100644 --- a/x/leverage/keeper/msg_server.go +++ b/x/leverage/keeper/msg_server.go @@ -579,9 +579,10 @@ func (s msgServer) GovUpdateSpecialAssets( for _, b := range set.Assets { if a != b { pair := types.SpecialAssetPair{ - Collateral: a, - Borrow: b, - CollateralWeight: set.CollateralWeight, + Collateral: a, + Borrow: b, + CollateralWeight: set.CollateralWeight, + LiquidationThreshold: set.LiquidationThreshold, } // sets or overrides (or deletes on zero collateral weight) each pair if err := s.keeper.SetSpecialAssetPair(ctx, pair); err != nil { diff --git a/x/leverage/keeper/msg_server_test.go b/x/leverage/keeper/msg_server_test.go index 27e7fcba00..df9a8981fc 100644 --- a/x/leverage/keeper/msg_server_test.go +++ b/x/leverage/keeper/msg_server_test.go @@ -187,6 +187,135 @@ func (s *IntegrationTestSuite) TestUpdateRegistry() { } } +func (s *IntegrationTestSuite) TestUpdateSpecialAssets() { + govAccAddr := checkers.GovModuleAddr + + testCases := []struct { + name string + req *types.MsgGovUpdateSpecialAssets + expectErr bool + errMsg string + }{ + { + "empty", + &types.MsgGovUpdateSpecialAssets{ + Authority: govAccAddr, + Description: "test", + Sets: []types.SpecialAssetSet{}, + Pairs: []types.SpecialAssetPair{}, + }, + true, + "empty", + }, + { + "invalid set", + &types.MsgGovUpdateSpecialAssets{ + Authority: govAccAddr, + Description: "test", + Sets: []types.SpecialAssetSet{ + { + Assets: []string{"test1", "test2"}, + CollateralWeight: sdk.MustNewDecFromStr("0.8"), + }, + }, + Pairs: []types.SpecialAssetPair{}, + }, + true, + "nil", + }, + { + "valid set", + &types.MsgGovUpdateSpecialAssets{ + Authority: govAccAddr, + Description: "test", + Sets: []types.SpecialAssetSet{ + { + Assets: []string{"test1", "test2"}, + CollateralWeight: sdk.MustNewDecFromStr("0.8"), + LiquidationThreshold: sdk.MustNewDecFromStr("0.9"), + }, + }, + Pairs: []types.SpecialAssetPair{}, + }, + false, + "", + }, + { + "invalid pair", + &types.MsgGovUpdateSpecialAssets{ + Authority: govAccAddr, + Description: "test", + Sets: []types.SpecialAssetSet{}, + Pairs: []types.SpecialAssetPair{ + { + Borrow: "test1", + Collateral: "test2", + CollateralWeight: sdk.MustNewDecFromStr("0.8"), + }, + }, + }, + true, + "nil", + }, + { + "valid pair", + &types.MsgGovUpdateSpecialAssets{ + Authority: govAccAddr, + Description: "test", + Sets: []types.SpecialAssetSet{}, + Pairs: []types.SpecialAssetPair{ + { + Borrow: "test1", + Collateral: "test2", + CollateralWeight: sdk.MustNewDecFromStr("0.8"), + LiquidationThreshold: sdk.MustNewDecFromStr("0.9"), + }, + }, + }, + false, + "", + }, + { + "valid set and pair", + &types.MsgGovUpdateSpecialAssets{ + Authority: govAccAddr, + Description: "test", + Sets: []types.SpecialAssetSet{ + { + Assets: []string{"test1", "test2"}, + CollateralWeight: sdk.MustNewDecFromStr("0.8"), + LiquidationThreshold: sdk.MustNewDecFromStr("0.9"), + }, + }, + Pairs: []types.SpecialAssetPair{ + { + Borrow: "test1", + Collateral: "test2", + CollateralWeight: sdk.MustNewDecFromStr("0.8"), + LiquidationThreshold: sdk.MustNewDecFromStr("0.9"), + }, + }, + }, + false, + "", + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + err := tc.req.ValidateBasic() + if err == nil { + _, err = s.msgSrvr.GovUpdateSpecialAssets(s.ctx, tc.req) + } + if tc.expectErr { + s.Require().ErrorContains(err, tc.errMsg) + } else { + s.Require().NoError(err) + } + }) + } +} + func (s *IntegrationTestSuite) TestMsgSupply() { type testCase struct { msg string diff --git a/x/leverage/types/token.go b/x/leverage/types/token.go index 165a22a930..3959efddd2 100644 --- a/x/leverage/types/token.go +++ b/x/leverage/types/token.go @@ -11,8 +11,10 @@ import ( "github.com/umee-network/umee/v6/util/coin" ) -var halfDec = sdk.MustNewDecFromStr("0.5") -var one = sdk.OneDec() +var ( + halfDec = sdk.MustNewDecFromStr("0.5") + one = sdk.OneDec() +) // ValidateBaseDenom validates a denom and ensures it is not a uToken. func ValidateBaseDenom(denom string) error { @@ -175,6 +177,11 @@ func (p SpecialAssetPair) Validate() error { return err } + if p.CollateralWeight.IsNil() || p.LiquidationThreshold.IsNil() { + return fmt.Errorf("nil collateral weight or liquidation threshold for asset pair (%s,%s)", + p.Borrow, p.Collateral) + } + // Collateral Weight is non-negative and less than 1. if p.CollateralWeight.IsNegative() || p.CollateralWeight.GTE(sdk.OneDec()) { return fmt.Errorf("invalid collateral rate: %s", p.CollateralWeight) @@ -202,6 +209,10 @@ func (s SpecialAssetSet) Validate() error { denoms[a] = true } + if s.CollateralWeight.IsNil() || s.LiquidationThreshold.IsNil() { + return fmt.Errorf("nil collateral weight or liquidation threshold for asset set %s)", s.Assets) + } + // Collateral Weight is non-negative and less than 1. if s.CollateralWeight.IsNegative() || s.CollateralWeight.GTE(sdk.OneDec()) { return fmt.Errorf("invalid collateral rate: %s", s.CollateralWeight) From 3de0b0c05b8016dc8b3ecc8aab9a4c183fe6b1e3 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 15 Sep 2023 19:05:01 +0200 Subject: [PATCH 02/14] docs: v6.0.1 changelog (#2248) --- CHANGELOG.md | 10 ++++++++++ RELEASE_NOTES.md | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2029343b2c..1a7992bcae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,16 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v6.0.1](https://github.com/umee-network/umee/releases/tag/v6.0.1) - 2023-09-15 + +### Features + +- [2245](https://github.com/umee-network/umee/pull/2245) cli x/ugov: emergency group query. + +### Bug Fixes + +- [2247](https://github.com/umee-network/umee/pull/2247) `leverage.GovUpdateSpecialAssets`: set missing `LiquidationThreshold` attribute. + ## [v6.0.0](https://github.com/umee-network/umee/releases/tag/v6.0.0) - 2023-09-14 ### Features diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8956d556c3..7187b418aa 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -6,6 +6,13 @@ Release Procedure is defined in the [CONTRIBUTING](CONTRIBUTING.md#release-procedure) document. +## v6.0.1 + +This is a bug fix release for the `leverage.MsgGovUpdateSpecialAssets` handler. +We also added `umeed q ugov emergency-group` CLI query. Users were able to query the Emergency Group address using REST. + +[CHANGELOG](CHANGELOG.md) + ## v6.0.0 Highlights: From b7adcb6ed56730cc38d6f6f9703120f27e22b94f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 21:06:33 -0600 Subject: [PATCH 03/14] build(deps): Bump gotest.tools/v3 from 3.5.0 to 3.5.1 (#2251) Bumps [gotest.tools/v3](https://github.com/gotestyourself/gotest.tools) from 3.5.0 to 3.5.1. - [Release notes](https://github.com/gotestyourself/gotest.tools/releases) - [Commits](https://github.com/gotestyourself/gotest.tools/compare/v3.5.0...v3.5.1) --- updated-dependencies: - dependency-name: gotest.tools/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d2494a6bcd..932319a058 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( google.golang.org/grpc v1.57.0 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v3 v3.0.1 - gotest.tools/v3 v3.5.0 + gotest.tools/v3 v3.5.1 mvdan.cc/gofumpt v0.5.0 ) diff --git a/go.sum b/go.sum index e4be4a980e..eb909a0fd9 100644 --- a/go.sum +++ b/go.sum @@ -2248,8 +2248,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 5df408e07574525be6281ddd94a4685e5d2666c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 21:07:05 -0600 Subject: [PATCH 04/14] build(deps): Bump google.golang.org/grpc from 1.57.0 to 1.58.1 (#2250) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.57.0 to 1.58.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.57.0...v1.58.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 24 ++++++++++++------------ go.sum | 49 ++++++++++++++++++++++++------------------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/go.mod b/go.mod index 932319a058..db5d4e2e8f 100644 --- a/go.mod +++ b/go.mod @@ -30,8 +30,8 @@ require ( github.com/tendermint/tendermint v0.34.29 github.com/tendermint/tm-db v0.6.7 golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea - google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e - google.golang.org/grpc v1.57.0 + google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 + google.golang.org/grpc v1.58.1 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 @@ -41,11 +41,11 @@ require ( require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.1 // 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 v0.13.0 // indirect - cloud.google.com/go/storage v1.28.1 // indirect + cloud.google.com/go/iam v1.1.1 // indirect + cloud.google.com/go/storage v1.30.1 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/4meepo/tagalign v1.3.2 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // 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.3 // 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.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.8.0 // 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 @@ -307,17 +307,17 @@ require ( golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.14.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/sync v0.3.0 // indirect golang.org/x/sys v0.11.0 // indirect golang.org/x/term v0.11.0 // indirect golang.org/x/text v0.12.0 // indirect golang.org/x/tools v0.12.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.122.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-20230629202037-9506855d4529 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // 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 eb909a0fd9..7649492627 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.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +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.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= -cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= +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= @@ -118,13 +118,12 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= +cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= @@ -182,8 +181,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.28.1 h1:F5QDG5ChchaAVQhINh24U99OWHURqrW8OmQcGKXcbgI= -cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -768,8 +767,8 @@ 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.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +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= @@ -792,8 +791,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.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +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= @@ -1702,8 +1701,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2021,8 +2020,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.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +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= @@ -2142,12 +2141,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-20230629202037-9506855d4529 h1:9JucMWR7sPvCxUFd6UsOUNmA5kCcWOfORaT3tpAsKQs= -google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e h1:AZX1ra8YbFMSb7+1pI8S9v4rrgRR7jU1FmuFSSjTVcQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 h1:2FZP5XuJY9zQyGM5N0rtovnoXjiMUEIUMvw0m9wlpLc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= +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= @@ -2190,8 +2189,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From f865e4c1ab22d5fa9843a6a6aaa528fe3be57518 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:54:52 +0000 Subject: [PATCH 05/14] build(deps): Bump github.com/mgechev/revive from 1.3.3 to 1.3.4 (#2252) Bumps [github.com/mgechev/revive](https://github.com/mgechev/revive) from 1.3.3 to 1.3.4. - [Release notes](https://github.com/mgechev/revive/releases) - [Changelog](https://github.com/mgechev/revive/blob/master/.goreleaser.yml) - [Commits](https://github.com/mgechev/revive/compare/v1.3.3...v1.3.4) --- updated-dependencies: - dependency-name: github.com/mgechev/revive dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 16 ++++++++-------- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index db5d4e2e8f..d503df208c 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/golangci/golangci-lint v1.54.2 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/mgechev/revive v1.3.3 + github.com/mgechev/revive v1.3.4 github.com/ory/dockertest/v3 v3.10.0 github.com/osmosis-labs/bech32-ibc v0.3.1 github.com/prometheus/client_golang v1.16.0 @@ -86,7 +86,7 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect - github.com/chavacava/garif v0.0.0-20230608123814-4bd63c2919ab // indirect + github.com/chavacava/garif v0.1.0 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect @@ -303,16 +303,16 @@ require ( go.uber.org/goleak v1.1.12 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.12.0 // indirect + golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.14.0 // indirect + golang.org/x/net v0.15.0 // indirect golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/term v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect - golang.org/x/tools v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + 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.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 7649492627..c5e1c929d4 100644 --- a/go.sum +++ b/go.sum @@ -374,8 +374,8 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= -github.com/chavacava/garif v0.0.0-20230608123814-4bd63c2919ab h1:5JxePczlyGAtj6R1MUEFZ/UFud6FfsOejq7xLC2ZIb0= -github.com/chavacava/garif v0.0.0-20230608123814-4bd63c2919ab/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= +github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= +github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= @@ -1060,8 +1060,8 @@ github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwg github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 h1:zpIH83+oKzcpryru8ceC6BxnoG8TBrhgAvRg8obzup0= github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/revive v1.3.3 h1:GUWzV3g185agbHN4ZdaQvR6zrLVYTUSA2ktvIinivK0= -github.com/mgechev/revive v1.3.3/go.mod h1:NhpOtVtDbjYNDj697eDUBTobijCDHQKar4HDKc0TuTo= +github.com/mgechev/revive v1.3.4 h1:k/tO3XTaWY4DEHal9tWBkkUMJYO/dLDVyMmAQxmIMDc= +github.com/mgechev/revive v1.3.4/go.mod h1:W+pZCMu9qj8Uhfs1iJMQsEFLRozUfvwFwqVvRbSNLVw= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= @@ -1548,8 +1548,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y 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.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1674,8 +1674,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1839,8 +1839,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1848,8 +1848,8 @@ golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1863,8 +1863,8 @@ 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= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1954,8 +1954,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= -golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 861208d7244adf13b43b68fdf42cdfeb0f09e4ec Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Mon, 18 Sep 2023 18:49:36 +0200 Subject: [PATCH 06/14] feat(oracle): include timestamp into save exchange rates (#2249) * feat(oracle): include timestamp into save exchange rates * update implementations * tests * add comment * linter * leverage test * Update tests and String * keys_tests * cosmetic * ExchangeRate stringer * cli test * abci test --- proto/umee/oracle/v1/genesis.proto | 1 + proto/umee/oracle/v1/oracle.proto | 16 +- x/leverage/keeper/oracle.go | 11 +- x/leverage/keeper/oracle_test.go | 7 +- x/leverage/types/expected_types.go | 4 +- x/oracle/abci.go | 2 +- x/oracle/abci_test.go | 16 +- x/oracle/keeper/grpc_query.go | 4 +- x/oracle/keeper/keeper.go | 40 ++-- x/oracle/keeper/keeper_test.go | 24 +- x/oracle/types/genesis.pb.go | 5 +- x/oracle/types/keys.go | 3 +- x/oracle/types/keys_test.go | 31 +-- x/oracle/types/msgs_test.go | 4 +- x/oracle/types/oracle.pb.go | 346 +++++++++++++++++++++++------ x/oracle/types/vote.go | 23 +- x/oracle/types/vote_test.go | 24 +- 17 files changed, 397 insertions(+), 164 deletions(-) diff --git a/proto/umee/oracle/v1/genesis.proto b/proto/umee/oracle/v1/genesis.proto index 9b0ae78851..57e1c76f55 100644 --- a/proto/umee/oracle/v1/genesis.proto +++ b/proto/umee/oracle/v1/genesis.proto @@ -13,6 +13,7 @@ message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; repeated FeederDelegation feeder_delegations = 2 [(gogoproto.nullable) = false]; + // TODO: need to update this to save data with timestamp repeated ExchangeRateTuple exchange_rates = 3 [ (gogoproto.castrepeated) = "ExchangeRateTuples", (gogoproto.nullable) = false diff --git a/proto/umee/oracle/v1/oracle.proto b/proto/umee/oracle/v1/oracle.proto index 46a9f2dfcb..8cecd4a33b 100644 --- a/proto/umee/oracle/v1/oracle.proto +++ b/proto/umee/oracle/v1/oracle.proto @@ -79,7 +79,6 @@ message AvgCounterParams { // Denom - the object to hold configurations of each denom message Denom { option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; string base_denom = 1 [(gogoproto.moretags) = "yaml:\"base_denom\""]; @@ -94,7 +93,6 @@ message Denom { // rate}{denom},...,{exchange rate}{denom}:{voter}") message AggregateExchangeRatePrevote { option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; @@ -106,7 +104,6 @@ message AggregateExchangeRatePrevote { // the exchange rates of USD denominated in various assets. message AggregateExchangeRateVote { option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; repeated ExchangeRateTuple exchange_rate_tuples = 1 [ @@ -121,7 +118,6 @@ message AggregateExchangeRateVote { // ExchangeRateTuple - struct to store interpreted exchange rates data to store message ExchangeRateTuple { option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; @@ -148,3 +144,15 @@ message AvgCounter { // Unix timestamp when the first price was aggregated in the counter google.protobuf.Timestamp start = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } + +// ExchangeRate stores exchange rate with timestamp +message ExchangeRate { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + + string rate = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/x/leverage/keeper/oracle.go b/x/leverage/keeper/oracle.go index 871972b38d..7173c5cc43 100644 --- a/x/leverage/keeper/oracle.go +++ b/x/leverage/keeper/oracle.go @@ -31,7 +31,8 @@ func (k Keeper) TokenPrice(ctx sdk.Context, baseDenom string, mode types.PriceMo mode = types.PriceModeSpot } - var price, spotPrice, historicPrice sdk.Dec + var price, historicPrice sdk.Dec + var spotPrice oracletypes.ExchangeRate if mode != types.PriceModeHistoric { // spot price is required for modes other than historic spotPrice, err = k.oracleKeeper.GetExchangeRate(ctx, t.SymbolDenom) @@ -56,15 +57,17 @@ func (k Keeper) TokenPrice(ctx sdk.Context, baseDenom string, mode types.PriceMo } } + // TODO: need to use spotPrice.Timestamp to make a decision about the price + switch mode { case types.PriceModeSpot: - price = spotPrice + price = spotPrice.Rate case types.PriceModeHistoric: price = historicPrice case types.PriceModeHigh: - price = sdk.MaxDec(spotPrice, historicPrice) + price = sdk.MaxDec(spotPrice.Rate, historicPrice) case types.PriceModeLow: - price = sdk.MinDec(spotPrice, historicPrice) + price = sdk.MinDec(spotPrice.Rate, historicPrice) default: return sdk.ZeroDec(), t.Exponent, types.ErrInvalidPriceMode.Wrapf("%d", mode) } diff --git a/x/leverage/keeper/oracle_test.go b/x/leverage/keeper/oracle_test.go index d2e67013df..3cdcdd225b 100644 --- a/x/leverage/keeper/oracle_test.go +++ b/x/leverage/keeper/oracle_test.go @@ -43,14 +43,15 @@ func (m *mockOracleKeeper) MedianOfHistoricMedians(ctx sdk.Context, denom string return p, uint32(numStamps), nil } -func (m *mockOracleKeeper) GetExchangeRate(_ sdk.Context, denom string) (sdk.Dec, error) { +func (m *mockOracleKeeper) GetExchangeRate(_ sdk.Context, denom string) (oracletypes.ExchangeRate, error) { p, ok := m.symbolExchangeRates[denom] if !ok { // This error matches oracle behavior on missing asset price - return sdk.ZeroDec(), oracletypes.ErrUnknownDenom.Wrap(denom) + return oracletypes.ExchangeRate{}, oracletypes.ErrUnknownDenom.Wrap(denom) } - return p, nil + // TODO: add timestamp + return oracletypes.ExchangeRate{Rate: p}, nil } // Clear clears a denom from the mock oracle, simulating an outage. diff --git a/x/leverage/types/expected_types.go b/x/leverage/types/expected_types.go index 947383f288..5a1e276f97 100644 --- a/x/leverage/types/expected_types.go +++ b/x/leverage/types/expected_types.go @@ -3,6 +3,8 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + oracle "github.com/umee-network/umee/v6/x/oracle/types" ) // AccountKeeper defines the expected account keeper used for leverage simulations (noalias) @@ -31,6 +33,6 @@ type BankKeeper interface { // OracleKeeper defines the expected x/oracle keeper interface. type OracleKeeper interface { - GetExchangeRate(ctx sdk.Context, denom string) (sdk.Dec, error) + GetExchangeRate(ctx sdk.Context, denom string) (oracle.ExchangeRate, error) MedianOfHistoricMedians(ctx sdk.Context, denom string, numStamps uint64) (sdk.Dec, uint32, error) } diff --git a/x/oracle/abci.go b/x/oracle/abci.go index 891aa8078a..28f9d73461 100644 --- a/x/oracle/abci.go +++ b/x/oracle/abci.go @@ -77,8 +77,8 @@ func CalcPrices(ctx sdk.Context, params types.Params, k keeper.Keeper) error { if err != nil { return err } - k.SetExchangeRateWithEvent(ctx, denom, exchangeRate) + if k.IsPeriodLastBlock(ctx, params.HistoricStampPeriod) { k.AddHistoricPrice(ctx, denom, exchangeRate) } diff --git a/x/oracle/abci_test.go b/x/oracle/abci_test.go index 6bb4e8581b..6b57cb318c 100644 --- a/x/oracle/abci_test.go +++ b/x/oracle/abci_test.go @@ -6,7 +6,6 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" @@ -157,7 +156,8 @@ func (s *IntegrationTestSuite) TestEndBlockerVoteThreshold() { for _, denom := range app.OracleKeeper.AcceptList(ctx) { rate, err := app.OracleKeeper.GetExchangeRate(ctx, denom.SymbolDenom) s.Require().NoError(err) - s.Require().Equal(sdk.MustNewDecFromStr("1.0"), rate) + s.Require().Equal(types.ExchangeRate{Rate: sdk.OneDec(), Timestamp: ctx.BlockTime()}, + rate) } // Test: only val2 votes (has 39% vote power). @@ -176,8 +176,8 @@ func (s *IntegrationTestSuite) TestEndBlockerVoteThreshold() { for _, denom := range app.OracleKeeper.AcceptList(ctx) { rate, err := app.OracleKeeper.GetExchangeRate(ctx, denom.SymbolDenom) - s.Require().ErrorIs(err, sdkerrors.Wrap(types.ErrUnknownDenom, denom.SymbolDenom)) - s.Require().Equal(sdk.ZeroDec(), rate) + s.Require().ErrorIs(err, types.ErrUnknownDenom.Wrap(denom.SymbolDenom)) + s.Require().Equal(types.ExchangeRate{}, rate) } // Test: val2 and val3 votes. @@ -199,7 +199,7 @@ func (s *IntegrationTestSuite) TestEndBlockerVoteThreshold() { for _, denom := range app.OracleKeeper.AcceptList(ctx) { rate, err := app.OracleKeeper.GetExchangeRate(ctx, denom.SymbolDenom) s.Require().NoError(err) - s.Require().Equal(sdk.MustNewDecFromStr("0.5"), rate) + s.Require().Equal(types.ExchangeRate{Rate: sdk.NewDecWithPrec(5, 1), Timestamp: ctx.BlockTime()}, rate) } // TODO: check reward distribution @@ -236,10 +236,10 @@ func (s *IntegrationTestSuite) TestEndBlockerVoteThreshold() { rate, err := app.OracleKeeper.GetExchangeRate(ctx, "umee") s.Require().NoError(err) - s.Require().Equal(sdk.MustNewDecFromStr("1.0"), rate) + s.Require().Equal(types.ExchangeRate{Rate: sdk.OneDec(), Timestamp: ctx.BlockTime()}, rate) rate, err = app.OracleKeeper.GetExchangeRate(ctx, "atom") - s.Require().ErrorIs(err, sdkerrors.Wrap(types.ErrUnknownDenom, "atom")) - s.Require().Equal(sdk.ZeroDec(), rate) + s.Require().ErrorIs(err, types.ErrUnknownDenom.Wrap("atom")) + s.Require().Equal(types.ExchangeRate{}, rate) } var exchangeRates = map[string][]sdk.Dec{ diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 795942eadf..7d297ae7c7 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -52,6 +52,8 @@ func (q querier) ExchangeRates( ctx := sdk.UnwrapSDKContext(goCtx) + // TODO: need to decide if we want to return DecCoins here or list of ExchangeRates with denoms (we + // need the latter for genesis anyway) var exchangeRates sdk.DecCoins if len(req.Denom) > 0 { @@ -60,7 +62,7 @@ func (q querier) ExchangeRates( return nil, err } - exchangeRates = exchangeRates.Add(sdk.NewDecCoinFromDec(req.Denom, exchangeRate)) + exchangeRates = exchangeRates.Add(sdk.NewDecCoinFromDec(req.Denom, exchangeRate.Rate)) } else { q.IterateExchangeRates(ctx, func(denom string, rate sdk.Dec) (stop bool) { exchangeRates = exchangeRates.Add(sdk.NewDecCoinFromDec(denom, rate)) diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index e1bf4c2f35..35ccd7e1eb 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "strings" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -12,7 +11,9 @@ import ( gogotypes "github.com/gogo/protobuf/types" "github.com/tendermint/tendermint/libs/log" + "github.com/umee-network/umee/v6/util" "github.com/umee-network/umee/v6/util/sdkutil" + "github.com/umee-network/umee/v6/util/store" "github.com/umee-network/umee/v6/x/oracle/types" ) @@ -72,22 +73,18 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { // GetExchangeRate gets the consensus exchange rate of USD denominated in the // denom asset from the store. -func (k Keeper) GetExchangeRate(ctx sdk.Context, symbol string) (sdk.Dec, error) { - store := ctx.KVStore(k.storeKey) - symbol = strings.ToUpper(symbol) - b := store.Get(types.KeyExchangeRate(symbol)) - if b == nil { - return sdk.ZeroDec(), types.ErrUnknownDenom.Wrap(symbol) +func (k Keeper) GetExchangeRate(ctx sdk.Context, symbol string) (types.ExchangeRate, error) { + v := store.GetValue[*types.ExchangeRate](ctx.KVStore(k.storeKey), types.KeyExchangeRate(symbol), + "exchange_rate") + if v == nil { + return types.ExchangeRate{}, types.ErrUnknownDenom.Wrap(symbol) } - - decProto := sdk.DecProto{} - k.cdc.MustUnmarshal(b, &decProto) - - return decProto.Dec, nil + return *v, nil } // GetExchangeRateBase gets the consensus exchange rate of an asset // in the base denom (e.g. ATOM -> uatom) +// TODO: needs to return timestamp as well func (k Keeper) GetExchangeRateBase(ctx sdk.Context, denom string) (sdk.Dec, error) { var symbol string var exponent uint64 @@ -110,16 +107,16 @@ func (k Keeper) GetExchangeRateBase(ctx sdk.Context, denom string) (sdk.Dec, err } powerReduction := ten.Power(exponent) - return exchangeRate.Quo(powerReduction), nil + return exchangeRate.Rate.Quo(powerReduction), nil } // SetExchangeRate sets the consensus exchange rate of USD denominated in the // denom asset to the store. -func (k Keeper) SetExchangeRate(ctx sdk.Context, denom string, exchangeRate sdk.Dec) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&sdk.DecProto{Dec: exchangeRate}) - denom = strings.ToUpper(denom) - store.Set(types.KeyExchangeRate(denom), bz) +func (k Keeper) SetExchangeRate(ctx sdk.Context, denom string, rate sdk.Dec) { + key := types.KeyExchangeRate(denom) + val := types.ExchangeRate{Rate: rate, Timestamp: ctx.BlockTime()} + err := store.SetValue(ctx.KVStore(k.storeKey), key, &val, "exchange_rate") + util.Panic(err) } // SetExchangeRateWithEvent sets an consensus @@ -132,6 +129,7 @@ func (k Keeper) SetExchangeRateWithEvent(ctx sdk.Context, denom string, exchange } // IterateExchangeRates iterates over all USD rates in the store. +// TODO: handler should use ExchangeRate type rather than Dec func (k Keeper) IterateExchangeRates(ctx sdk.Context, handler func(string, sdk.Dec) bool) { store := ctx.KVStore(k.storeKey) iter := sdk.KVStorePrefixIterator(store, types.KeyPrefixExchangeRate) @@ -141,10 +139,10 @@ func (k Keeper) IterateExchangeRates(ctx sdk.Context, handler func(string, sdk.D for ; iter.Valid(); iter.Next() { key := iter.Key() denom := string(key[prefixLen : len(key)-1]) // -1 to remove the null suffix - dp := sdk.DecProto{} - k.cdc.MustUnmarshal(iter.Value(), &dp) + var er types.ExchangeRate + k.cdc.MustUnmarshal(iter.Value(), &er) - if handler(denom, dp.Dec) { + if handler(denom, er.Rate) { break } } diff --git a/x/oracle/keeper/keeper_test.go b/x/oracle/keeper/keeper_test.go index a8d4dc043e..2d2d8d56d9 100644 --- a/x/oracle/keeper/keeper_test.go +++ b/x/oracle/keeper/keeper_test.go @@ -205,11 +205,11 @@ func (s *IntegrationTestSuite) TestAggregateExchangeRateVoteError() { } func (s *IntegrationTestSuite) TestSetExchangeRateWithEvent() { - app, ctx := s.app, s.ctx - app.OracleKeeper.SetExchangeRateWithEvent(ctx, displayDenom, sdk.OneDec()) - rate, err := app.OracleKeeper.GetExchangeRate(ctx, displayDenom) + v := sdk.OneDec() + s.app.OracleKeeper.SetExchangeRateWithEvent(s.ctx, displayDenom, v) + rate, err := s.app.OracleKeeper.GetExchangeRate(s.ctx, displayDenom) s.Require().NoError(err) - s.Require().Equal(rate, sdk.OneDec()) + s.Require().Equal(rate, types.ExchangeRate{Rate: v, Timestamp: s.ctx.BlockTime()}) } func (s *IntegrationTestSuite) TestGetExchangeRate_InvalidDenom() { @@ -227,17 +227,17 @@ func (s *IntegrationTestSuite) TestGetExchangeRate_NotSet() { } func (s *IntegrationTestSuite) TestGetExchangeRate_Valid() { - app, ctx := s.app, s.ctx - - app.OracleKeeper.SetExchangeRate(ctx, displayDenom, sdk.OneDec()) - rate, err := app.OracleKeeper.GetExchangeRate(ctx, displayDenom) + v := sdk.OneDec() + expected := types.ExchangeRate{Rate: v, Timestamp: s.ctx.BlockTime()} + s.app.OracleKeeper.SetExchangeRate(s.ctx, displayDenom, v) + rate, err := s.app.OracleKeeper.GetExchangeRate(s.ctx, displayDenom) s.Require().NoError(err) - s.Require().Equal(rate, sdk.OneDec()) + s.Require().Equal(rate, expected) - app.OracleKeeper.SetExchangeRate(ctx, strings.ToLower(displayDenom), sdk.OneDec()) - rate, err = app.OracleKeeper.GetExchangeRate(ctx, displayDenom) + s.app.OracleKeeper.SetExchangeRate(s.ctx, strings.ToLower(displayDenom), sdk.OneDec()) + rate, err = s.app.OracleKeeper.GetExchangeRate(s.ctx, displayDenom) s.Require().NoError(err) - s.Require().Equal(rate, sdk.OneDec()) + s.Require().Equal(rate, expected) } func (s *IntegrationTestSuite) TestGetExchangeRateBase() { diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index e8b352eddb..b4862a32bf 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -25,8 +25,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the oracle module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - FeederDelegations []FeederDelegation `protobuf:"bytes,2,rep,name=feeder_delegations,json=feederDelegations,proto3" json:"feeder_delegations"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + FeederDelegations []FeederDelegation `protobuf:"bytes,2,rep,name=feeder_delegations,json=feederDelegations,proto3" json:"feeder_delegations"` + // TODO: need to update this to save data with timestamp ExchangeRates ExchangeRateTuples `protobuf:"bytes,3,rep,name=exchange_rates,json=exchangeRates,proto3,castrepeated=ExchangeRateTuples" json:"exchange_rates"` MissCounters []MissCounter `protobuf:"bytes,4,rep,name=miss_counters,json=missCounters,proto3" json:"miss_counters"` AggregateExchangeRatePrevotes []AggregateExchangeRatePrevote `protobuf:"bytes,5,rep,name=aggregate_exchange_rate_prevotes,json=aggregateExchangeRatePrevotes,proto3" json:"aggregate_exchange_rate_prevotes"` diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go index 5dae6ef9ef..53359f0f36 100644 --- a/x/oracle/types/keys.go +++ b/x/oracle/types/keys.go @@ -2,6 +2,7 @@ package types import ( "encoding/binary" + "strings" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" @@ -33,7 +34,7 @@ var ( // KeyExchangeRate - stored by *denom* func KeyExchangeRate(denom string) []byte { // append 0 for null-termination - return util.ConcatBytes(1, KeyPrefixExchangeRate, []byte(denom)) + return util.ConcatBytes(1, KeyPrefixExchangeRate, []byte(strings.ToUpper(denom))) } // KeyFeederDelegation - stored by *Validator* address diff --git a/x/oracle/types/keys_test.go b/x/oracle/types/keys_test.go index 1475365376..e2f0c527c6 100644 --- a/x/oracle/types/keys_test.go +++ b/x/oracle/types/keys_test.go @@ -1,11 +1,10 @@ package types import ( - "fmt" "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "gotest.tools/v3/assert" + "github.com/stretchr/testify/assert" appparams "github.com/umee-network/umee/v6/app/params" ) @@ -17,24 +16,24 @@ func TestKeyExchangeRate(t *testing.T) { expectedKey []byte }{ { + // converts uumee to UUMEE denom: appparams.BondDenom, - expectedKey: []byte{0x1, 0x75, 0x75, 0x6d, 0x65, 0x65, 0x0}, + expectedKey: []byte{0x1, 0x55, 0x55, 0x4d, 0x45, 0x45, 0x0}, }, { + // converts "Ibc" to "IBC" denom: IbcDenomLuna, - expectedKey: []byte{0x1, 0x69, 0x62, 0x63, 0x2f, 0x30, 0x45, 0x46, 0x31, 0x35, 0x44, 0x46, 0x32, 0x46, 0x30, 0x32, 0x34, 0x38, 0x30, 0x41, 0x44, 0x45, 0x30, 0x42, 0x42, 0x36, 0x45, 0x38, 0x35, 0x44, 0x39, 0x45, 0x42, 0x42, 0x35, 0x44, 0x41, 0x45, 0x41, 0x32, 0x38, 0x33, 0x36, 0x44, 0x33, 0x38, 0x36, 0x30, 0x45, 0x39, 0x46, 0x39, 0x37, 0x46, 0x39, 0x41, 0x41, 0x44, 0x45, 0x34, 0x46, 0x35, 0x37, 0x41, 0x33, 0x31, 0x41, 0x41, 0x30, 0x0}, + expectedKey: []byte{0x1, 0x49, 0x42, 0x43, 0x2f, 0x30, 0x45, 0x46, 0x31, 0x35, 0x44, 0x46, 0x32, 0x46, 0x30, 0x32, 0x34, 0x38, 0x30, 0x41, 0x44, 0x45, 0x30, 0x42, 0x42, 0x36, 0x45, 0x38, 0x35, 0x44, 0x39, 0x45, 0x42, 0x42, 0x35, 0x44, 0x41, 0x45, 0x41, 0x32, 0x38, 0x33, 0x36, 0x44, 0x33, 0x38, 0x36, 0x30, 0x45, 0x39, 0x46, 0x39, 0x37, 0x46, 0x39, 0x41, 0x41, 0x44, 0x45, 0x34, 0x46, 0x35, 0x37, 0x41, 0x33, 0x31, 0x41, 0x41, 0x30, 0x0}, }, { denom: IbcDenomAtom, - expectedKey: []byte{0x1, 0x69, 0x62, 0x63, 0x2f, 0x32, 0x37, 0x33, 0x39, 0x34, 0x46, 0x42, 0x30, 0x39, 0x32, 0x44, 0x32, 0x45, 0x43, 0x43, 0x44, 0x35, 0x36, 0x31, 0x32, 0x33, 0x43, 0x37, 0x34, 0x46, 0x33, 0x36, 0x45, 0x34, 0x43, 0x31, 0x46, 0x39, 0x32, 0x36, 0x30, 0x30, 0x31, 0x43, 0x45, 0x41, 0x44, 0x41, 0x39, 0x43, 0x41, 0x39, 0x37, 0x45, 0x41, 0x36, 0x32, 0x32, 0x42, 0x32, 0x35, 0x46, 0x34, 0x31, 0x45, 0x35, 0x45, 0x42, 0x32, 0x0}, + expectedKey: []byte{0x1, 0x49, 0x42, 0x43, 0x2f, 0x32, 0x37, 0x33, 0x39, 0x34, 0x46, 0x42, 0x30, 0x39, 0x32, 0x44, 0x32, 0x45, 0x43, 0x43, 0x44, 0x35, 0x36, 0x31, 0x32, 0x33, 0x43, 0x37, 0x34, 0x46, 0x33, 0x36, 0x45, 0x34, 0x43, 0x31, 0x46, 0x39, 0x32, 0x36, 0x30, 0x30, 0x31, 0x43, 0x45, 0x41, 0x44, 0x41, 0x39, 0x43, 0x41, 0x39, 0x37, 0x45, 0x41, 0x36, 0x32, 0x32, 0x42, 0x32, 0x35, 0x46, 0x34, 0x31, 0x45, 0x35, 0x45, 0x42, 0x32, 0x0}, }, } for i, testCase := range testCases { actualKey := KeyExchangeRate(testCase.denom) - t.Run(fmt.Sprintf("test %d - expected key: %s should be the same as actual key: %s", i, testCase.expectedKey, actualKey), func(t *testing.T) { - assert.DeepEqual(t, testCase.expectedKey, actualKey) - }) + assert.Equal(t, testCase.expectedKey, actualKey, "test: %v", i) } } @@ -52,9 +51,7 @@ func TestKeyFeederDelegation(t *testing.T) { for i, testCase := range testCases { actualKey := KeyFeederDelegation(testCase.val) - t.Run(fmt.Sprintf("test %d - expected key: %s should be the same as actual key: %s", i, testCase.expectedKey, actualKey), func(t *testing.T) { - assert.DeepEqual(t, testCase.expectedKey, actualKey) - }) + assert.Equal(t, testCase.expectedKey, actualKey, "test: %v", i) } } @@ -72,9 +69,7 @@ func TestKeyMissCounter(t *testing.T) { for i, testCase := range testCases { actualKey := KeyMissCounter(testCase.val) - t.Run(fmt.Sprintf("test %d - expected key: %s should be the same as actual key: %s", i, testCase.expectedKey, actualKey), func(t *testing.T) { - assert.DeepEqual(t, testCase.expectedKey, actualKey) - }) + assert.Equal(t, testCase.expectedKey, actualKey, "test: %v", i) } } @@ -92,9 +87,7 @@ func TestKeyAggregateExchangeRatePrevote(t *testing.T) { for i, testCase := range testCases { actualKey := KeyAggregateExchangeRatePrevote(testCase.val) - t.Run(fmt.Sprintf("test %d - expected key: %s should be the same as actual key: %s", i, testCase.expectedKey, actualKey), func(t *testing.T) { - assert.DeepEqual(t, testCase.expectedKey, actualKey) - }) + assert.Equal(t, testCase.expectedKey, actualKey, "test: %v", i) } } @@ -112,9 +105,7 @@ func TestKeyAggregateExchangeRateVote(t *testing.T) { for i, testCase := range testCases { actualKey := KeyAggregateExchangeRateVote(testCase.val) - t.Run(fmt.Sprintf("test %d - expected key: %s should be the same as actual key: %s", i, testCase.expectedKey, actualKey), func(t *testing.T) { - assert.DeepEqual(t, testCase.expectedKey, actualKey) - }) + assert.Equal(t, testCase.expectedKey, actualKey, "test: %v", i) } } diff --git a/x/oracle/types/msgs_test.go b/x/oracle/types/msgs_test.go index e8051eff39..dbc7ab7c7a 100644 --- a/x/oracle/types/msgs_test.go +++ b/x/oracle/types/msgs_test.go @@ -122,9 +122,9 @@ func TestMsgAggregateExchangeRateVote(t *testing.T) { for i, tc := range tests { msg := NewMsgAggregateExchangeRateVote(tc.salt, tc.exchangeRates, tc.feeder, sdk.ValAddress(tc.validator)) if tc.expectPass { - assert.NilError(t, msg.ValidateBasic(), "test: %v", i) + assert.NilError(t, msg.ValidateBasic(), "test: %d", i) } else { - assert.ErrorContains(t, msg.ValidateBasic(), tc.expectedErrorMsg) + assert.ErrorContains(t, msg.ValidateBasic(), "", "test", i, "expected_err", tc.expectedErrorMsg) } } } diff --git a/x/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go index 25abff1771..4d51ad8e5b 100644 --- a/x/oracle/types/oracle.pb.go +++ b/x/oracle/types/oracle.pb.go @@ -330,6 +330,44 @@ func (m *AvgCounter) XXX_DiscardUnknown() { var xxx_messageInfo_AvgCounter proto.InternalMessageInfo +// ExchangeRate stores exchange rate with timestamp +type ExchangeRate struct { + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` + Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"` +} + +func (m *ExchangeRate) Reset() { *m = ExchangeRate{} } +func (*ExchangeRate) ProtoMessage() {} +func (*ExchangeRate) Descriptor() ([]byte, []int) { + return fileDescriptor_8893c9e0e94ceb54, []int{7} +} +func (m *ExchangeRate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExchangeRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExchangeRate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExchangeRate) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExchangeRate.Merge(m, src) +} +func (m *ExchangeRate) XXX_Size() int { + return m.Size() +} +func (m *ExchangeRate) XXX_DiscardUnknown() { + xxx_messageInfo_ExchangeRate.DiscardUnknown(m) +} + +var xxx_messageInfo_ExchangeRate proto.InternalMessageInfo + func init() { proto.RegisterType((*Params)(nil), "umee.oracle.v1.Params") proto.RegisterType((*AvgCounterParams)(nil), "umee.oracle.v1.AvgCounterParams") @@ -338,78 +376,81 @@ func init() { proto.RegisterType((*AggregateExchangeRateVote)(nil), "umee.oracle.v1.AggregateExchangeRateVote") proto.RegisterType((*ExchangeRateTuple)(nil), "umee.oracle.v1.ExchangeRateTuple") proto.RegisterType((*AvgCounter)(nil), "umee.oracle.v1.AvgCounter") + proto.RegisterType((*ExchangeRate)(nil), "umee.oracle.v1.ExchangeRate") } func init() { proto.RegisterFile("umee/oracle/v1/oracle.proto", fileDescriptor_8893c9e0e94ceb54) } var fileDescriptor_8893c9e0e94ceb54 = []byte{ - // 1052 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0x5e, 0x93, 0x26, 0xdd, 0x9d, 0x4d, 0xda, 0xc4, 0xd9, 0x80, 0x9b, 0xa0, 0x75, 0x6a, 0x44, - 0xc9, 0x81, 0xda, 0x34, 0xe5, 0x87, 0xd8, 0x13, 0x35, 0xa1, 0x5c, 0x5a, 0x29, 0x72, 0xa3, 0x22, - 0x71, 0xb1, 0x66, 0xed, 0x89, 0x77, 0x14, 0xdb, 0xb3, 0x9a, 0x19, 0x6f, 0x92, 0x0b, 0xe7, 0x9e, - 0x50, 0x8f, 0x3d, 0xe6, 0xc4, 0x81, 0x3b, 0x88, 0x3f, 0x21, 0xc7, 0x1e, 0x11, 0x07, 0x17, 0x92, - 0x0b, 0xe2, 0x84, 0xf6, 0x2f, 0x40, 0xf3, 0xc3, 0x59, 0x6f, 0x36, 0x42, 0x44, 0x9c, 0xd6, 0x6f, - 0xbe, 0xf7, 0xde, 0xf7, 0xbd, 0x37, 0x6f, 0x9e, 0x16, 0x6c, 0x14, 0x19, 0x42, 0x1e, 0xa1, 0x30, - 0x4a, 0x91, 0x37, 0x7a, 0xa0, 0xbf, 0xdc, 0x21, 0x25, 0x9c, 0x98, 0xb7, 0x04, 0xe8, 0xea, 0xa3, - 0xd1, 0x83, 0xf5, 0x4e, 0x42, 0x12, 0x22, 0x21, 0x4f, 0x7c, 0x29, 0xaf, 0x75, 0x3b, 0x21, 0x24, - 0x49, 0x91, 0x27, 0xad, 0x7e, 0xb1, 0xef, 0x71, 0x9c, 0x21, 0xc6, 0x61, 0x36, 0xd4, 0x0e, 0xdd, - 0xcb, 0x0e, 0x71, 0x41, 0x21, 0xc7, 0x24, 0x57, 0xb8, 0x53, 0xde, 0x04, 0x0b, 0xbb, 0x90, 0xc2, - 0x8c, 0x99, 0x9f, 0x81, 0xf6, 0x88, 0x70, 0x14, 0x0e, 0x11, 0xc5, 0x24, 0xb6, 0x8c, 0x4d, 0x63, - 0xeb, 0x86, 0xff, 0xf6, 0xb8, 0xb4, 0xcd, 0x63, 0x98, 0xa5, 0x3d, 0xa7, 0x06, 0x3a, 0x01, 0x10, - 0xd6, 0xae, 0x34, 0xcc, 0x1c, 0xdc, 0x92, 0x18, 0x1f, 0x50, 0xc4, 0x06, 0x24, 0x8d, 0xad, 0xb7, - 0x36, 0x8d, 0xad, 0x96, 0xff, 0xf5, 0x69, 0x69, 0x37, 0x7e, 0x2b, 0xed, 0x7b, 0x09, 0xe6, 0x83, - 0xa2, 0xef, 0x46, 0x24, 0xf3, 0x22, 0xc2, 0x32, 0xc2, 0xf4, 0xcf, 0x7d, 0x16, 0x1f, 0x78, 0xfc, - 0x78, 0x88, 0x98, 0xbb, 0x83, 0xa2, 0x71, 0x69, 0xaf, 0xd5, 0x98, 0x2e, 0xb2, 0x39, 0xc1, 0x92, - 0x38, 0xd8, 0xab, 0x6c, 0x13, 0x81, 0x36, 0x45, 0x87, 0x90, 0xc6, 0x61, 0x1f, 0xe6, 0xb1, 0x35, - 0x27, 0xc9, 0x76, 0xae, 0x4d, 0xa6, 0xcb, 0xaa, 0xa5, 0x72, 0x02, 0xa0, 0x2c, 0x1f, 0xe6, 0xb1, - 0x19, 0x81, 0x75, 0x8d, 0xc5, 0x98, 0x71, 0x8a, 0xfb, 0x85, 0xe8, 0x5b, 0x78, 0x88, 0xf3, 0x98, - 0x1c, 0x5a, 0x37, 0x64, 0x7b, 0xde, 0x1f, 0x97, 0xf6, 0xdd, 0xa9, 0x3c, 0x57, 0xf8, 0x3a, 0x81, - 0xa5, 0xc0, 0x9d, 0x1a, 0xf6, 0x8d, 0x84, 0xcc, 0x10, 0xb4, 0x61, 0x14, 0xa1, 0x21, 0x0f, 0x53, - 0xcc, 0xb8, 0x35, 0xbf, 0x39, 0xb7, 0xd5, 0xde, 0x5e, 0x73, 0xa7, 0x2f, 0xdf, 0xdd, 0x41, 0x39, - 0xc9, 0xfc, 0x0f, 0x44, 0x89, 0x13, 0xe1, 0xb5, 0x38, 0xe7, 0xc7, 0x37, 0x76, 0x4b, 0x3a, 0x3d, - 0xc1, 0x8c, 0x07, 0x40, 0x41, 0xe2, 0x5b, 0x5c, 0x0e, 0x4b, 0x21, 0x1b, 0x84, 0xfb, 0x14, 0x46, - 0x82, 0xd8, 0x5a, 0xf8, 0x7f, 0x97, 0x33, 0x9d, 0xcd, 0x09, 0x96, 0xe4, 0xc1, 0x63, 0x6d, 0x9b, - 0x3d, 0xb0, 0xa8, 0x3c, 0x74, 0x9f, 0x6e, 0xca, 0x3e, 0xbd, 0x33, 0x2e, 0xed, 0xd5, 0x7a, 0x7c, - 0xd5, 0x99, 0xb6, 0x34, 0x75, 0x33, 0xbe, 0x03, 0x9d, 0x0c, 0xe7, 0xe1, 0x08, 0xa6, 0x38, 0x16, - 0x93, 0x56, 0xe5, 0x68, 0x4a, 0xc5, 0x4f, 0xaf, 0xad, 0x78, 0x43, 0x31, 0x5e, 0x95, 0xd3, 0x09, - 0x56, 0x32, 0x9c, 0x3f, 0x17, 0xa7, 0xbb, 0x88, 0x6a, 0xfe, 0x6d, 0xb0, 0x36, 0xc0, 0x8c, 0x13, - 0x8a, 0xa3, 0x50, 0x3e, 0xa2, 0xea, 0x2d, 0xb4, 0x44, 0x11, 0xc1, 0x6a, 0x05, 0x3e, 0x13, 0x98, - 0x1e, 0x7e, 0x17, 0xac, 0x66, 0x28, 0xc6, 0x30, 0x9f, 0x8e, 0x00, 0x32, 0x62, 0x45, 0x41, 0x75, - 0xff, 0x8f, 0x40, 0x27, 0x83, 0x47, 0x38, 0x2b, 0xb2, 0x70, 0x48, 0x71, 0x84, 0x54, 0x18, 0xb3, - 0xda, 0x32, 0xc0, 0xd4, 0xd8, 0xae, 0x80, 0x64, 0x18, 0x13, 0xaa, 0xaa, 0x88, 0x3a, 0x13, 0xb3, - 0x16, 0x95, 0x2a, 0x0d, 0x3e, 0x9d, 0x50, 0xb1, 0x5e, 0xf3, 0xd5, 0x89, 0xdd, 0xf8, 0xf3, 0xc4, - 0x36, 0x9c, 0xbf, 0x0d, 0xb0, 0xfc, 0x68, 0x94, 0x7c, 0x49, 0x8a, 0x9c, 0x23, 0xaa, 0x9f, 0x3a, - 0x01, 0x00, 0x8e, 0x92, 0xfa, 0x4b, 0x6f, 0x6f, 0xdf, 0x71, 0xd5, 0xaa, 0x70, 0xab, 0x55, 0xe1, - 0xee, 0xe8, 0x55, 0xe1, 0x7f, 0x22, 0x3a, 0xff, 0x57, 0x69, 0x77, 0x26, 0x41, 0x1f, 0x92, 0x0c, - 0x73, 0x94, 0x0d, 0xf9, 0xf1, 0xb8, 0xb4, 0x57, 0xf4, 0x40, 0x5e, 0xa0, 0xce, 0xab, 0x37, 0xb6, - 0x11, 0xb4, 0xe0, 0x28, 0xd1, 0x55, 0x1f, 0x00, 0x61, 0x84, 0x6c, 0x80, 0xf7, 0xb9, 0xdc, 0x0e, - 0xff, 0xca, 0xf7, 0x50, 0xf3, 0xad, 0x5e, 0xc4, 0x4c, 0xd1, 0x2d, 0x4f, 0xe8, 0x24, 0xa8, 0xd8, - 0x9a, 0x70, 0x94, 0x3c, 0x93, 0xe6, 0x2f, 0x06, 0x98, 0x97, 0x8f, 0xc1, 0xfc, 0x18, 0x80, 0x3e, - 0x64, 0x28, 0x8c, 0x85, 0x25, 0xeb, 0x6c, 0xf9, 0x6b, 0x13, 0xc1, 0x13, 0xcc, 0x09, 0x5a, 0xc2, - 0x50, 0x51, 0x62, 0x84, 0x8f, 0xb3, 0x3e, 0x49, 0x75, 0x9c, 0xda, 0x66, 0xf5, 0x11, 0xae, 0xa1, - 0x62, 0x84, 0xa5, 0xa9, 0x62, 0x3d, 0xd0, 0x44, 0x47, 0x43, 0x92, 0xa3, 0x9c, 0xcb, 0xc5, 0xb4, - 0xe4, 0xaf, 0x8e, 0x4b, 0xfb, 0xb6, 0x8a, 0xab, 0x10, 0x27, 0xb8, 0x70, 0xea, 0x2d, 0xbe, 0x38, - 0xb1, 0x1b, 0xfa, 0xb6, 0x1a, 0xce, 0x4f, 0x06, 0x78, 0xf7, 0x51, 0x92, 0x50, 0x94, 0x40, 0x8e, - 0xbe, 0x3a, 0x8a, 0x06, 0x30, 0x4f, 0x50, 0x00, 0x39, 0xda, 0xa5, 0x48, 0x2c, 0x41, 0xf3, 0x3d, - 0x70, 0x63, 0x00, 0xd9, 0x40, 0xd7, 0x72, 0x7b, 0x5c, 0xda, 0x6d, 0x95, 0x5b, 0x9c, 0x3a, 0x81, - 0x04, 0xcd, 0x7b, 0x60, 0x5e, 0x38, 0x53, 0xad, 0x7c, 0x79, 0x5c, 0xda, 0x8b, 0x93, 0xcd, 0x4a, - 0x9d, 0x40, 0xc1, 0xb2, 0xd0, 0xa2, 0x9f, 0x61, 0x1e, 0xf6, 0x53, 0x12, 0x1d, 0x48, 0xc1, 0xd3, - 0x6f, 0xb5, 0x86, 0x8a, 0x42, 0xa5, 0xe9, 0x0b, 0xeb, 0x92, 0xee, 0x33, 0x03, 0xdc, 0xb9, 0x52, - 0xf7, 0x73, 0x21, 0xfa, 0x7b, 0x03, 0x74, 0x90, 0x3e, 0x0c, 0x29, 0x14, 0xcb, 0xbd, 0x18, 0xa6, - 0x88, 0x59, 0x86, 0x5c, 0x77, 0x77, 0x2f, 0xaf, 0xbb, 0x7a, 0x82, 0x3d, 0xe1, 0xe9, 0x7f, 0xae, - 0x57, 0xdf, 0x46, 0xd5, 0xc8, 0xd9, 0x64, 0x62, 0x07, 0x9a, 0x33, 0x91, 0x2c, 0x30, 0xd1, 0xcc, - 0xd9, 0x7f, 0x6d, 0xd0, 0xa5, 0x22, 0x7f, 0x36, 0xc0, 0xca, 0x0c, 0x81, 0xc8, 0x55, 0x1f, 0xaf, - 0x5a, 0x2e, 0x3d, 0x1f, 0x0a, 0x36, 0x0f, 0xc0, 0xd2, 0x94, 0x6c, 0xcd, 0xfd, 0xf8, 0xda, 0x5b, - 0xad, 0x73, 0x45, 0x0f, 0x9c, 0x60, 0xb1, 0x5e, 0xe6, 0x25, 0xe1, 0x3f, 0x18, 0x00, 0x4c, 0x76, - 0x80, 0xf9, 0x05, 0x98, 0x63, 0x45, 0xa5, 0xd7, 0xbd, 0x1e, 0x7f, 0x20, 0x42, 0xcd, 0x65, 0x30, - 0x97, 0x17, 0xea, 0x61, 0x2c, 0x05, 0xe2, 0xd3, 0xec, 0x81, 0x79, 0xc6, 0x21, 0x55, 0x43, 0xdf, - 0xde, 0x5e, 0x9f, 0x79, 0xdc, 0x7b, 0xd5, 0x1f, 0x13, 0xbf, 0x29, 0x18, 0x5f, 0x8a, 0x27, 0xab, - 0x42, 0x7a, 0xcd, 0x17, 0x5a, 0xa8, 0xff, 0xe4, 0xf4, 0x8f, 0x6e, 0xe3, 0xf4, 0xac, 0x6b, 0xbc, - 0x3e, 0xeb, 0x1a, 0xbf, 0x9f, 0x75, 0x8d, 0x97, 0xe7, 0xdd, 0xc6, 0xeb, 0xf3, 0x6e, 0xe3, 0xd7, - 0xf3, 0x6e, 0xe3, 0x5b, 0xb7, 0x26, 0x51, 0x4c, 0xcc, 0xfd, 0x1c, 0xf1, 0x43, 0x42, 0x0f, 0xa4, - 0xe1, 0x8d, 0x3e, 0xf5, 0x8e, 0xaa, 0x3f, 0x53, 0x52, 0x6e, 0x7f, 0x41, 0x92, 0x3f, 0xfc, 0x27, - 0x00, 0x00, 0xff, 0xff, 0x78, 0xba, 0x04, 0x76, 0x68, 0x09, 0x00, 0x00, + // 1074 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x92, 0x8f, 0xda, 0xe3, 0xa4, 0x4d, 0x36, 0x0e, 0xb8, 0x09, 0xf2, 0xa6, 0x8b, 0x28, + 0x39, 0xd0, 0x35, 0x4d, 0xf9, 0x10, 0x39, 0xd1, 0x25, 0x94, 0x4b, 0x2b, 0x45, 0xdb, 0xa8, 0x48, + 0x5c, 0x56, 0xe3, 0xdd, 0xc9, 0x7a, 0x14, 0xef, 0x8e, 0x35, 0x33, 0xeb, 0x24, 0x17, 0xce, 0x9c, + 0x50, 0x8f, 0x3d, 0xe6, 0xc4, 0x81, 0x1b, 0x88, 0x3f, 0x22, 0xc7, 0x1e, 0x11, 0x87, 0x2d, 0x24, + 0x17, 0xc4, 0x09, 0xf9, 0x2f, 0x40, 0xf3, 0xb1, 0xde, 0x71, 0x13, 0x21, 0x0c, 0x27, 0xef, 0x9b, + 0xdf, 0xfc, 0xde, 0xfb, 0xbd, 0x37, 0xef, 0x3d, 0x19, 0x6c, 0xe6, 0x29, 0x42, 0x5d, 0x42, 0x61, + 0x34, 0x40, 0xdd, 0xd1, 0x7d, 0xfd, 0xe5, 0x0d, 0x29, 0xe1, 0xc4, 0xbe, 0x29, 0x40, 0x4f, 0x1f, + 0x8d, 0xee, 0x6f, 0xb4, 0x12, 0x92, 0x10, 0x09, 0x75, 0xc5, 0x97, 0xba, 0xb5, 0xe1, 0x24, 0x84, + 0x24, 0x03, 0xd4, 0x95, 0x56, 0x2f, 0x3f, 0xec, 0x72, 0x9c, 0x22, 0xc6, 0x61, 0x3a, 0xd4, 0x17, + 0x3a, 0xaf, 0x5f, 0x88, 0x73, 0x0a, 0x39, 0x26, 0x99, 0xc2, 0xdd, 0xe2, 0x06, 0x58, 0xdc, 0x87, + 0x14, 0xa6, 0xcc, 0xfe, 0x04, 0x34, 0x47, 0x84, 0xa3, 0x70, 0x88, 0x28, 0x26, 0x71, 0xdb, 0xda, + 0xb2, 0xb6, 0xe7, 0xfd, 0x37, 0xc7, 0x85, 0x63, 0x9f, 0xc2, 0x74, 0xb0, 0xeb, 0x1a, 0xa0, 0x1b, + 0x00, 0x61, 0xed, 0x4b, 0xc3, 0xce, 0xc0, 0x4d, 0x89, 0xf1, 0x3e, 0x45, 0xac, 0x4f, 0x06, 0x71, + 0xfb, 0x8d, 0x2d, 0x6b, 0xbb, 0xe1, 0x7f, 0x79, 0x5e, 0x38, 0xb5, 0x5f, 0x0b, 0xe7, 0x6e, 0x82, + 0x79, 0x3f, 0xef, 0x79, 0x11, 0x49, 0xbb, 0x11, 0x61, 0x29, 0x61, 0xfa, 0xe7, 0x1e, 0x8b, 0x8f, + 0xba, 0xfc, 0x74, 0x88, 0x98, 0xb7, 0x87, 0xa2, 0x71, 0xe1, 0xac, 0x1b, 0x91, 0x26, 0xde, 0xdc, + 0x60, 0x59, 0x1c, 0x1c, 0x94, 0xb6, 0x8d, 0x40, 0x93, 0xa2, 0x63, 0x48, 0xe3, 0xb0, 0x07, 0xb3, + 0xb8, 0x3d, 0x27, 0x83, 0xed, 0xcd, 0x1c, 0x4c, 0xa7, 0x65, 0xb8, 0x72, 0x03, 0xa0, 0x2c, 0x1f, + 0x66, 0xb1, 0x1d, 0x81, 0x0d, 0x8d, 0xc5, 0x98, 0x71, 0x8a, 0x7b, 0xb9, 0xa8, 0x5b, 0x78, 0x8c, + 0xb3, 0x98, 0x1c, 0xb7, 0xe7, 0x65, 0x79, 0xde, 0x1d, 0x17, 0xce, 0x9d, 0x29, 0x3f, 0xd7, 0xdc, + 0x75, 0x83, 0xb6, 0x02, 0xf7, 0x0c, 0xec, 0x2b, 0x09, 0xd9, 0x21, 0x68, 0xc2, 0x28, 0x42, 0x43, + 0x1e, 0x0e, 0x30, 0xe3, 0xed, 0x85, 0xad, 0xb9, 0xed, 0xe6, 0xce, 0xba, 0x37, 0xfd, 0xf8, 0xde, + 0x1e, 0xca, 0x48, 0xea, 0xbf, 0x27, 0x52, 0xac, 0x84, 0x1b, 0x3c, 0xf7, 0x87, 0x57, 0x4e, 0x43, + 0x5e, 0x7a, 0x8c, 0x19, 0x0f, 0x80, 0x82, 0xc4, 0xb7, 0x78, 0x1c, 0x36, 0x80, 0xac, 0x1f, 0x1e, + 0x52, 0x18, 0x89, 0xc0, 0xed, 0xc5, 0xff, 0xf7, 0x38, 0xd3, 0xde, 0xdc, 0x60, 0x59, 0x1e, 0x3c, + 0xd2, 0xb6, 0xbd, 0x0b, 0x96, 0xd4, 0x0d, 0x5d, 0xa7, 0x1b, 0xb2, 0x4e, 0x6f, 0x8d, 0x0b, 0x67, + 0xcd, 0xe4, 0x97, 0x95, 0x69, 0x4a, 0x53, 0x17, 0xe3, 0x1b, 0xd0, 0x4a, 0x71, 0x16, 0x8e, 0xe0, + 0x00, 0xc7, 0xa2, 0xd3, 0x4a, 0x1f, 0x75, 0xa9, 0xf8, 0xc9, 0xcc, 0x8a, 0x37, 0x55, 0xc4, 0xeb, + 0x7c, 0xba, 0xc1, 0x6a, 0x8a, 0xb3, 0x67, 0xe2, 0x74, 0x1f, 0x51, 0x1d, 0x7f, 0x07, 0xac, 0xf7, + 0x31, 0xe3, 0x84, 0xe2, 0x28, 0x94, 0x43, 0x54, 0xce, 0x42, 0x43, 0x24, 0x11, 0xac, 0x95, 0xe0, + 0x53, 0x81, 0xe9, 0xe6, 0xf7, 0xc0, 0x5a, 0x8a, 0x62, 0x0c, 0xb3, 0x69, 0x06, 0x90, 0x8c, 0x55, + 0x05, 0x99, 0xf7, 0x3f, 0x00, 0xad, 0x14, 0x9e, 0xe0, 0x34, 0x4f, 0xc3, 0x21, 0xc5, 0x11, 0x52, + 0x34, 0xd6, 0x6e, 0x4a, 0x82, 0xad, 0xb1, 0x7d, 0x01, 0x49, 0x1a, 0x13, 0xaa, 0x4a, 0x86, 0x19, + 0x89, 0xb5, 0x97, 0x94, 0x2a, 0x0d, 0x3e, 0xa9, 0x42, 0xb1, 0xdd, 0xfa, 0x8b, 0x33, 0xa7, 0xf6, + 0xc7, 0x99, 0x63, 0xb9, 0x7f, 0x59, 0x60, 0xe5, 0xe1, 0x28, 0xf9, 0x9c, 0xe4, 0x19, 0x47, 0x54, + 0x8f, 0x3a, 0x01, 0x00, 0x8e, 0x12, 0x73, 0xd2, 0x9b, 0x3b, 0xb7, 0x3d, 0xb5, 0x2a, 0xbc, 0x72, + 0x55, 0x78, 0x7b, 0x7a, 0x55, 0xf8, 0x1f, 0x89, 0xca, 0xff, 0x59, 0x38, 0xad, 0x8a, 0xf4, 0x3e, + 0x49, 0x31, 0x47, 0xe9, 0x90, 0x9f, 0x8e, 0x0b, 0x67, 0x55, 0x37, 0xe4, 0x04, 0x75, 0x5f, 0xbc, + 0x72, 0xac, 0xa0, 0x01, 0x47, 0x89, 0xce, 0xfa, 0x08, 0x08, 0x23, 0x64, 0x7d, 0x7c, 0xc8, 0xe5, + 0x76, 0xf8, 0xc7, 0x78, 0x0f, 0x74, 0xbc, 0xb5, 0x09, 0x67, 0x2a, 0xdc, 0x4a, 0x15, 0x4e, 0x82, + 0x2a, 0x5a, 0x1d, 0x8e, 0x92, 0xa7, 0xd2, 0xfc, 0xd9, 0x02, 0x0b, 0x72, 0x18, 0xec, 0x0f, 0x01, + 0xe8, 0x41, 0x86, 0xc2, 0x58, 0x58, 0x32, 0xcf, 0x86, 0xbf, 0x5e, 0x09, 0xae, 0x30, 0x37, 0x68, + 0x08, 0x43, 0xb1, 0x44, 0x0b, 0x9f, 0xa6, 0x3d, 0x32, 0xd0, 0x3c, 0xb5, 0xcd, 0xcc, 0x16, 0x36, + 0x50, 0xd1, 0xc2, 0xd2, 0x54, 0xdc, 0x2e, 0xa8, 0xa3, 0x93, 0x21, 0xc9, 0x50, 0xc6, 0xe5, 0x62, + 0x5a, 0xf6, 0xd7, 0xc6, 0x85, 0x73, 0x4b, 0xf1, 0x4a, 0xc4, 0x0d, 0x26, 0x97, 0x26, 0x2f, 0x55, + 0x73, 0x7f, 0xb4, 0xc0, 0xdb, 0x0f, 0x93, 0x84, 0xa2, 0x04, 0x72, 0xf4, 0xc5, 0x49, 0xd4, 0x87, + 0x59, 0x82, 0x02, 0xc8, 0xd1, 0x3e, 0x45, 0x62, 0x01, 0xda, 0xef, 0x80, 0xf9, 0x3e, 0x64, 0x7d, + 0x9d, 0xc7, 0xad, 0x71, 0xe1, 0x34, 0x95, 0x5f, 0x71, 0xea, 0x06, 0x12, 0xb4, 0xef, 0x82, 0x05, + 0x71, 0x99, 0x6a, 0xd5, 0x2b, 0xe3, 0xc2, 0x59, 0xaa, 0xb6, 0x2a, 0x75, 0x03, 0x05, 0xcb, 0x24, + 0xf3, 0x5e, 0x8a, 0x79, 0xd8, 0x1b, 0x90, 0xe8, 0x48, 0x8a, 0x9d, 0x9e, 0x53, 0x03, 0x15, 0x49, + 0x4a, 0xd3, 0x17, 0x96, 0xa1, 0xb9, 0xb0, 0xc0, 0xed, 0x6b, 0x35, 0x3f, 0x13, 0x82, 0xbf, 0xb3, + 0x40, 0x0b, 0xe9, 0xc3, 0x90, 0x42, 0xb1, 0xd4, 0xf3, 0xe1, 0x00, 0xb1, 0xb6, 0x25, 0xd7, 0xdc, + 0x9d, 0xd7, 0xd7, 0x9c, 0xe9, 0xe0, 0x40, 0xdc, 0xf4, 0x3f, 0xd5, 0x2b, 0x6f, 0xb3, 0x2c, 0xe0, + 0x55, 0x67, 0x62, 0xf7, 0xd9, 0x57, 0x98, 0x2c, 0xb0, 0xd1, 0x95, 0xb3, 0x7f, 0x5b, 0x1c, 0x23, + 0xc1, 0x9f, 0x2c, 0xb0, 0x7a, 0xc5, 0xb9, 0xf0, 0x63, 0xb6, 0x94, 0xe1, 0x47, 0xf7, 0x84, 0x82, + 0xed, 0x23, 0xb0, 0x3c, 0x25, 0x59, 0xc7, 0x7d, 0x34, 0xf3, 0x26, 0x6b, 0x5d, 0x93, 0xbf, 0x1b, + 0x2c, 0x99, 0x29, 0x1a, 0xa2, 0xbf, 0xb7, 0x00, 0xa8, 0x66, 0xde, 0xfe, 0x0c, 0xcc, 0xb1, 0xbc, + 0xd4, 0xea, 0xcd, 0x16, 0x3b, 0x10, 0x54, 0x7b, 0x05, 0xcc, 0x65, 0xb9, 0x1a, 0x84, 0xe5, 0x40, + 0x7c, 0xda, 0xbb, 0x60, 0x81, 0x71, 0x48, 0x55, 0x93, 0x37, 0x77, 0x36, 0xae, 0x0c, 0xf3, 0x41, + 0xf9, 0x47, 0xc4, 0xaf, 0x8b, 0x88, 0xcf, 0xc5, 0x88, 0x2a, 0xca, 0x6e, 0xfd, 0xdb, 0x52, 0xe8, + 0x99, 0x05, 0x96, 0xcc, 0xea, 0xda, 0x3e, 0x98, 0x97, 0x75, 0xfa, 0x6f, 0x5a, 0x25, 0xd7, 0xf6, + 0x41, 0x63, 0xf2, 0x2f, 0x68, 0x26, 0x79, 0x15, 0xad, 0xaa, 0xa5, 0xff, 0xf8, 0xfc, 0xf7, 0x4e, + 0xed, 0xfc, 0xa2, 0x63, 0xbd, 0xbc, 0xe8, 0x58, 0xbf, 0x5d, 0x74, 0xac, 0xe7, 0x97, 0x9d, 0xda, + 0xcb, 0xcb, 0x4e, 0xed, 0x97, 0xcb, 0x4e, 0xed, 0x6b, 0xcf, 0x50, 0x26, 0x9a, 0xf9, 0x5e, 0x86, + 0xf8, 0x31, 0xa1, 0x47, 0xd2, 0xe8, 0x8e, 0x3e, 0xee, 0x9e, 0x94, 0xff, 0xef, 0xa4, 0xca, 0xde, + 0xa2, 0x14, 0xf0, 0xe0, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0xc7, 0x26, 0x38, 0xfb, 0x09, + 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -839,6 +880,47 @@ func (m *AvgCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ExchangeRate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExchangeRate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExchangeRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintOracle(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x1a + { + size := m.Rate.Size() + i -= size + if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintOracle(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintOracle(dAtA []byte, offset int, v uint64) int { offset -= sovOracle(v) base := offset @@ -997,6 +1079,19 @@ func (m *AvgCounter) Size() (n int) { return n } +func (m *ExchangeRate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Rate.Size() + n += 1 + l + sovOracle(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) + n += 1 + l + sovOracle(uint64(l)) + return n +} + func sovOracle(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2106,6 +2201,123 @@ func (m *AvgCounter) Unmarshal(dAtA []byte) error { } return nil } +func (m *ExchangeRate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExchangeRate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExchangeRate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOracle + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOracle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOracle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipOracle(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/vote.go b/x/oracle/types/vote.go index 69d1a62dba..98991c1d56 100644 --- a/x/oracle/types/vote.go +++ b/x/oracle/types/vote.go @@ -1,14 +1,14 @@ package types import ( + "encoding/json" "fmt" "strings" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/umee-network/umee/v6/util/sdkutil" "gopkg.in/yaml.v3" - - "github.com/umee-network/umee/v6/x/leverage/types" ) func NewAggregateExchangeRatePrevote( @@ -53,10 +53,12 @@ func NewExchangeRateTuple(denom string, exchangeRate sdk.Dec) ExchangeRateTuple } } -// String implement stringify func (v ExchangeRateTuple) String() string { - out, _ := yaml.Marshal(v) - return string(out) + return fmt.Sprintf("{\"denom\":%q, \"exchange_rate\":%q}", v.Denom, sdkutil.FormatDec(v.ExchangeRate)) +} + +func (v ExchangeRateTuple) MarshalJSON() ([]byte, error) { + return []byte(v.String()), nil } // ExchangeRateTuples - array of ExchangeRateTuple @@ -64,8 +66,8 @@ type ExchangeRateTuples []ExchangeRateTuple // String implements fmt.Stringer interface func (tuples ExchangeRateTuples) String() string { - out, _ := yaml.Marshal(tuples) - return string(out) + bz, _ := json.Marshal(tuples) + return string(bz) // fmt.Sprint([]ExchangeRateTuple(tuples)) } // ParseExchangeRateTuples ExchangeRateTuple parser @@ -89,7 +91,7 @@ func ParseExchangeRateTuples(tuplesStr string) (ExchangeRateTuples, error) { return nil, err } if !decCoin.IsPositive() { - return nil, types.ErrInvalidOraclePrice + return nil, fmt.Errorf("exchange rate can't be negative: %s", tupleStr) } denom := strings.ToUpper(denomAmountStr[0]) @@ -106,3 +108,8 @@ func ParseExchangeRateTuples(tuplesStr string) (ExchangeRateTuples, error) { return tuples, nil } + +func (v ExchangeRate) String() string { + bz, _ := json.Marshal(v) + return string(bz) +} diff --git a/x/oracle/types/vote_test.go b/x/oracle/types/vote_test.go index eac080b934..97b968b572 100644 --- a/x/oracle/types/vote_test.go +++ b/x/oracle/types/vote_test.go @@ -2,9 +2,10 @@ package types import ( "testing" + "time" sdk "github.com/cosmos/cosmos-sdk/types" - "gotest.tools/v3/assert" + "github.com/stretchr/testify/assert" ) func TestAggregateExchangeRatePrevoteString(t *testing.T) { @@ -31,22 +32,21 @@ func TestAggregateExchangeRateVoteString(t *testing.T) { } func TestExchangeRateTuplesString(t *testing.T) { + t.Parallel() exchangeRateTuple := NewExchangeRateTuple(UmeeDenom, sdk.OneDec()) - assert.Equal(t, exchangeRateTuple.String(), "denom: uumee\nexchange_rate: \"1.000000000000000000\"\n") + assert.Equal(t, exchangeRateTuple.String(), `{"denom":"uumee", "exchange_rate":"1"}`) exchangeRateTuples := ExchangeRateTuples{ exchangeRateTuple, NewExchangeRateTuple(IbcDenomAtom, sdk.SmallestDec()), } - assert.Equal(t, "- denom: uumee\n exchange_rate: \"1.000000000000000000\"\n- denom: ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2\n exchange_rate: \"0.000000000000000001\"\n", exchangeRateTuples.String()) + assert.Equal(t, `[{"denom":"uumee","exchange_rate":"1"},{"denom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2","exchange_rate":"0.000000000000000001"}]`, exchangeRateTuples.String()) } func TestParseExchangeRateTuples(t *testing.T) { - errMsg := "invalid oracle price" - valid := "uumee:123.0,uatom:123.123" _, err := ParseExchangeRateTuples(valid) - assert.NilError(t, err) + assert.NoError(t, err) duplicatedDenom := "uumee:100.0,uatom:123.123,uatom:121233.123" _, err = ParseExchangeRateTuples(duplicatedDenom) @@ -62,16 +62,22 @@ func TestParseExchangeRateTuples(t *testing.T) { zeroCoinsWithValid := "uumee:0.0,uatom:123.1" _, err = ParseExchangeRateTuples(zeroCoinsWithValid) - assert.ErrorContains(t, err, errMsg) + assert.ErrorContains(t, err, "can't be negative") negativeCoinsWithValid := "uumee:-1234.5,uatom:123.1" _, err = ParseExchangeRateTuples(negativeCoinsWithValid) - assert.ErrorContains(t, err, errMsg) + assert.ErrorContains(t, err, "can't be negative") multiplePricesPerRate := "uumee:123: uumee:456,uusdc:789" _, err = ParseExchangeRateTuples(multiplePricesPerRate) assert.ErrorContains(t, err, "invalid exchange rate") _, err = ParseExchangeRateTuples("") - assert.NilError(t, err) + assert.NoError(t, err) +} + +func TestExchangeRateString(t *testing.T) { + t1 := time.Date(2022, 9, 18, 15, 55, 01, 0, time.UTC) + er := ExchangeRate{Rate: sdk.MustNewDecFromStr("1.5"), Timestamp: t1} + assert.Equal(t, `{"rate":"1.500000000000000000","timestamp":"2022-09-18T15:55:01Z"}`, er.String()) } From bfd312ac8ca28f6ddd275394c1d23b5c1ba242a6 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 19 Sep 2023 11:32:35 +0200 Subject: [PATCH 07/14] chore: enforce experimental in e2e tests (#2253) * chore: enforce experimental in e2e tests * trigger e2e tests * makefile update * skip redeem_50meUSD_success test --- .github/workflows/tests.yml | 2 +- Makefile | 9 ++------- contrib/images/umee.e2e.dockerfile | 4 ++-- tests/e2e/e2e_metoken_test.go | 3 ++- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd6a50d830..76de25c0bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -113,7 +113,7 @@ jobs: - name: Test E2E if: env.GIT_DIFF run: | - EXPERIMENTAL=true make test-e2e + make test-e2e liveness-test: needs: install-tparse diff --git a/Makefile b/Makefile index 940215f5f0..3d9b31a52f 100644 --- a/Makefile +++ b/Makefile @@ -169,9 +169,6 @@ go.sum: go.mod ############################################################################### docker-build-e2e: - @DOCKER_BUILDKIT=1 docker build -t umee-network/umeed-e2e -f contrib/images/umee.e2e.dockerfile . - -docker-build-e2e-experimental: @DOCKER_BUILDKIT=1 docker build -t umee-network/umeed-e2e -f contrib/images/umee.e2e.dockerfile --build-arg EXPERIMENTAL=true . docker-build: @@ -196,14 +193,12 @@ TEST_COVERAGE_PROFILE=coverage.txt UNIT_TEST_TAGS = norace TEST_RACE_TAGS = "" -TEST_E2E_TAGS = "e2e" +TEST_E2E_TAGS = "e2e experimental" TEST_E2E_DEPS = docker-build-e2e ifeq ($(EXPERIMENTAL),true) UNIT_TEST_TAGS += experimental TEST_RACE_TAGS += experimental - TEST_E2E_TAGS += experimental - TEST_E2E_DEPS = docker-build-e2e-experimental endif test-unit: ARGS=-timeout=10m -tags='$(UNIT_TEST_TAGS)' @@ -238,7 +233,7 @@ test-e2e-cov: $(TEST_E2E_DEPS) go test ./tests/e2e/... -mod=readonly -timeout 30m -race -v -tags='$(TEST_E2E_TAGS)' -coverpkg=./... -coverprofile=e2e-profile.out -covermode=atomic test-e2e-clean: - docker stop umee0 umee1 umee2 umee-gaia-relayer gaiaval0 umee-price-feeder + 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 test-qa: diff --git a/contrib/images/umee.e2e.dockerfile b/contrib/images/umee.e2e.dockerfile index 37fac31288..510f18ce6a 100644 --- a/contrib/images/umee.e2e.dockerfile +++ b/contrib/images/umee.e2e.dockerfile @@ -2,7 +2,7 @@ # Creates dynamic binaries, by building from the latest version of umeed FROM golang:1.20-bookworm AS builder -ARG EXPERIMENTAL=false +ARG EXPERIMENTAL=true ## Download go module dependencies for umeed WORKDIR /src/umee @@ -15,7 +15,7 @@ ENV EXPERIMENTAL $EXPERIMENTAL WORKDIR /src/umee COPY . . RUN if [ "$EXPERIMENTAL" = "true" ] ; then echo "Installing experimental build";else echo "Installing stable build";fi -RUN BUILD_TAGS=badgerdb make install +RUN make install ## Prepare the final clear binary FROM ubuntu:23.04 diff --git a/tests/e2e/e2e_metoken_test.go b/tests/e2e/e2e_metoken_test.go index e215ab40e0..48eb8a4345 100644 --- a/tests/e2e/e2e_metoken_test.go +++ b/tests/e2e/e2e_metoken_test.go @@ -47,7 +47,6 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { s.Run( "swap_100USDT_success", func() { index = s.getMetokenIndex(mocks.MeUSDDenom) - hundredUSDT := sdk.NewCoin(mocks.USDTBaseDenom, sdkmath.NewInt(100_000000)) fee := index.Fee.MinFee.MulInt(hundredUSDT.Amount).TruncateInt() @@ -93,6 +92,8 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { s.Run( "redeem_50meUSD_success", func() { + s.T().Skip("test never succeeds, need to be updated") + fiftyMeUSD := sdk.NewCoin(mocks.MeUSDDenom, sdkmath.NewInt(50_000000)) s.executeRedeemSuccess(valAddr.String(), fiftyMeUSD, mocks.USDTBaseDenom) From c88495ce3ed93c616ba8ae720d26568295f49186 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 20 Sep 2023 17:33:50 +0200 Subject: [PATCH 08/14] fix(oracle): avg params (#2257) --- x/oracle/keeper/historic_avg.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x/oracle/keeper/historic_avg.go b/x/oracle/keeper/historic_avg.go index 66c67da849..8e354e0b4a 100644 --- a/x/oracle/keeper/historic_avg.go +++ b/x/oracle/keeper/historic_avg.go @@ -154,7 +154,9 @@ func (k Keeper) SetHistoricAvgCounterParams(ctx sdk.Context, acp types.AvgCounte // GetHistoricAvgCounterParams gets the avg period and avg shift time duration from store func (k Keeper) GetHistoricAvgCounterParams(ctx sdk.Context) types.AvgCounterParams { - kvs := ctx.KVStore(k.storeKey) - return *store.GetValue[*types.AvgCounterParams](kvs, types.KeyHistoricAvgCounterParams, - "historic avg counter params") + return types.DefaultAvgCounterParams() + // TODO: investigate why we don't have record! + // kvs := ctx.KVStore(k.storeKey) + // return *store.GetValue[*types.AvgCounterParams](kvs, types.KeyHistoricAvgCounterParams, + // "historic avg counter params") } From 9e8e554e8df5b3486f13e01e75da96dfa1bc087e Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 20 Sep 2023 19:09:14 +0200 Subject: [PATCH 09/14] v6.0.2 changelog (#2258) --- CHANGELOG.md | 6 ++++++ RELEASE_NOTES.md | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a7992bcae..a2eb0c40fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v6.0.2](https://github.com/umee-network/umee/releases/tag/v6.0.2) - 2023-09-20 + +### BugFix + +- [2257](https://github.com/umee-network/umee/pull/2257) fix(oracle): missing avg params. + ## [v6.0.1](https://github.com/umee-network/umee/releases/tag/v6.0.1) - 2023-09-15 ### Features diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7187b418aa..01b7647c46 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -6,6 +6,10 @@ Release Procedure is defined in the [CONTRIBUTING](CONTRIBUTING.md#release-procedure) document. +## v6.0.2 + +This fixes a crash shortly after the 6.0.1 upgrade. The crash occurred at height `8427849` but this binary works even if you switch to it immediately after the gov upgrade. Patch must be applied **as soon as possible**. + ## v6.0.1 This is a bug fix release for the `leverage.MsgGovUpdateSpecialAssets` handler. From 9a7cd9ea181c6c55832ff9f9482025db891e632a Mon Sep 17 00:00:00 2001 From: kosegor <30661385+kosegor@users.noreply.github.com> Date: Thu, 21 Sep 2023 04:49:34 -0300 Subject: [PATCH 10/14] test: fixing meToken e2e (#2255) * test1 * metoken e2e stabillized * rollback print --- tests/e2e/e2e_metoken_test.go | 77 +++++++++++++++++++++++++--------- tests/e2e/setup/metoken.go | 7 ++++ x/metoken/keeper/grpc_query.go | 2 +- x/metoken/keeper/price.go | 17 ++++++++ x/metoken/price.go | 39 ++++------------- 5 files changed, 92 insertions(+), 50 deletions(-) diff --git a/tests/e2e/e2e_metoken_test.go b/tests/e2e/e2e_metoken_test.go index 48eb8a4345..69b8b44e0c 100644 --- a/tests/e2e/e2e_metoken_test.go +++ b/tests/e2e/e2e_metoken_test.go @@ -6,6 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/umee-network/umee/v6/app" "github.com/umee-network/umee/v6/tests/grpc" @@ -15,7 +16,6 @@ import ( ) func (s *E2ETest) TestMetokenSwapAndRedeem() { - var prices []metoken.IndexPrices var index metoken.Index valAddr, err := s.Chain.Validators[0].KeyInfo.GetAddress() s.Require().NoError(err) @@ -40,7 +40,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { err = grpc.MetokenRegistryUpdate(s.Umee, []metoken.Index{meUSD}, nil) s.Require().NoError(err) - prices = s.checkMetokenBalance(meUSD.Denom, expectedBalance) + s.checkMetokenBalance(valAddr.String(), mocks.MeUSDDenom) }, ) @@ -57,6 +57,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { amountToReserves := assetSettings.ReservePortion.MulInt(amountToSwap).TruncateInt() amountToLeverage := amountToSwap.Sub(amountToReserves) + prices := s.getPrices(mocks.MeUSDDenom) usdtPrice, err := prices[0].PriceByBaseDenom(mocks.USDTBaseDenom) s.Require().NoError(err) returned := usdtPrice.SwapRate.MulInt(amountToSwap).TruncateInt() @@ -71,7 +72,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { usdtBalance.Leveraged = usdtBalance.Leveraged.Add(amountToLeverage) expectedBalance.SetAssetBalance(usdtBalance) - prices = s.checkMetokenBalance(mocks.MeUSDDenom, expectedBalance) + s.checkMetokenBalance(valAddr.String(), mocks.MeUSDDenom) }, ) @@ -86,25 +87,24 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { "not enough", ) - prices = s.checkMetokenBalance(mocks.MeUSDDenom, expectedBalance) + s.checkMetokenBalance(valAddr.String(), mocks.MeUSDDenom) }, ) s.Run( "redeem_50meUSD_success", func() { - s.T().Skip("test never succeeds, need to be updated") - + prices := s.getPrices(mocks.MeUSDDenom) fiftyMeUSD := sdk.NewCoin(mocks.MeUSDDenom, sdkmath.NewInt(50_000000)) s.executeRedeemSuccess(valAddr.String(), fiftyMeUSD, mocks.USDTBaseDenom) - usdtPrice, err := prices[0].PriceByBaseDenom(mocks.USDTBaseDenom) + usdtToRedeem, err := prices[0].RedeemRate(fiftyMeUSD, mocks.USDTBaseDenom) s.Require().NoError(err) - usdtToRedeem := usdtPrice.RedeemRate.MulInt(fiftyMeUSD.Amount).TruncateInt() fee := index.Fee.MinFee.MulInt(usdtToRedeem).TruncateInt() assetSettings, i := index.AcceptedAsset(mocks.USDTBaseDenom) s.Require().True(i >= 0) + amountFromReserves := assetSettings.ReservePortion.MulInt(usdtToRedeem).TruncateInt() amountFromLeverage := usdtToRedeem.Sub(amountFromReserves) @@ -116,13 +116,12 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { usdtBalance.Leveraged = usdtBalance.Leveraged.Sub(amountFromLeverage) expectedBalance.SetAssetBalance(usdtBalance) - _ = s.checkMetokenBalance(mocks.MeUSDDenom, expectedBalance) + s.checkMetokenBalance(valAddr.String(), mocks.MeUSDDenom) }, ) } -func (s *E2ETest) checkMetokenBalance(denom string, expectedBalance metoken.IndexBalances) []metoken.IndexPrices { - var prices []metoken.IndexPrices +func (s *E2ETest) checkMetokenBalance(valAddr, denom string) { s.Require().Eventually( func() bool { resp, err := s.QueryMetokenBalances(denom) @@ -130,23 +129,63 @@ func (s *E2ETest) checkMetokenBalance(denom string, expectedBalance metoken.Inde return false } - var exist bool - for _, balance := range resp.IndexBalances { - if balance.MetokenSupply.Denom == expectedBalance.MetokenSupply.Denom { - exist = true - s.Require().Equal(expectedBalance, balance) - break + coins, err := s.QueryUmeeAllBalances(s.UmeeREST(), authtypes.NewModuleAddress(metoken.ModuleName).String()) + if err != nil { + return false + } + + for _, coin := range coins { + var exist bool + for _, balance := range resp.IndexBalances[0].AssetBalances { + if balance.Denom == coin.Denom { + exist = true + expectedBalance := balance.Interest.Add(balance.Fees).Add(balance.Reserved) + s.Require().Equal(coin.Amount, expectedBalance) + continue + } + + if "u/"+balance.Denom == coin.Denom { + exist = true + s.Require().Equal(coin.Amount, balance.Leveraged) + continue + } + } + s.Require().True(exist) + } + + coins, err = s.QueryUmeeAllBalances(s.UmeeREST(), valAddr) + if err != nil { + return false + } + + for _, coin := range coins { + if coin.Denom == mocks.MeUSDDenom { + s.Require().Equal(coin.Amount, resp.IndexBalances[0].MetokenSupply.Amount) } } - s.Require().True(exist) - prices = resp.Prices return true }, 30*time.Second, 500*time.Millisecond, ) +} +func (s *E2ETest) getPrices(denom string) []metoken.IndexPrices { + var prices []metoken.IndexPrices + s.Require().Eventually( + func() bool { + resp, err := s.QueryMetokenPrices(denom) + if err != nil { + return false + } + + prices = resp.Prices + return true + }, + 30*time.Second, + 500*time.Millisecond, + ) return prices } diff --git a/tests/e2e/setup/metoken.go b/tests/e2e/setup/metoken.go index 97027f0779..4ab5564819 100644 --- a/tests/e2e/setup/metoken.go +++ b/tests/e2e/setup/metoken.go @@ -22,6 +22,13 @@ func (s *E2ETestSuite) QueryMetokenIndexes(denom string) (metoken.QueryIndexesRe return resp, s.QueryREST(endpoint, &resp) } +func (s *E2ETestSuite) QueryMetokenPrices(denom string) (metoken.QueryIndexPricesResponse, error) { + endpoint := fmt.Sprintf("%s/umee/metoken/v1/index_prices?metoken_denom=%s", s.UmeeREST(), denom) + var resp metoken.QueryIndexPricesResponse + + return resp, s.QueryREST(endpoint, &resp) +} + func (s *E2ETestSuite) TxMetokenSwap(umeeAddr string, asset sdk.Coin, meTokenDenom string) error { req := &metoken.MsgSwap{ User: umeeAddr, diff --git a/x/metoken/keeper/grpc_query.go b/x/metoken/keeper/grpc_query.go index 0c096443d9..7c4a9a8732 100644 --- a/x/metoken/keeper/grpc_query.go +++ b/x/metoken/keeper/grpc_query.go @@ -200,7 +200,7 @@ func (q Querier) getPrices(k Keeper, meTokenDenom string) ([]metoken.IndexPrices return nil, err } - prices[i] = ip.QueryExport() + prices[i] = ip } return prices, nil diff --git a/x/metoken/keeper/price.go b/x/metoken/keeper/price.go index 16ec739d93..33cf972cd0 100644 --- a/x/metoken/keeper/price.go +++ b/x/metoken/keeper/price.go @@ -37,6 +37,7 @@ func (k Keeper) Prices(index metoken.Index) (metoken.IndexPrices, error) { if err != nil { return indexPrices, err } + indexPrices.SetPrice( metoken.AssetPrice{ BaseDenom: aa.Denom, @@ -76,6 +77,22 @@ func (k Keeper) Prices(index metoken.Index) (metoken.IndexPrices, error) { indexPrices.Price = meTokenPrice } + for i := 0; i < len(indexPrices.Assets); i++ { + asset := indexPrices.Assets[i] + swapRate, err := metoken.Rate(asset.Price, indexPrices.Price, asset.Exponent, indexPrices.Exponent) + if err != nil { + return indexPrices, err + } + + redeemRate, err := metoken.Rate(indexPrices.Price, asset.Price, indexPrices.Exponent, asset.Exponent) + if err != nil { + return indexPrices, err + } + + indexPrices.Assets[i].SwapRate = swapRate + indexPrices.Assets[i].RedeemRate = redeemRate + } + return indexPrices, nil } diff --git a/x/metoken/price.go b/x/metoken/price.go index 32419f5939..3c4003b9e9 100644 --- a/x/metoken/price.go +++ b/x/metoken/price.go @@ -50,14 +50,7 @@ func (ip IndexPrices) SwapRate(from sdk.Coin) (sdkmath.Int, error) { return sdkmath.Int{}, err } - exchangeRate := fromPrice.Price.Quo(ip.Price) - - exponentFactor, err := ExponentFactor(fromPrice.Exponent, ip.Exponent) - if err != nil { - return sdkmath.Int{}, err - } - - return exchangeRate.MulInt(from.Amount).Mul(exponentFactor).TruncateInt(), nil + return fromPrice.SwapRate.MulInt(from.Amount).TruncateInt(), nil } // RedeemRate converts meToken to an asset applying exchange_rate and normalizing the exponent. @@ -67,32 +60,18 @@ func (ip IndexPrices) RedeemRate(from sdk.Coin, to string) (sdkmath.Int, error) return sdkmath.Int{}, err } - exchangeRate := ip.Price.Quo(toPrice.Price) - - exponentFactor, err := ExponentFactor(ip.Exponent, toPrice.Exponent) - if err != nil { - return sdkmath.Int{}, err - } - - return exchangeRate.MulInt(from.Amount).Mul(exponentFactor).TruncateInt(), nil + return toPrice.RedeemRate.MulInt(from.Amount).TruncateInt(), nil } -// QueryExport completes the structure with missing data for the query. -func (ip IndexPrices) QueryExport() IndexPrices { - assets := make([]AssetPrice, len(ip.Assets)) - for i := 0; i < len(ip.Assets); i++ { - asset := ip.Assets[i] - asset.SwapRate = asset.Price.Quo(ip.Price) - asset.RedeemRate = ip.Price.Quo(asset.Price) - assets[i] = asset - } +func Rate(fromPrice, toPrice sdk.Dec, fromExponent, toExponent uint32) (sdk.Dec, error) { + exchangeRate := fromPrice.Quo(toPrice) - return IndexPrices{ - Denom: ip.Denom, - Price: ip.Price, - Exponent: ip.Exponent, - Assets: assets, + exponentFactor, err := ExponentFactor(fromExponent, toExponent) + if err != nil { + return sdk.Dec{}, err } + + return exchangeRate.Mul(exponentFactor), nil } // ExponentFactor calculates the factor to multiply by which the assets with different exponents. From c20e5ab47857f0b24f4351ae9fe65e7f8b0762ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 08:24:47 +0000 Subject: [PATCH 11/14] build(deps): Bump DavidAnson/markdownlint-cli2-action from 12 to 13 (#2259) Bumps [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action) from 12 to 13. - [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases) - [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v12...v13) --- updated-dependencies: - dependency-name: DavidAnson/markdownlint-cli2-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sai Kumar <17549398+gsk967@users.noreply.github.com> --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1cd3e6f713..a19b82e241 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,7 +45,7 @@ jobs: with: files: "**/*.md" separator: "," - - uses: DavidAnson/markdownlint-cli2-action@v12 + - uses: DavidAnson/markdownlint-cli2-action@v13 if: steps.changed-files.outputs.any_changed == 'true' with: globs: ${{ steps.changed-files.outputs.all_changed_files }} From 2ee13b9f20afc54eaf1c917cb467ec60d535e496 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 21 Sep 2023 22:40:46 +0200 Subject: [PATCH 12/14] feat(client): unify and refactore client package (#2256) * add metoken client * refactore tx client * metoken queries * add proto.Message validator * use umee client in e2e tests * nil check * add QueryMetokenIndexPrices * lint * rollback change to 20s * fix metoken e2e --------- Co-authored-by: Egor Kostetskiy --- client/metoken.go | 58 +++++++++++++++++++++++++++++++++ sdkclient/client.go | 7 ++-- sdkclient/query/client.go | 7 ++-- sdkclient/tx/bank.go | 8 +++-- sdkclient/tx/client.go | 18 +++++++--- sdkclient/tx/gov.go | 24 ++++++-------- sdkclient/tx/key.go | 9 +++++ sdkclient/tx/sign.go | 1 - sdkclient/tx/wasm.go | 51 +++++++++++------------------ tests/e2e/e2e_metoken_test.go | 20 +++--------- tests/e2e/setup/metoken.go | 23 ------------- tests/e2e/setup/utils.go | 2 +- tests/grpc/gov.go | 12 +++---- tests/util/cw_util.go | 10 +++--- util/sdkutil/msg.go | 15 +++++++++ x/oracle/keeper/historic_avg.go | 2 +- 16 files changed, 158 insertions(+), 109 deletions(-) create mode 100644 client/metoken.go diff --git a/client/metoken.go b/client/metoken.go new file mode 100644 index 0000000000..50d2cb6121 --- /dev/null +++ b/client/metoken.go @@ -0,0 +1,58 @@ +package client + +import ( + "github.com/umee-network/umee/v6/util/sdkutil" + "github.com/umee-network/umee/v6/x/metoken" +) + +func (c Client) MetokenQClient() metoken.QueryClient { + return metoken.NewQueryClient(c.Query.GrpcConn) +} + +func (c Client) QueryMetokenParams() (metoken.Params, error) { + ctx, cancel := c.NewQCtx() + defer cancel() + + resp, err := c.MetokenQClient().Params(ctx, &metoken.QueryParams{}) + if err != nil { + return metoken.Params{}, err + } + return resp.Params, err +} + +func (c Client) QueryMetokenIndexBalances(denom string) (*metoken.QueryIndexBalancesResponse, error) { + ctx, cancel := c.NewQCtx() + defer cancel() + + msg := &metoken.QueryIndexBalances{MetokenDenom: denom} + if err := sdkutil.ValidateProtoMsg(msg); err != nil { + return nil, err + } + return c.MetokenQClient().IndexBalances(ctx, msg) +} + +func (c Client) QueryMetokenIndexes(denom string) (*metoken.QueryIndexesResponse, error) { + ctx, cancel := c.NewQCtx() + defer cancel() + + msg := &metoken.QueryIndexes{MetokenDenom: denom} + if err := sdkutil.ValidateProtoMsg(msg); err != nil { + return nil, err + } + return c.MetokenQClient().Indexes(ctx, msg) +} + +func (c Client) QueryMetokenIndexPrices(denom string) (*metoken.QueryIndexPricesResponse, error) { + ctx, cancel := c.NewQCtx() + defer cancel() + + msg := &metoken.QueryIndexPrices{MetokenDenom: denom} + if err := sdkutil.ValidateProtoMsg(msg); err != nil { + return nil, err + } + return c.MetokenQClient().IndexPrices(ctx, msg) +} + +// +// Tx +// diff --git a/sdkclient/client.go b/sdkclient/client.go index 79736d6163..907c54f17c 100644 --- a/sdkclient/client.go +++ b/sdkclient/client.go @@ -2,6 +2,8 @@ package sdkclient import ( "context" + "log" + "os" "time" sdkparams "github.com/cosmos/cosmos-sdk/simapp/params" @@ -32,11 +34,12 @@ func NewClient( encCfg sdkparams.EncodingConfig, ) (uc Client, err error) { uc = Client{} - uc.Query, err = query.NewClient(grpcEndpoint, 15*time.Second) + logger := log.New(os.Stderr, "chain-client", log.LstdFlags) + uc.Query, err = query.NewClient(logger, grpcEndpoint, 15*time.Second) if err != nil { return Client{}, err } - uc.Tx, err = tx.NewClient(chainDataDir, chainID, tmrpcEndpoint, mnemonics, gasAdjustment, encCfg) + uc.Tx, err = tx.NewClient(logger, chainDataDir, chainID, tmrpcEndpoint, mnemonics, gasAdjustment, encCfg) return uc, err } diff --git a/sdkclient/query/client.go b/sdkclient/query/client.go index dc24c1574c..e3317300b8 100644 --- a/sdkclient/query/client.go +++ b/sdkclient/query/client.go @@ -2,6 +2,7 @@ package query import ( "context" + "log" "net" "strings" "time" @@ -14,10 +15,12 @@ type Client struct { GrpcConn *grpc.ClientConn grpcEndpoint string QueryTimeout time.Duration + + logger *log.Logger } -func NewClient(grpcEndpoint string, queryTimeout time.Duration) (*Client, error) { - qc := &Client{grpcEndpoint: grpcEndpoint, QueryTimeout: queryTimeout} +func NewClient(logger *log.Logger, grpcEndpoint string, queryTimeout time.Duration) (*Client, error) { + qc := &Client{logger: logger, grpcEndpoint: grpcEndpoint, QueryTimeout: queryTimeout} return qc, qc.dialGrpcConn() } diff --git a/sdkclient/tx/bank.go b/sdkclient/tx/bank.go index 8082b71f3b..788fd20226 100644 --- a/sdkclient/tx/bank.go +++ b/sdkclient/tx/bank.go @@ -5,11 +5,13 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) -func (c *Client) TxSend(fromAddress, toAddress string, amount sdk.Coins) (*sdk.TxResponse, error) { +// BankSend creates and broadcasts bank send tx. `fromIdx` is an account index in the client +// keyring. +func (c *Client) BankSend(fromIdx int, toAddress string, amount sdk.Coins) (*sdk.TxResponse, error) { msg := &banktypes.MsgSend{ - FromAddress: fromAddress, + FromAddress: c.KeyringAddress(fromIdx).String(), ToAddress: toAddress, Amount: amount, } - return c.BroadcastTx(msg) + return c.BroadcastTx(fromIdx, msg) } diff --git a/sdkclient/tx/client.go b/sdkclient/tx/client.go index c074c4bde3..64d673da6b 100644 --- a/sdkclient/tx/client.go +++ b/sdkclient/tx/client.go @@ -1,6 +1,7 @@ package tx import ( + "log" "os" "github.com/cosmos/cosmos-sdk/client" @@ -26,12 +27,15 @@ type Client struct { keyringRecord []*keyring.Record txFactory *tx.Factory encCfg sdkparams.EncodingConfig + + logger *log.Logger } // Initializes a cosmos sdk client context and transaction factory for // signing and broadcasting transactions by passing chainDataDir and remaining func arguments // Note: For signing the transactions accounts are created by names like this val0, val1.... func NewClient( + logger *log.Logger, chainDataDir, chainID, tmrpcEndpoint string, @@ -44,6 +48,7 @@ func NewClient( TMRPCEndpoint: tmrpcEndpoint, gasAdjustment: gasAdjustment, encCfg: encCfg, + logger: logger, } c.keyringKeyring, err = keyring.New(keyringAppName, keyring.BackendTest, chainDataDir, nil, encCfg.Codec) @@ -120,10 +125,15 @@ func (c *Client) initTxFactory() { c.txFactory = &f } -func (c *Client) BroadcastTx(msgs ...sdk.Msg) (*sdk.TxResponse, error) { - c.ClientContext.From = c.keyringRecord[0].Name - c.ClientContext.FromName = c.keyringRecord[0].Name - c.ClientContext.FromAddress, _ = c.keyringRecord[0].GetAddress() +func (c *Client) BroadcastTx(idx int, msgs ...sdk.Msg) (*sdk.TxResponse, error) { + var err error + r := c.keyringRecord[idx] + c.ClientContext.From = r.Name + c.ClientContext.FromName = r.Name + c.ClientContext.FromAddress, err = r.GetAddress() + if err != nil { + c.logger.Fatalln("can't get keyring record, idx=", idx, err) + } return BroadcastTx(*c.ClientContext, *c.txFactory, msgs...) } diff --git a/sdkclient/tx/gov.go b/sdkclient/tx/gov.go index fbdd5f2e7e..890e831982 100644 --- a/sdkclient/tx/gov.go +++ b/sdkclient/tx/gov.go @@ -21,10 +21,10 @@ func (c *Client) GovParamChange(title, description string, changes []proposal.Pa return nil, err } - return c.BroadcastTx(msg) + return c.BroadcastTx(0, msg) } -func (c *Client) GovSubmitProposal(changes []proposal.ParamChange, deposit sdk.Coins) (*sdk.TxResponse, error) { +func (c *Client) GovSubmitParamProposal(changes []proposal.ParamChange, deposit sdk.Coins) (*sdk.TxResponse, error) { content := proposal.NewParameterChangeProposal( "update historic stamp period", "auto grpc proposal", @@ -40,10 +40,10 @@ func (c *Client) GovSubmitProposal(changes []proposal.ParamChange, deposit sdk.C return nil, err } - return c.BroadcastTx(msg) + return c.BroadcastTx(0, msg) } -func (c *Client) TxSubmitProposalWithMsg(msgs []sdk.Msg) (*sdk.TxResponse, error) { +func (c *Client) GovSubmitProposal(msgs []sdk.Msg) (*sdk.TxResponse, error) { deposit, err := sdk.ParseCoinsNormalized("1000uumee") if err != nil { return nil, err @@ -59,11 +59,11 @@ func (c *Client) TxSubmitProposalWithMsg(msgs []sdk.Msg) (*sdk.TxResponse, error return nil, err } - return c.BroadcastTx(submitProposal) + return c.BroadcastTx(0, submitProposal) } -// TxGovVoteYesAll creates transactions (one for each registered account) to approve a given proposal. -func (c *Client) TxGovVoteYesAll(proposalID uint64) error { +// GovVoteAllYes creates transactions (one for each account in the keyring) to approve a given proposal. +func (c *Client) GovVoteAllYes(proposalID uint64) error { for index := range c.keyringRecord { voter, err := c.keyringRecord[index].GetAddress() if err != nil { @@ -80,16 +80,12 @@ func (c *Client) TxGovVoteYesAll(proposalID uint64) error { proposalID, voteType, ) - - c.ClientContext.From = c.keyringRecord[index].Name - c.ClientContext.FromName = c.keyringRecord[index].Name - c.ClientContext.FromAddress, _ = c.keyringRecord[index].GetAddress() - - for retry := 0; retry < 5; retry++ { + for retry := 0; retry < 3; retry++ { // retry if txs fails, because sometimes account sequence mismatch occurs due to txs pending - if _, err = BroadcastTx(*c.ClientContext, *c.txFactory, []sdk.Msg{msg}...); err == nil { + if _, err = c.BroadcastTx(index, msg); err == nil { break } + c.logger.Println("Tx broadcast failed. RETRYING. Err: ", err) time.Sleep(time.Millisecond * 300) } diff --git a/sdkclient/tx/key.go b/sdkclient/tx/key.go index aea24dd4c3..c9facaa102 100644 --- a/sdkclient/tx/key.go +++ b/sdkclient/tx/key.go @@ -25,3 +25,12 @@ func CreateAccountFromMnemonic(kb keyring.Keyring, name, mnemonic string) (*keyr return account, nil } + +// Returns account address stored at give index +func (c *Client) KeyringAddress(idx int) sdk.AccAddress { + addr, err := c.keyringRecord[idx].GetAddress() + if err != nil { + c.logger.Fatalln("can't get keyring record, idx=", idx, err) + } + return addr +} diff --git a/sdkclient/tx/sign.go b/sdkclient/tx/sign.go index 343f17be09..3292dec6ca 100644 --- a/sdkclient/tx/sign.go +++ b/sdkclient/tx/sign.go @@ -52,7 +52,6 @@ func BroadcastTx(clientCtx client.Context, txf tx.Factory, msgs ...sdk.Msg) (*sd // the updated fields will be returned. func prepareFactory(clientCtx client.Context, txf tx.Factory) (tx.Factory, error) { from := clientCtx.GetFromAddress() - if err := txf.AccountRetriever().EnsureExists(clientCtx, from); err != nil { return txf, err } diff --git a/sdkclient/tx/wasm.go b/sdkclient/tx/wasm.go index 40e417517e..a85b00c8db 100644 --- a/sdkclient/tx/wasm.go +++ b/sdkclient/tx/wasm.go @@ -12,28 +12,21 @@ import ( "github.com/umee-network/umee/v6/util/coin" ) -func (c *Client) TxSubmitWasmContract(contractPath string) (*sdk.TxResponse, error) { - fromAddr, err := c.keyringRecord[0].GetAddress() +func (c *Client) WasmDeployContract(contractPath string) (*sdk.TxResponse, error) { + fromIdx := 0 + msg, err := readWasmCode(contractPath, c.KeyringAddress(fromIdx)) if err != nil { return nil, err } - msg, err := readWasmCode(contractPath, fromAddr) - if err != nil { - return nil, err - } - - return c.BroadcastTx(&msg) + return c.BroadcastTx(fromIdx, &msg) } -func (c *Client) TxWasmInstantiateContract(storeCode uint64, initMsg []byte) (*sdk.TxResponse, error) { - fromAddr, err := c.keyringRecord[0].GetAddress() - if err != nil { - return nil, err - } +func (c *Client) WasmInitContract(storeCode uint64, initMsg []byte) (*sdk.TxResponse, error) { + fromIdx := 0 amount := sdk.NewCoins(sdk.NewCoin(appparams.BondDenom, sdk.NewInt(1))) msg := types.MsgInstantiateContract{ - Sender: fromAddr.String(), + Sender: c.KeyringAddress(fromIdx).String(), CodeID: storeCode, Label: "label", Funds: amount, @@ -41,31 +34,27 @@ func (c *Client) TxWasmInstantiateContract(storeCode uint64, initMsg []byte) (*s Admin: "", } - return c.BroadcastTx(&msg) + return c.BroadcastTx(fromIdx, &msg) } -func (c *Client) TxWasmExecuteContractByAccSeq(contractAddr string, execMsg []byte, - accSeq uint64, +func (c *Client) WasmExecContractWithAccSeq(contractAddr string, execMsg []byte, accSeq uint64, ) (*sdk.TxResponse, error) { - fromAddr, err := c.keyringRecord[0].GetAddress() - if err != nil { - return nil, err - } + fromIdx := 0 amount := sdk.NewCoins(coin.Umee1) msg := types.MsgExecuteContract{ - Sender: fromAddr.String(), + Sender: c.KeyringAddress(fromIdx).String(), Contract: contractAddr, Funds: amount, Msg: execMsg, } if accSeq != 0 { - return c.WithAccSeq(accSeq).WithAsyncBlock().BroadcastTx(&msg) + return c.WithAccSeq(accSeq).WithAsyncBlock().BroadcastTx(fromIdx, &msg) } - return c.WithAsyncBlock().BroadcastTx(&msg) + return c.WithAsyncBlock().BroadcastTx(fromIdx, &msg) } -func (c *Client) TxWasmExecuteContract(contractAddr string, execMsg []byte) (*sdk.TxResponse, error) { - return c.TxWasmExecuteContractByAccSeq(contractAddr, execMsg, 0) +func (c *Client) WasmExecuteContract(contractAddr string, execMsg []byte) (*sdk.TxResponse, error) { + return c.WasmExecContractWithAccSeq(contractAddr, execMsg, 0) } // Prepares MsgStoreCode object from flags with gzipped wasm byte code field @@ -75,21 +64,19 @@ func readWasmCode(file string, sender sdk.AccAddress) (types.MsgStoreCode, error return types.MsgStoreCode{}, err } - // gzip the wasm file if ioutils.IsWasm(wasm) { wasm, err = ioutils.GzipIt(wasm) - if err != nil { return types.MsgStoreCode{}, err } } else if !ioutils.IsGzip(wasm) { - return types.MsgStoreCode{}, fmt.Errorf("invalid input file. Use wasm binary or gzip") + return types.MsgStoreCode{}, + fmt.Errorf("invalid input file. Wasm file must be a binary or gzip of a binary") } - msg := types.MsgStoreCode{ + return types.MsgStoreCode{ Sender: sender.String(), WASMByteCode: wasm, InstantiatePermission: &types.AllowEverybody, - } - return msg, nil + }, nil } diff --git a/tests/e2e/e2e_metoken_test.go b/tests/e2e/e2e_metoken_test.go index 69b8b44e0c..6a10c5fafa 100644 --- a/tests/e2e/e2e_metoken_test.go +++ b/tests/e2e/e2e_metoken_test.go @@ -124,7 +124,7 @@ func (s *E2ETest) TestMetokenSwapAndRedeem() { func (s *E2ETest) checkMetokenBalance(valAddr, denom string) { s.Require().Eventually( func() bool { - resp, err := s.QueryMetokenBalances(denom) + resp, err := s.Umee.QueryMetokenIndexBalances(denom) if err != nil { return false } @@ -175,7 +175,7 @@ func (s *E2ETest) getPrices(denom string) []metoken.IndexPrices { var prices []metoken.IndexPrices s.Require().Eventually( func() bool { - resp, err := s.QueryMetokenPrices(denom) + resp, err := s.Umee.QueryMetokenIndexPrices(denom) if err != nil { return false } @@ -193,7 +193,7 @@ func (s *E2ETest) getMetokenIndex(denom string) metoken.Index { index := metoken.Index{} s.Require().Eventually( func() bool { - resp, err := s.QueryMetokenIndexes(denom) + resp, err := s.Umee.QueryMetokenIndexes(denom) if err != nil { return false } @@ -220,12 +220,7 @@ func (s *E2ETest) getMetokenIndex(denom string) metoken.Index { func (s *E2ETest) executeSwap(umeeAddr string, asset sdk.Coin, meTokenDenom string) { s.Require().Eventually( func() bool { - err := s.TxMetokenSwap(umeeAddr, asset, meTokenDenom) - if err != nil { - return false - } - - return true + return s.TxMetokenSwap(umeeAddr, asset, meTokenDenom) == nil }, 30*time.Second, 500*time.Millisecond, @@ -235,12 +230,7 @@ func (s *E2ETest) executeSwap(umeeAddr string, asset sdk.Coin, meTokenDenom stri func (s *E2ETest) executeRedeemSuccess(umeeAddr string, meToken sdk.Coin, assetDenom string) { s.Require().Eventually( func() bool { - err := s.TxMetokenRedeem(umeeAddr, meToken, assetDenom) - if err != nil { - return false - } - - return true + return s.TxMetokenRedeem(umeeAddr, meToken, assetDenom) == nil }, 30*time.Second, 500*time.Millisecond, diff --git a/tests/e2e/setup/metoken.go b/tests/e2e/setup/metoken.go index 4ab5564819..c7cfe11a55 100644 --- a/tests/e2e/setup/metoken.go +++ b/tests/e2e/setup/metoken.go @@ -1,34 +1,11 @@ package setup import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/umee-network/umee/v6/x/metoken" ) -func (s *E2ETestSuite) QueryMetokenBalances(denom string) (metoken.QueryIndexBalancesResponse, error) { - endpoint := fmt.Sprintf("%s/umee/metoken/v1/index_balances?metoken_denom=%s", s.UmeeREST(), denom) - var resp metoken.QueryIndexBalancesResponse - - return resp, s.QueryREST(endpoint, &resp) -} - -func (s *E2ETestSuite) QueryMetokenIndexes(denom string) (metoken.QueryIndexesResponse, error) { - endpoint := fmt.Sprintf("%s/umee/metoken/v1/indexes?metoken_denom=%s", s.UmeeREST(), denom) - var resp metoken.QueryIndexesResponse - - return resp, s.QueryREST(endpoint, &resp) -} - -func (s *E2ETestSuite) QueryMetokenPrices(denom string) (metoken.QueryIndexPricesResponse, error) { - endpoint := fmt.Sprintf("%s/umee/metoken/v1/index_prices?metoken_denom=%s", s.UmeeREST(), denom) - var resp metoken.QueryIndexPricesResponse - - return resp, s.QueryREST(endpoint, &resp) -} - func (s *E2ETestSuite) TxMetokenSwap(umeeAddr string, asset sdk.Coin, meTokenDenom string) error { req := &metoken.MsgSwap{ User: umeeAddr, diff --git a/tests/e2e/setup/utils.go b/tests/e2e/setup/utils.go index e643ebf65e..ec371259e0 100644 --- a/tests/e2e/setup/utils.go +++ b/tests/e2e/setup/utils.go @@ -235,7 +235,7 @@ func (s *E2ETestSuite) BroadcastTxWithRetry(msg sdk.Msg) 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.Client.Tx.BroadcastTx(msg) + _, err = s.Umee.Tx.BroadcastTx(0, msg) if err == nil { return nil } diff --git a/tests/grpc/gov.go b/tests/grpc/gov.go index 9fb353ba7b..45796175bc 100644 --- a/tests/grpc/gov.go +++ b/tests/grpc/gov.go @@ -26,7 +26,7 @@ func init() { } func SubmitAndPassProposal(umee client.Client, changes []proposal.ParamChange) error { - resp, err := umee.Tx.GovSubmitProposal(changes, govDeposit) + resp, err := umee.Tx.GovSubmitParamProposal(changes, govDeposit) if err != nil { return err } @@ -65,7 +65,7 @@ func UIBCIBCTransferSatusUpdate(umeeClient client.Client, status uibc.IBCTransfe IbcStatus: status, } - resp, err := umeeClient.Tx.TxSubmitProposalWithMsg([]sdk.Msg{&msg}) + resp, err := umeeClient.Tx.GovSubmitProposal([]sdk.Msg{&msg}) if err != nil { return err } @@ -86,7 +86,7 @@ func LeverageRegistryUpdate(umeeClient client.Client, addTokens, updateTokens [] UpdateTokens: updateTokens, } - resp, err := umeeClient.Tx.TxSubmitProposalWithMsg([]sdk.Msg{&msg}) + resp, err := umeeClient.Tx.GovSubmitProposal([]sdk.Msg{&msg}) if err != nil { return err } @@ -112,7 +112,7 @@ func LeverageSpecialPairsUpdate( Pairs: pairs, } - resp, err := umeeClient.Tx.TxSubmitProposalWithMsg([]sdk.Msg{&msg}) + resp, err := umeeClient.Tx.GovSubmitProposal([]sdk.Msg{&msg}) if err != nil { return err } @@ -132,7 +132,7 @@ func MetokenRegistryUpdate(umeeClient client.Client, addIndexes, updateIndexes [ UpdateIndex: updateIndexes, } - resp, err := umeeClient.Tx.TxSubmitProposalWithMsg([]sdk.Msg{&msg}) + resp, err := umeeClient.Tx.GovSubmitProposal([]sdk.Msg{&msg}) if err != nil { return err } @@ -165,7 +165,7 @@ func MakeVoteAndCheckProposal(umeeClient client.Client, resp sdk.TxResponse) err return err } - err = umeeClient.Tx.TxGovVoteYesAll(proposalIDInt) + err = umeeClient.Tx.GovVoteAllYes(proposalIDInt) if err != nil { return err } diff --git a/tests/util/cw_util.go b/tests/util/cw_util.go index 62c6825c18..0818ea4a9b 100644 --- a/tests/util/cw_util.go +++ b/tests/util/cw_util.go @@ -33,7 +33,7 @@ func NewCosmwasmTestSuite(t *testing.T, umee client.Client) *Cosmwasm { func (cw *Cosmwasm) DeployWasmContract(path string) { cw.T.Logf("ℹ️ deploying smart contract %s", path) - resp, err := cw.umee.Tx.TxSubmitWasmContract(path) + resp, err := cw.umee.Tx.WasmDeployContract(path) assert.NilError(cw.T, err) storeCode := cw.GetAttributeValue(*resp, "store_code", "code_id") cw.StoreCode, err = strconv.ParseUint(storeCode, 10, 64) @@ -49,7 +49,7 @@ func (cw *Cosmwasm) MarshalAny(any interface{}) []byte { func (cw *Cosmwasm) InstantiateContract(initMsg []byte) { cw.T.Log("ℹ️ smart contract is instantiating...") - resp, err := cw.umee.Tx.TxWasmInstantiateContract(cw.StoreCode, initMsg) + resp, err := cw.umee.Tx.WasmInitContract(cw.StoreCode, initMsg) assert.NilError(cw.T, err) cw.ContractAddr = cw.GetAttributeValue(*resp, "instantiate", "_contract_address") assert.Equal(cw.T, SucceessRespCode, resp.Code) @@ -64,19 +64,19 @@ func (cw *Cosmwasm) CWQuery(query []byte) wasmtypes.QuerySmartContractStateRespo } func (cw *Cosmwasm) CWExecute(execMsg []byte) { - resp, err := cw.umee.Tx.TxWasmExecuteContract(cw.ContractAddr, execMsg) + resp, err := cw.umee.Tx.WasmExecuteContract(cw.ContractAddr, execMsg) assert.NilError(cw.T, err) assert.Equal(cw.T, SucceessRespCode, resp.Code) } func (cw *Cosmwasm) CWExecuteWithSeqAndAsync(execMsg []byte, accSeq uint64) { - resp, err := cw.umee.Tx.TxWasmExecuteContractByAccSeq(cw.ContractAddr, execMsg, accSeq) + resp, err := cw.umee.Tx.WasmExecContractWithAccSeq(cw.ContractAddr, execMsg, accSeq) assert.NilError(cw.T, err) assert.Equal(cw.T, SucceessRespCode, resp.Code) } func (cw *Cosmwasm) CWExecuteWithSeqAndAsyncResp(execMsg []byte, accSeq uint64) (*sdk.TxResponse, error) { - return cw.umee.Tx.TxWasmExecuteContractByAccSeq(cw.ContractAddr, execMsg, accSeq) + return cw.umee.Tx.WasmExecContractWithAccSeq(cw.ContractAddr, execMsg, accSeq) } func (cw *Cosmwasm) GetAttributeValue(resp sdk.TxResponse, eventName, attrKey string) string { diff --git a/util/sdkutil/msg.go b/util/sdkutil/msg.go index 7400c4e510..e08b95f11d 100644 --- a/util/sdkutil/msg.go +++ b/util/sdkutil/msg.go @@ -4,6 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/gogo/protobuf/proto" ) // StartMsg unpacks sdk.Context and validates msg. @@ -22,3 +23,17 @@ func StartMsg(ctx context.Context, msg sdk.Msg) (sdk.Context, error) { type fullValidate interface { Validate(*sdk.Context) error } + +type validateBasic interface { + ValidateBasic() error +} + +// ValidateProtoMsg tries to run msg.ValidateBasic +func ValidateProtoMsg(msg proto.Message) error { + if vm, ok := msg.(validateBasic); ok { + if err := vm.ValidateBasic(); err != nil { + return err + } + } + return nil +} diff --git a/x/oracle/keeper/historic_avg.go b/x/oracle/keeper/historic_avg.go index 8e354e0b4a..820da66ee5 100644 --- a/x/oracle/keeper/historic_avg.go +++ b/x/oracle/keeper/historic_avg.go @@ -153,7 +153,7 @@ func (k Keeper) SetHistoricAvgCounterParams(ctx sdk.Context, acp types.AvgCounte } // GetHistoricAvgCounterParams gets the avg period and avg shift time duration from store -func (k Keeper) GetHistoricAvgCounterParams(ctx sdk.Context) types.AvgCounterParams { +func (k Keeper) GetHistoricAvgCounterParams(_ sdk.Context) types.AvgCounterParams { return types.DefaultAvgCounterParams() // TODO: investigate why we don't have record! // kvs := ctx.KVStore(k.storeKey) From e1cb4521d2ae9a62f3735a573cce95cc6ebfb2a2 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 22 Sep 2023 03:22:23 +0200 Subject: [PATCH 13/14] fix(oracle): avg params storage. (#2260) * fix(oracle): v6.1 upgrade with setting missing oracle avg price params * oracle: use avg params from the store * set correct AvgParams prefix key * fix * review * changelog --- CHANGELOG.md | 4 ++++ app/upgrades.go | 15 +++++++++++++++ x/oracle/keeper/historic_avg.go | 13 +++++-------- x/oracle/keeper/migrations.go | 6 ------ x/oracle/types/keys.go | 22 ++++++++++++---------- x/oracle/types/params.go | 1 - 6 files changed, 36 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2eb0c40fe..5183aabada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Bug Fixes + +- [2260](https://github.com/umee-network/umee/pull/2260) fix(oracle): avg params storage. + ## [v6.0.2](https://github.com/umee-network/umee/releases/tag/v6.0.2) - 2023-09-20 ### BugFix diff --git a/app/upgrades.go b/app/upgrades.go index 46e7dd8d45..a51a37de18 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -57,6 +57,21 @@ func (app UmeeApp) RegisterUpgradeHandlers() { app.registerUpgrade5_1(upgradeInfo) app.registerUpgrade("v5.2", upgradeInfo) // v5.2 migration is not compatible with v6, so leaving default here. app.registerUpgrade6(upgradeInfo) + app.registerUpgrade6_1("v6.1", upgradeInfo) +} + +func (app *UmeeApp) registerUpgrade6_1(planName string, _ upgradetypes.Plan) { + app.UpgradeKeeper.SetUpgradeHandler(planName, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("-----------------------------\n-----------------------------") + err := app.OracleKeeper.SetHistoricAvgCounterParams(ctx, oracletypes.DefaultAvgCounterParams()) + if err != nil { + return fromVM, err + } + + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }, + ) } func (app *UmeeApp) registerUpgrade6(upgradeInfo upgradetypes.Plan) { diff --git a/x/oracle/keeper/historic_avg.go b/x/oracle/keeper/historic_avg.go index 820da66ee5..2fd0069bfb 100644 --- a/x/oracle/keeper/historic_avg.go +++ b/x/oracle/keeper/historic_avg.go @@ -149,14 +149,11 @@ func (k AvgKeeper) getCounter(denom string, idx byte) (types.AvgCounter, error) // SetHistoricAvgCounterParams sets avg period and avg shift time duration func (k Keeper) SetHistoricAvgCounterParams(ctx sdk.Context, acp types.AvgCounterParams) error { kvs := ctx.KVStore(k.storeKey) - return store.SetValue(kvs, types.KeyHistoricAvgCounterParams, &acp, "historic avg counter params") + return store.SetValue(kvs, types.KeyAvgCounterParams, &acp, "historic avg counter params") } -// GetHistoricAvgCounterParams gets the avg period and avg shift time duration from store -func (k Keeper) GetHistoricAvgCounterParams(_ sdk.Context) types.AvgCounterParams { - return types.DefaultAvgCounterParams() - // TODO: investigate why we don't have record! - // kvs := ctx.KVStore(k.storeKey) - // return *store.GetValue[*types.AvgCounterParams](kvs, types.KeyHistoricAvgCounterParams, - // "historic avg counter params") +func (k Keeper) GetHistoricAvgCounterParams(ctx sdk.Context) types.AvgCounterParams { + kvs := ctx.KVStore(k.storeKey) + return *store.GetValue[*types.AvgCounterParams](kvs, types.KeyAvgCounterParams, + "historic avg counter params") } diff --git a/x/oracle/keeper/migrations.go b/x/oracle/keeper/migrations.go index 53774de819..c26c90b9b0 100644 --- a/x/oracle/keeper/migrations.go +++ b/x/oracle/keeper/migrations.go @@ -35,12 +35,6 @@ func (m Migrator) HistoracleParams3x4(ctx sdk.Context) error { return nil } -// SetAvgPeriodAndShift updates the avg shift and period params -func (m Migrator) SetAvgPeriodAndShift(ctx sdk.Context) error { - p := types.DefaultAvgCounterParams() - return m.keeper.SetHistoricAvgCounterParams(ctx, p) -} - // MigrateBNB fixes the BNB base denom for the 4.1 upgrade without using leverage hooks func (m Migrator) MigrateBNB(ctx sdk.Context) { badDenom := "ibc/77BCD42E49E5B7E0FC6B269FEBF0185B15044F13F6F38CA285DF0AF883459F40" diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go index 53359f0f36..3ef456f483 100644 --- a/x/oracle/types/keys.go +++ b/x/oracle/types/keys.go @@ -19,16 +19,18 @@ const ( // KVStore key prefixes var ( - KeyPrefixExchangeRate = []byte{0x01} // prefix for each key to a rate - KeyPrefixFeederDelegation = []byte{0x02} // prefix for each key to a feeder delegation - KeyPrefixMissCounter = []byte{0x03} // prefix for each key to a miss counter - KeyPrefixAggregateExchangeRatePrevote = []byte{0x04} // prefix for each key to a aggregate prevote - KeyPrefixAggregateExchangeRateVote = []byte{0x05} // prefix for each key to a aggregate vote - KeyPrefixMedian = []byte{0x06} // prefix for each key to a price median - KeyPrefixMedianDeviation = []byte{0x07} // prefix for each key to a price median standard deviation - KeyPrefixHistoricPrice = []byte{0x08} // prefix for each key to a historic price - KeyPrefixAvgCounter = []byte{0x09} // prefix for each key to a historic avg price counter - KeyLatestAvgCounter = []byte{0x10} // key where we store the latest avg price counter + KeyPrefixExchangeRate = []byte{1} // prefix for each key to a rate + KeyPrefixFeederDelegation = []byte{2} // prefix for each key to a feeder delegation + KeyPrefixMissCounter = []byte{3} // prefix for each key to a miss counter + KeyPrefixAggregateExchangeRatePrevote = []byte{4} // prefix for each key to a aggregate prevote + KeyPrefixAggregateExchangeRateVote = []byte{5} // prefix for each key to a aggregate vote + KeyPrefixMedian = []byte{6} // prefix for each key to a price median + KeyPrefixMedianDeviation = []byte{7} // prefix for each key to a price median standard deviation + KeyPrefixHistoricPrice = []byte{8} // prefix for each key to a historic price + KeyPrefixAvgCounter = []byte{9} // prefix for each key to a historic avg price counter + KeyAvgCounterParams = []byte{10} + + KeyLatestAvgCounter = []byte{16} // it was set as 0x10 and breaking the order ) // KeyExchangeRate - stored by *denom* diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go index 69fad2c690..50ad4a49e1 100644 --- a/x/oracle/types/params.go +++ b/x/oracle/types/params.go @@ -37,7 +37,6 @@ var ( KeyMedianStampPeriod = []byte("MedianStampPeriod") KeyMaximumPriceStamps = []byte("MaximumPriceStamps") KeyMaximumMedianStamps = []byte("MedianStampAmount") - KeyHistoricAvgCounterParams = []byte("HistoricAvgCounterParams") ) var _ paramstypes.ParamSet = &Params{} From 9c1f366ebdfaa1f996a4342d20a8d658ffa608e5 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 22 Sep 2023 17:59:50 +0200 Subject: [PATCH 14/14] chore: use go-1.21 (#2261) * chore: use go-1.21 * go mod tidy --- CHANGELOG.md | 4 +++ contrib/images/umee.e2e-static.dockerfile | 4 +-- contrib/images/umee.e2e.dockerfile | 2 +- contrib/images/umeed.dockerfile | 2 +- contrib/scripts/go-mod-tidy-all.sh | 2 +- go.mod | 2 +- go.sum | 36 +++++++++++++++++++++++ tests/e2e/docker/gaia.Dockerfile | 2 +- 8 files changed, 47 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5183aabada..4065a56351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +- [2261](https://github.com/umee-network/umee/pull/2261) Use go 1.21 + ### Bug Fixes - [2260](https://github.com/umee-network/umee/pull/2260) fix(oracle): avg params storage. diff --git a/contrib/images/umee.e2e-static.dockerfile b/contrib/images/umee.e2e-static.dockerfile index 5fad6b0022..3f802960da 100644 --- a/contrib/images/umee.e2e-static.dockerfile +++ b/contrib/images/umee.e2e-static.dockerfile @@ -2,7 +2,7 @@ # Creates static binaries, by building from the latest version of: # umeed, price-feeder. -FROM golang:1.20-alpine AS builder +FROM golang:1.21-alpine3.18 AS builder ENV PACKAGES make git gcc linux-headers build-base curl RUN apk add --no-cache $PACKAGES @@ -25,7 +25,7 @@ RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make install && \ ## Prepare the final clear binary -FROM alpine:latest +FROM alpine:3.18 EXPOSE 26656 26657 1317 9090 7171 ENTRYPOINT ["umeed", "start"] diff --git a/contrib/images/umee.e2e.dockerfile b/contrib/images/umee.e2e.dockerfile index 510f18ce6a..216a088fd8 100644 --- a/contrib/images/umee.e2e.dockerfile +++ b/contrib/images/umee.e2e.dockerfile @@ -1,7 +1,7 @@ # Docker for e2e testing # Creates dynamic binaries, by building from the latest version of umeed -FROM golang:1.20-bookworm AS builder +FROM golang:1.21-bookworm AS builder ARG EXPERIMENTAL=true ## Download go module dependencies for umeed diff --git a/contrib/images/umeed.dockerfile b/contrib/images/umeed.dockerfile index 5e0988419e..3ab525562d 100644 --- a/contrib/images/umeed.dockerfile +++ b/contrib/images/umeed.dockerfile @@ -1,7 +1,7 @@ # Stage-1: build # We use Debian Bullseye rather then Alpine because Alpine has problem building libwasmvm # - requires to download libwasmvm_muslc from external source. Build with glibc is straightforward. -FROM golang:1.20-bookworm AS builder +FROM golang:1.21-bookworm AS builder WORKDIR /src/ # optimization: if go.sum didn't change, docker will use cached image diff --git a/contrib/scripts/go-mod-tidy-all.sh b/contrib/scripts/go-mod-tidy-all.sh index c104ebb014..833e9c7ea6 100755 --- a/contrib/scripts/go-mod-tidy-all.sh +++ b/contrib/scripts/go-mod-tidy-all.sh @@ -5,5 +5,5 @@ set -euo pipefail for modfile in $(find . -name go.mod); do echo "Updating $modfile" DIR=$(dirname $modfile) - (cd $DIR; go mod tidy --compat=1.20) + (cd $DIR; go mod tidy --compat=1.21) done diff --git a/go.mod b/go.mod index d503df208c..33e38bef64 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/umee-network/umee/v6 -go 1.20 +go 1.21 require ( cosmossdk.io/errors v1.0.0 diff --git a/go.sum b/go.sum index c5e1c929d4..444aee8c6c 100644 --- a/go.sum +++ b/go.sum @@ -257,6 +257,7 @@ github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSa github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -303,6 +304,7 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbE github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -333,6 +335,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJ github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -349,12 +352,14 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/protocompile v0.1.0 h1:HjgJBI85hY/qmW5tw/66sNDZ7z0UDdVSi/5r40WHw4s= +github.com/bufbuild/protocompile v0.1.0/go.mod h1:ix/MMMdsT3fzxfw91dvbfzKW3fRRnuPCP47kpAm5m/4= github.com/butuzov/ireturn v0.2.0 h1:kCHi+YzC150GE98WFuZQu9yrTn6GEydO2AuPLbTgnO4= github.com/butuzov/ireturn v0.2.0/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/ccojocar/zxcvbn-go v1.0.1 h1:+sxrANSCj6CdadkcMnvde/GWU1vZiiXRbqYSCalV4/4= @@ -379,6 +384,7 @@ github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+U github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= @@ -443,6 +449,7 @@ github.com/cosmos/iavl v0.19.6/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONAp github.com/cosmos/ibc-go/v6 v6.2.0 h1:HKS5WNxQrlmjowHb73J9LqlNJfvTnvkbhXZ9QzNTU7Q= github.com/cosmos/ibc-go/v6 v6.2.0/go.mod h1:+S3sxcNwOhgraYDJAhIFDg5ipXHaUnJrg7tOQqGyWlc= github.com/cosmos/interchain-accounts v0.4.3 h1:WedxEa/Hj/2GY7AF6CafkEPJ/Z9rhl3rT1mRwNHsdts= +github.com/cosmos/interchain-accounts v0.4.3/go.mod h1:qibHB6y/R2YsuuZdamI2BcIUBPMyhyELDWAr8Nk8x4g= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -536,8 +543,11 @@ github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd 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= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= @@ -551,10 +561,12 @@ github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIg github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -562,6 +574,7 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= @@ -593,22 +606,28 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= 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= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= @@ -621,6 +640,7 @@ github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlN github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= github.com/go-toolsmith/pkgload v1.2.2 h1:0CtmHq/02QhxcF7E9N5LIFcYFsMR5rdovfqTtRKkgIk= +github.com/go-toolsmith/pkgload v1.2.2/go.mod h1:R2hxLNRKuAsiXCo2i5J6ZQPhnPMOVtU+f0arbFPWCus= github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= @@ -637,6 +657,7 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -748,6 +769,7 @@ github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIG github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -821,6 +843,7 @@ github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3 github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= +github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= @@ -919,6 +942,7 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= @@ -970,6 +994,7 @@ github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs 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= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -979,6 +1004,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -999,6 +1025,7 @@ github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5j github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1140,11 +1167,13 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1164,6 +1193,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= @@ -1272,6 +1302,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1423,6 +1454,7 @@ github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= @@ -1430,6 +1462,7 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= @@ -1486,6 +1519,7 @@ github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2f gitlab.com/bosi/decorder v0.4.0 h1:HWuxAhSxIvsITcXeP+iIRg9d1cVfvVkmlF7M68GaoDY= gitlab.com/bosi/decorder v0.4.0/go.mod h1:xarnteyUoJiOTEldDysquWKTVDCKo2TOIOIibSuWqOg= go-simpler.org/assert v0.6.0 h1:QxSrXa4oRuo/1eHMXSBFHKvJIpWABayzKldqZyugG7E= +go-simpler.org/assert v0.6.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= @@ -1523,6 +1557,7 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -2271,6 +2306,7 @@ mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d/go.mod h1:IeHQjmn6TOD+e4Z3RF nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= +pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/tests/e2e/docker/gaia.Dockerfile b/tests/e2e/docker/gaia.Dockerfile index 1d6b734853..ea41403453 100644 --- a/tests/e2e/docker/gaia.Dockerfile +++ b/tests/e2e/docker/gaia.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20-alpine +FROM golang:1.21-alpine ARG GAIA_VERSION=v5.0.7 ENV PACKAGES curl make git libc-dev bash gcc linux-headers