Skip to content

Commit

Permalink
post-merge: update majority of bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Dec 8, 2023
1 parent b16d84d commit c2a70a1
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 251 deletions.
194 changes: 0 additions & 194 deletions cmd/gaiad/cmd/genaccounts.go

This file was deleted.

8 changes: 6 additions & 2 deletions tests/e2e/e2e_exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g
s.T().Logf("Successfully executed %s", govCommand)
}

// NOTE: Tx unused, left here for future reference
// func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name string, home string) string {
// ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
// defer cancel()
Expand All @@ -448,7 +449,8 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g
// return addrRecord.Address
// }

// func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string) {
// NOTE: Tx unused, left here for future reference
// func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string) { // nolint:U1000
// ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
// defer cancel()

Expand Down Expand Up @@ -678,6 +680,7 @@ func (s *IntegrationTestSuite) execWithdrawReward(
}

func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chain, gaiaCommand []string, valIdx int, validation func([]byte, []byte) bool) {
fmt.Println("## RUNNING #XEC ###", gaiaCommand)
if validation == nil {
validation = s.defaultExecValidation(s.chainA, 0)
}
Expand Down Expand Up @@ -705,7 +708,8 @@ func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chai

stdOut := outBuf.Bytes()
stdErr := errBuf.Bytes()

fmt.Println("## EXECUTED STDOUT ###", string(stdOut))
fmt.Println("## EXECUTED STDERR ###", string(stdErr))
if !validation(stdOut, stdErr) {
s.Require().FailNowf("Exec validation failed", "stdout: %s, stderr: %s",
string(stdOut), string(stdErr))
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/e2e_lsm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

Expand All @@ -20,17 +19,18 @@ func (s *IntegrationTestSuite) testLSM() {

validatorAddressA := sdk.ValAddress(validatorAAddr).String()

// Set parameters (global liquid staking cap, validator liquid staking cap, validator bond factor)
s.writeLiquidStakingParamsUpdateProposal(s.chainA)
oldStakingParams, err := queryStakingParams(chainEndpoint)
s.Require().NoError(err)
s.writeLiquidStakingParamsUpdateProposal(s.chainA, oldStakingParams.Params)
proposalCounter++
submitGovFlags := []string{"param-change", configFile(proposalLSMParamUpdateFilename)}
submitGovFlags := []string{configFile(proposalLSMParamUpdateFilename)}
depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()}
voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"}

// gov proposing LSM parameters (global liquid staking cap, validator liquid staking cap, validator bond factor)
s.T().Logf("Proposal number: %d", proposalCounter)
s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: Set parameters (global liquid staking cap, validator liquid staking cap, validator bond factor)")
s.runGovProcess(chainEndpoint, validatorAAddr.String(), proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
s.runGovProcessV1(chainEndpoint, validatorAAddr.String(), proposalCounter, "stakingtypes.MsgUpdateProposal", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)

// query the proposal status and new fee
s.Require().Eventually(
Expand Down
74 changes: 36 additions & 38 deletions tests/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,45 +910,43 @@ func (s *IntegrationTestSuite) writeGovLegProposal(c *chain, height int64, name
s.Require().NoError(err)
}

func (s *IntegrationTestSuite) writeLiquidStakingParamsUpdateProposal(c *chain) {
type ParamInfo struct {
Subspace string `json:"subspace"`
Key string `json:"key"`
Value sdk.Dec `json:"value"`
}

type ParamChangeMessage struct {
Title string `json:"title"`
Description string `json:"description"`
Changes []ParamInfo `json:"changes"`
Deposit string `json:"deposit"`
}

paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{
Title: "liquid staking params update",
Description: "liquid staking params update",
Changes: []ParamInfo{
{
Subspace: "staking",
Key: "GlobalLiquidStakingCap",
Value: sdk.NewDecWithPrec(25, 2), // 25%
},
{
Subspace: "staking",
Key: "ValidatorLiquidStakingCap",
Value: sdk.NewDecWithPrec(50, 2), // 50%
},
{
Subspace: "staking",
Key: "ValidatorBondFactor",
Value: sdk.NewDec(250), // -1
},
},
Deposit: "1000uatom",
}, "", " ")
s.Require().NoError(err)
func (s *IntegrationTestSuite) writeLiquidStakingParamsUpdateProposal(c *chain, oldParams stakingtypes.Params) {
template := `
{
"messages": [
{
"@type": "/cosmos.staking.v1beta1.MsgUpdateParams",
"authority": "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn",
"params": {
"unbonding_time": "%s",
"max_validators": %d,
"max_entries": %d,
"historical_entries": %d,
"bond_denom": "",
"min_commission_rate": "%s",
"validator_bond_factor":" %s,"
"global_liquid_staking_cap": "%s",
"validator_liquid_staking_cap": "%s"
}
}
],
"metadata": "ipfs://CID",
"deposit": "0uatom",
"title": "Update LSM Params",
"summary": "e2e-test updating LSM staking params"
}`
propMsgBody := fmt.Sprintf(template,
oldParams.UnbondingTime,
oldParams.MaxValidators,
oldParams.MaxEntries,
oldParams.HistoricalEntries,
oldParams.MinCommissionRate,
sdk.NewDec(250), // validator bond factor
sdk.NewDecWithPrec(25, 2), // 25 global_liquid_staking_cap
sdk.NewDecWithPrec(50, 2), // 50 validator_liquid_staking_cap
)

err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalLSMParamUpdateFilename), paramChangeProposalBody)
err := writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalLSMParamUpdateFilename), []byte(propMsgBody))
s.Require().NoError(err)
}

Expand Down
24 changes: 12 additions & 12 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ package e2e
import "fmt"

var (
runBankTest = true
runBypassMinFeeTest = true
runEncodeTest = true
runEvidenceTest = true
runFeeGrantTest = true
runGlobalFeesTest = true
runGovTest = true
runIBCTest = true
runSlashingTest = true
runStakingAndDistributionTest = true
runVestingTest = true
runRestInterfacesTest = true
runBankTest = false
runBypassMinFeeTest = false
runEncodeTest = false
runEvidenceTest = false
runFeeGrantTest = false
runGlobalFeesTest = false
runGovTest = false
runIBCTest = false
runSlashingTest = false
runStakingAndDistributionTest = false
runVestingTest = false
runRestInterfacesTest = false
runLsmTest = true
)

Expand Down

0 comments on commit c2a70a1

Please sign in to comment.