Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed Jan 15, 2024
1 parent 0f065e0 commit 51be26f
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 118 deletions.
5 changes: 0 additions & 5 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,8 @@ func NewAppKeeper(
ibcRouter := porttypes.NewRouter()

// Middleware Stacks

// TODO: Move inline
appKeepers.TransferModule = transfer.NewAppModule(appKeepers.TransferKeeper)
// TODO: Move inline
appKeepers.ICAModule = ica.NewAppModule(nil, &appKeepers.ICAHostKeeper)
// TODO: Move inline
appKeepers.PFMRouterModule = pfmrouter.NewAppModule(appKeepers.PFMRouterKeeper, appKeepers.GetSubspace(pfmroutertypes.ModuleName))

// create IBC module from bottom to top of stack
Expand Down Expand Up @@ -449,7 +445,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)

paramsKeeper.Subspace(pfmroutertypes.ModuleName).WithKeyTable(pfmroutertypes.ParamKeyTable())
paramsKeeper.Subspace(globalfee.ModuleName)
paramsKeeper.Subspace(providertypes.ModuleName)
Expand Down
3 changes: 0 additions & 3 deletions buf.work.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Generated by "buf config migrate-v1beta1". Edit as necessary, and
# remove this comment when you're finished.
#
# This workspace file points to the roots found in your
# previous "buf.yaml" configuration.
version: v1
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/e2e_globalfee_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (s *IntegrationTestSuite) govProposeNewGlobalfee(newGlobalfee sdk.DecCoins,
// gov proposing new fees
s.T().Logf("Proposal number: %d", proposalCounter)
s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change global fee to %s", newGlobalfee.String())
s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
s.submitLegacyGovProposal(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)

// query the proposal status and new fee
s.Require().Eventually(
Expand Down Expand Up @@ -57,7 +57,7 @@ func (s *IntegrationTestSuite) govProposeNewBypassMsgs(newBypassMsgs []string, p
// gov proposing new fees
s.T().Logf("Proposal number: %d", proposalCounter)
s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change bypass min fee msg types to %s", newBypassMsgs)
s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
s.submitLegacyGovProposal(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)

// query the proposal status and new fee
s.Require().Eventually(
Expand Down Expand Up @@ -95,7 +95,7 @@ func (s *IntegrationTestSuite) govProposeNewMaxTotalBypassMinFeeMsgGasUsage(newG
// gov proposing new max gas usage for bypass msgs
s.T().Logf("Proposal number: %d", proposalCounter)
s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change maxTotalBypassMinFeeMsgGasUsage to %d", newGas)
s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
s.submitLegacyGovProposal(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)

// query the proposal status and max gas usage for bypass msgs
s.Require().Eventually(
Expand Down
16 changes: 6 additions & 10 deletions tests/e2e/e2e_gov_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (s *IntegrationTestSuite) GovSoftwareUpgrade() {

depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()}
voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes=0.8,no=0.1,abstain=0.05,no_with_veto=0.05"}
s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", true)
s.submitLegacyGovProposal(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", true)

s.verifyChainHaltedAtUpgradeHeight(s.chainA, 0, proposalHeight)
s.T().Logf("Successfully halted chain at height %d", proposalHeight)
Expand Down Expand Up @@ -94,13 +94,13 @@ func (s *IntegrationTestSuite) GovCancelSoftwareUpgrade() {

depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()}
voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"}
s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true)
s.submitLegacyGovProposal(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true)

proposalCounter++
submitGovFlags = []string{"cancel-software-upgrade", "--title='Upgrade V1'", "--description='Software Upgrade'"}
depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()}
voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"}
s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeCancelSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true)
s.submitLegacyGovProposal(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeCancelSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true)

s.verifyChainPassesUpgradeHeight(s.chainA, 0, proposalHeight)
s.T().Logf("Successfully canceled upgrade at height %d", proposalHeight)
Expand Down Expand Up @@ -132,7 +132,7 @@ func (s *IntegrationTestSuite) GovCommunityPoolSpend() {
depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()}
voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"}
// TODO: replace proposal type by distrtypes.ProposalTypeCommunityPoolSpend equivalent in SDK v0.47
s.runGovProcessV1(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)

s.Require().Eventually(
func() bool {
Expand All @@ -146,9 +146,7 @@ func (s *IntegrationTestSuite) GovCommunityPoolSpend() {
)
}

// NOTE: @MSalopek
// rename to runGovLegacyProcess or submitLegacyGovProposal
func (s *IntegrationTestSuite) runGovProcess(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) {
func (s *IntegrationTestSuite) submitLegacyGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) {
s.T().Logf("Submitting Gov Proposal: %s", proposalType)
// min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped
sflags := submitFlags
Expand All @@ -162,9 +160,7 @@ func (s *IntegrationTestSuite) runGovProcess(chainAAPIEndpoint, sender string, p
s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1beta1.StatusPassed)
}

// NOTE: @MSalopek
// rename to runGovProcess or submitGovProposal
func (s *IntegrationTestSuite) runGovProcessV1(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) {
func (s *IntegrationTestSuite) submitGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) {
s.T().Logf("Submitting Gov Proposal: %s", proposalType)
// min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped
sflags := submitFlags
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/e2e_ics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (s *IntegrationTestSuite) AddRemoveConsumerChain() {
submitGovFlags := []string{"consumer-addition", configFile(proposalAddConsumerChainFilename)}
depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()}
voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"}
s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, providertypes.ProposalTypeConsumerAddition, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
s.submitLegacyGovProposal(chainAAPIEndpoint, sender, proposalCounter, providertypes.ProposalTypeConsumerAddition, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)

// Query and assert consumer has been added
s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerAddition, consumerChainID)
Expand All @@ -112,7 +112,7 @@ func (s *IntegrationTestSuite) AddRemoveConsumerChain() {
submitGovFlags = []string{"consumer-removal", configFile(proposalRemoveConsumerChainFilename)}
depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()}
voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"}
s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, providertypes.ProposalTypeConsumerRemoval, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
s.submitLegacyGovProposal(chainAAPIEndpoint, sender, proposalCounter, providertypes.ProposalTypeConsumerRemoval, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
// Query and assert consumer has been removed
s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerRemoval, consumerChainID)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_lsm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (s *IntegrationTestSuite) testLSM() {
// 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.runGovProcessV1(chainEndpoint, validatorAAddr.String(), proposalCounter, "stakingtypes.MsgUpdateProposal", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
s.submitGovProposal(chainEndpoint, validatorAAddr.String(), proposalCounter, "stakingtypes.MsgUpdateProposal", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)

// query the proposal status and new fee
s.Require().Eventually(
Expand Down
13 changes: 0 additions & 13 deletions tests/e2e/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,6 @@ func queryContinuousVestingAccount(endpoint, address string) (authvesting.Contin
return *acc, nil
}

// func queryPermanentLockedAccount(endpoint, address string) (authvesting.PermanentLockedAccount, error) { //nolint:unused // this is called during e2e tests
// baseAcc, err := queryAccount(endpoint, address)
// if err != nil {
// return authvesting.PermanentLockedAccount{}, err
// }
// acc, ok := baseAcc.(*authvesting.PermanentLockedAccount)
// if !ok {
// return authvesting.PermanentLockedAccount{},
// fmt.Errorf("cannot cast %v to PermanentLockedAccount", baseAcc)
// }
// return *acc, nil
// }

func queryPeriodicVestingAccount(endpoint, address string) (authvesting.PeriodicVestingAccount, error) { //nolint:unused // this is called during e2e tests
baseAcc, err := queryAccount(endpoint, address)
if err != nil {
Expand Down
8 changes: 0 additions & 8 deletions x/globalfee/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne
return ctx, err
}

ctx.Logger().Info(fmt.Sprintf("FeeCoins: %v", feeTx.GetFee()))
ctx.Logger().Info(fmt.Sprintf("FeeRequired: %v", feeRequired))

// reject the transaction early if the feeCoins have more denoms than the fee requirement

// feeRequired cannot be empty
Expand Down Expand Up @@ -107,11 +104,6 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne
doesNotExceedMaxGasUsage := gas <= maxTotalBypassMinFeeMsgGasUsage
allBypassMsgs := mfd.ContainsOnlyBypassMinFeeMsgs(ctx, msgs)
allowedToBypassMinFee := allBypassMsgs && doesNotExceedMaxGasUsage
ctx.Logger().Info(fmt.Sprintf("gas: %v", gas))
ctx.Logger().Info(fmt.Sprintf("allBypassMsgs: %v", allBypassMsgs))
ctx.Logger().Info(fmt.Sprintf("maxTotalBypassMinFeeMsgGasUsage: %v", maxTotalBypassMinFeeMsgGasUsage))
ctx.Logger().Info(fmt.Sprintf("doesNotExceedMaxGasUsage: %v", doesNotExceedMaxGasUsage))
ctx.Logger().Info(fmt.Sprintf("allowedToBypassMinFee: %v", allowedToBypassMinFee))

if allowedToBypassMinFee {
ctx.Logger().Info("Pass allowedToBypassMinFee check")
Expand Down
73 changes: 0 additions & 73 deletions x/globalfee/querier_test.go

This file was deleted.

0 comments on commit 51be26f

Please sign in to comment.