From 59fa61f06cdf1cf3fa9c0d9c8f8317aefceb157b Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 12 Nov 2024 09:17:31 +0100 Subject: [PATCH] Revert "fix: fix gentx parser into the cosmosutil package (#4402)" This reverts commit bf2539d6aa92f18171434dd43493a4053e04b03e. --- changelog.md | 1 - ignite/pkg/cosmosutil/gentx.go | 8 ++------ ignite/pkg/cosmosutil/gentx_test.go | 4 +--- ignite/pkg/cosmosutil/testdata/gentx2.json | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 13a54de489..708e79f889 100644 --- a/changelog.md +++ b/changelog.md @@ -52,7 +52,6 @@ - [#4000](https://github.com/ignite/cli/pull/4000) Run all dry runners before the wet run in the `xgenny` pkg - [#4091](https://github.com/ignite/cli/pull/4091) Fix race conditions in the plugin logic - [#4128](https://github.com/ignite/cli/pull/4128) Check for duplicate proto fields in config -- [#4402](https://github.com/ignite/cli/pull/4402) Fix gentx parser into the cosmosutil package ## [`v28.5.3`](https://github.com/ignite/cli/releases/tag/v28.5.3) diff --git a/ignite/pkg/cosmosutil/gentx.go b/ignite/pkg/cosmosutil/gentx.go index 9ec7905dba..4951414df7 100644 --- a/ignite/pkg/cosmosutil/gentx.go +++ b/ignite/pkg/cosmosutil/gentx.go @@ -7,20 +7,17 @@ import ( sdkmath "cosmossdk.io/math" - "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cometbft/cometbft/crypto/ed25519" + "github.com/ignite/cli/v29/ignite/pkg/errors" ) type ( // GentxInfo represents the basic info about gentx file. GentxInfo struct { - // Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. - // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer - // only in bech32 notation). DelegatorAddress string - ValidatorAddress string PubKey ed25519.PubKey SelfDelegation sdk.Coin Memo string @@ -78,7 +75,6 @@ func ParseGentx(gentxBz []byte) (info GentxInfo, err error) { info.Memo = gentx.Body.Memo info.DelegatorAddress = gentx.Body.Messages[0].DelegatorAddress - info.ValidatorAddress = gentx.Body.Messages[0].ValidatorAddress pb := gentx.Body.Messages[0].PubKey.Key info.PubKey, err = base64.StdEncoding.DecodeString(pb) diff --git a/ignite/pkg/cosmosutil/gentx_test.go b/ignite/pkg/cosmosutil/gentx_test.go index 0c890c32d6..7811ad09e2 100644 --- a/ignite/pkg/cosmosutil/gentx_test.go +++ b/ignite/pkg/cosmosutil/gentx_test.go @@ -29,7 +29,6 @@ func TestParseGentx(t *testing.T) { gentxPath: "testdata/gentx1.json", wantInfo: cosmosutil.GentxInfo{ DelegatorAddress: "cosmos1dd246yq6z5vzjz9gh8cff46pll75yyl8ygndsj", - ValidatorAddress: "cosmosvaloper1dd246yq6z5vzjz9gh8cff46pll75yyl8pu8cup", PubKey: ed25519.PubKey(pk1), SelfDelegation: sdk.Coin{ Denom: "stake", @@ -41,8 +40,7 @@ func TestParseGentx(t *testing.T) { name: "parse gentx file 2", gentxPath: "testdata/gentx2.json", wantInfo: cosmosutil.GentxInfo{ - DelegatorAddress: "", - ValidatorAddress: "cosmosvaloper1mmlqwyqk7neqegffp99q86eckpm4pjah5sl2dw", + DelegatorAddress: "cosmos1mmlqwyqk7neqegffp99q86eckpm4pjah3ytlpa", PubKey: ed25519.PubKey(pk2), SelfDelegation: sdk.Coin{ Denom: "stake", diff --git a/ignite/pkg/cosmosutil/testdata/gentx2.json b/ignite/pkg/cosmosutil/testdata/gentx2.json index 24357d5a17..65c3342848 100644 --- a/ignite/pkg/cosmosutil/testdata/gentx2.json +++ b/ignite/pkg/cosmosutil/testdata/gentx2.json @@ -37,7 +37,7 @@ "max_rate": "0.200000000000000000", "rate": "0.100000000000000000" }, - "delegator_address": "", + "delegator_address": "cosmos1mmlqwyqk7neqegffp99q86eckpm4pjah3ytlpa", "description": { "details": "", "identity": "",