Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: fix gentx parser into the cosmosutil package (#4402) #4406

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading