Skip to content

Commit 06e7abd

Browse files
committed
try fix ic test
1 parent 0b5ff05 commit 06e7abd

8 files changed

Lines changed: 25 additions & 15 deletions

interchaintest/chain_upgrade_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func CosmosChainUpgradeTest(
8181
}},
8282
CoinDecimals: &helpers.PersistenceCoinDecimals,
8383
GasPrices: fmt.Sprintf("0%s", helpers.PersistenceBondDenom),
84-
EncodingConfig: persistenceEncoding(),
84+
EncodingConfig: PersistenceEncoding(),
8585
ModifyGenesis: cosmos.ModifyGenesis(defaultGenesisOverridesKV),
8686
}
8787

interchaintest/helpers/staking.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func QueryAllValidators(t *testing.T, ctx context.Context, chainNode *cosmos.Cha
1919
debugOutput(t, string(stdout))
2020

2121
var resp queryValidatorsResponse
22-
err = json.Unmarshal([]byte(stdout), &resp)
22+
err = json.Unmarshal(stdout, &resp)
2323
require.NoError(t, err)
2424

2525
return resp.Validators
@@ -38,7 +38,7 @@ func QueryValidator(
3838
debugOutput(t, string(stdout))
3939

4040
var validator Validator
41-
err = json.Unmarshal([]byte(stdout), &validator)
41+
err = json.Unmarshal(stdout, &validator)
4242
require.NoError(t, err)
4343

4444
return validator
@@ -58,7 +58,7 @@ func QueryDelegation(
5858
debugOutput(t, string(stdout))
5959

6060
var resp queryDelegationResponse
61-
err = json.Unmarshal([]byte(stdout), &resp)
61+
err = json.Unmarshal(stdout, &resp)
6262
require.NoError(t, err)
6363

6464
return resp.Delegation
@@ -77,7 +77,7 @@ func QueryUnbondingDelegations(
7777
debugOutput(t, string(stdout))
7878

7979
var resp queryUnbondingDelegationsResponse
80-
err = json.Unmarshal([]byte(stdout), &resp)
80+
err = json.Unmarshal(stdout, &resp)
8181
require.NoError(t, err)
8282

8383
return resp.UnbondingResponses
@@ -115,7 +115,7 @@ func QueryTotalLiquidStaked(
115115
debugOutput(t, string(stdout))
116116

117117
var resp queryTotalLiquidStaked
118-
err = json.Unmarshal([]byte(stdout), &resp)
118+
err = json.Unmarshal(stdout, &resp)
119119
require.NoError(t, err)
120120

121121
return resp.Tokens

interchaintest/liquidstake_stkxprt_globalcap_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ func TestLiquidStakeGlobalCapStkXPRT(t *testing.T) {
142142
proposalID, err := strconv.ParseUint(upgradeTx.ProposalID, 10, 64)
143143
require.NoError(t, err, "error parsing proposal id")
144144

145+
proposal, err := chain.GovQueryProposalV1(ctx, proposalID)
146+
require.NoError(t, err, "error getting proposal")
147+
t.Log(proposal)
148+
require.Equal(t, govv1.StatusVotingPeriod, proposal.Status)
149+
145150
err = chain.VoteOnProposalAllValidators(ctx, proposalID, cosmos.ProposalVoteYes)
146151
require.NoError(t, err, "failed to submit votes")
147152

interchaintest/liquidstake_stkxprt_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ func TestLiquidStakeStkXPRT(t *testing.T) {
136136

137137
proposal, err := chain.GovQueryProposalV1(ctx, proposalID)
138138
require.NoError(t, err, "error getting proposal")
139-
require.Equal(t, govv1.StatusVotingPeriod, proposal.Status)
140139
t.Log(proposal)
140+
require.Equal(t, govv1.StatusVotingPeriod, proposal.Status, "proposal status equal check")
141141

142142
err = chain.VoteOnProposalAllValidators(ctx, proposalID, cosmos.ProposalVoteYes)
143143
require.NoError(t, err, "failed to submit votes")

interchaintest/lsm_bond_tokenize_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,13 @@ func TestBondTokenize(t *testing.T) {
5959
"staking", "delegate", validators[0].OperatorAddress, firstUserDelegationCoins.String(),
6060
"--gas=auto",
6161
)
62+
6263
require.NoError(t, err)
6364

65+
delegation := helpers.QueryDelegation(t, ctx, chainNode, firstUser.FormattedAddress(), validators[0].OperatorAddress)
66+
require.Equal(t, math.LegacyNewDecFromInt(firstUserDelegationCoins.Amount), delegation.Shares, "compare first user delegated amounts to delegation.shares")
67+
require.False(t, delegation.ValidatorBond)
68+
6469
// Delegate from second user
6570
secondUserDelegationAmount := math.NewInt(1_000_000)
6671
secondUserDelegationCoins := sdk.NewCoin(testDenom, secondUserDelegationAmount)
@@ -70,11 +75,11 @@ func TestBondTokenize(t *testing.T) {
7075
)
7176
require.NoError(t, err)
7277

73-
delegation := helpers.QueryDelegation(t, ctx, chainNode, secondUser.FormattedAddress(), validators[0].OperatorAddress)
74-
require.Equal(t, math.LegacyNewDecFromInt(secondUserDelegationCoins.Amount), delegation.Shares)
78+
delegation = helpers.QueryDelegation(t, ctx, chainNode, secondUser.FormattedAddress(), validators[0].OperatorAddress)
79+
require.Equal(t, math.LegacyNewDecFromInt(secondUserDelegationCoins.Amount), delegation.Shares, "compare second user delegated amounts to delegation.shares")
7580
require.False(t, delegation.ValidatorBond)
7681

77-
// Try to tokenize shares from first user, it won't work because there is no minimal bond
82+
// Try to tokenize shares from the first user, it won't work because there is no minimal bond
7883
tokenizeCoins := sdk.NewCoin(testDenom, math.NewInt(250_000_000))
7984
txHash, err := chainNode.ExecTx(ctx, firstUser.KeyName(),
8085
"staking", "tokenize-share", validators[0].OperatorAddress, tokenizeCoins.String(), firstUser.FormattedAddress(),

interchaintest/lsm_halt_fork_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestPersistenceLSMHaltFork(t *testing.T) {
5151
}},
5252

5353
GasPrices: fmt.Sprintf("0%s", helpers.PersistenceBondDenom),
54-
EncodingConfig: persistenceEncoding(),
54+
EncodingConfig: PersistenceEncoding(),
5555
ModifyGenesis: cosmos.ModifyGenesis(defaultGenesisOverridesKV),
5656
}
5757

interchaintest/module_pfm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestPacketForwardMiddleware(t *testing.T) {
7070
TrustingPeriod: "112h",
7171
NoHostMount: false,
7272
ConfigFileOverrides: nil,
73-
EncodingConfig: persistenceEncoding(),
73+
EncodingConfig: PersistenceEncoding(),
7474
ModifyGenesis: cosmos.ModifyGenesis(defaultGenesisOverridesKV),
7575
}
7676

interchaintest/setup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ var (
8686
genesisWalletAmount = math.NewInt(10_000_000)
8787
)
8888

89-
// persistenceEncoding registers the persistenceCore specific module codecs so that the associated types and msgs
89+
// PersistenceEncoding registers the persistenceCore specific module codecs so that the associated types and msgs
9090
// will be supported when writing to the blocksdb sqlite database.
91-
func persistenceEncoding() *testutil.TestEncodingConfig {
91+
func PersistenceEncoding() *testutil.TestEncodingConfig {
9292
cfg := cosmos.DefaultEncoding()
9393

9494
// register custom types
@@ -119,7 +119,7 @@ func persistenceChainConfig(
119119
TrustingPeriod: "112h",
120120
NoHostMount: false,
121121
ConfigFileOverrides: nil,
122-
EncodingConfig: persistenceEncoding(),
122+
EncodingConfig: PersistenceEncoding(),
123123
ModifyGenesis: cosmos.ModifyGenesis(genesisOverrides),
124124

125125
Images: []ibc.DockerImage{

0 commit comments

Comments
 (0)