Skip to content

Commit

Permalink
Revert "fix: fix gentx parser into the cosmosutil package (#4402)"
Browse files Browse the repository at this point in the history
This reverts commit bf2539d.
  • Loading branch information
julienrbrt authored Nov 12, 2024
1 parent bf2539d commit 59fa61f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 2 additions & 6 deletions ignite/pkg/cosmosutil/gentx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions ignite/pkg/cosmosutil/gentx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion ignite/pkg/cosmosutil/testdata/gentx2.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"max_rate": "0.200000000000000000",
"rate": "0.100000000000000000"
},
"delegator_address": "",
"delegator_address": "cosmos1mmlqwyqk7neqegffp99q86eckpm4pjah3ytlpa",
"description": {
"details": "",
"identity": "",
Expand Down

0 comments on commit 59fa61f

Please sign in to comment.