From ab17732fa420092097a5082a679ffd1d2d34d121 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 21 Dec 2023 09:43:30 -0800 Subject: [PATCH 1/4] remove parse coins from core, add it to client/v2 internal --- client/v2/autocli/flag/coin.go | 2 +- {core => client/v2/internal}/coins/format.go | 0 {core => client/v2/internal}/coins/format_test.go | 2 +- x/tx/signing/textual/coins_test.go | 6 +++--- 4 files changed, 5 insertions(+), 5 deletions(-) rename {core => client/v2/internal}/coins/format.go (100%) rename {core => client/v2/internal}/coins/format_test.go (88%) diff --git a/client/v2/autocli/flag/coin.go b/client/v2/autocli/flag/coin.go index 222f4805fc0..8496a2b0f65 100644 --- a/client/v2/autocli/flag/coin.go +++ b/client/v2/autocli/flag/coin.go @@ -8,7 +8,7 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/core/coins" + "cosmossdk.io/client/v2/internal/coins" ) type coinType struct{} diff --git a/core/coins/format.go b/client/v2/internal/coins/format.go similarity index 100% rename from core/coins/format.go rename to client/v2/internal/coins/format.go diff --git a/core/coins/format_test.go b/client/v2/internal/coins/format_test.go similarity index 88% rename from core/coins/format_test.go rename to client/v2/internal/coins/format_test.go index c9804c202e2..4cddeb7cfdb 100644 --- a/core/coins/format_test.go +++ b/client/v2/internal/coins/format_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "cosmossdk.io/core/coins" + "cosmossdk.io/client/v2/internal/coins" ) func TestDecodeCoin(t *testing.T) { diff --git a/x/tx/signing/textual/coins_test.go b/x/tx/signing/textual/coins_test.go index 18b84398995..9ffc7f7bb6d 100644 --- a/x/tx/signing/textual/coins_test.go +++ b/x/tx/signing/textual/coins_test.go @@ -11,7 +11,7 @@ import ( bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/core/coins" + "cosmossdk.io/math" "cosmossdk.io/x/tx/signing/textual" ) @@ -126,7 +126,7 @@ func TestFormatCoin(t *testing.T) { for _, tc := range testcases { t.Run(tc.Text, func(t *testing.T) { if tc.Proto != nil { - out, err := coins.FormatCoins([]*basev1beta1.Coin{tc.Proto}, []*bankv1beta1.Metadata{tc.Metadata}) + out, err := textual.FormatCoins([]*basev1beta1.Coin{tc.Proto}, []*bankv1beta1.Metadata{tc.Metadata}) if tc.Error { require.Error(t, err) @@ -155,7 +155,7 @@ func TestFormatCoins(t *testing.T) { metadata[i] = tc.Metadata[coin.Denom] } - out, err := coins.FormatCoins(tc.Proto, metadata) + out, err := textual.FormatCoins(tc.Proto, metadata) if tc.Error { require.Error(t, err) From 0b725b326364b66ae0e47d6d2a6281031be4555e Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 21 Dec 2023 09:45:48 -0800 Subject: [PATCH 2/4] add changelog to core for api breaking change --- core/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index a01b3ca4641..71e06fa3727 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking * [#18857](https://github.com/cosmos/cosmos-sdk/pull/18857) Moved `FormatCoins` to `x/tx`. +* [#18861](httpes://github.com/cosmos/cosmos-sdk/pull/18861) Moved `coin.ParseCoin` to `client/v2/internal`. ## [v0.12.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.11.0) From 9af903e2028f98f0867aca821e0f8c4e6fe6ff23 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 21 Dec 2023 09:46:42 -0800 Subject: [PATCH 3/4] go mod tidy --- core/go.mod | 4 ---- core/go.sum | 8 -------- 2 files changed, 12 deletions(-) diff --git a/core/go.mod b/core/go.mod index 45b8c6cbf50..00b5fff3e58 100644 --- a/core/go.mod +++ b/core/go.mod @@ -5,7 +5,6 @@ go 1.20 require ( cosmossdk.io/api v0.7.2 cosmossdk.io/depinject v1.0.0-alpha.4 - cosmossdk.io/math v1.2.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 github.com/stretchr/testify v1.8.4 google.golang.org/grpc v1.60.1 @@ -18,7 +17,6 @@ require ( github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/getsentry/sentry-go v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -33,8 +31,6 @@ require ( golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/core/go.sum b/core/go.sum index 3fdcb56f087..b82be513d27 100644 --- a/core/go.sum +++ b/core/go.sum @@ -2,8 +2,6 @@ cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= -cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= -cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= @@ -12,8 +10,6 @@ github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwP github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -81,10 +77,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= -google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= -google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= -google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= From 1b9df7e6772261ce7f6272110d2b437708431f5c Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 21 Dec 2023 10:07:47 -0800 Subject: [PATCH 4/4] lint fix --- x/tx/signing/textual/coins_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/tx/signing/textual/coins_test.go b/x/tx/signing/textual/coins_test.go index 9ffc7f7bb6d..c9e1bbf6dd7 100644 --- a/x/tx/signing/textual/coins_test.go +++ b/x/tx/signing/textual/coins_test.go @@ -11,7 +11,6 @@ import ( bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/math" "cosmossdk.io/x/tx/signing/textual" )