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

feat: use proposal for cross chain parameter governance #110

Merged
merged 12 commits into from
Feb 24, 2023
Merged

Conversation

alexgao001
Copy link
Collaborator

@alexgao001 alexgao001 commented Feb 17, 2023

Description

  1. enable params change proposal for cross chain governance.
  2. get rid of gov v1beta1 servers.

Rationale

to modify BSC contract params or upgrade contract

Example

var paramChanges []paramstypes.ParamChange
paramChanges = append(paramChanges,
paramstypes.ParamChange{
	Subspace: "BSC",
	Key:      "batchSizeForOracle",
	Value:    "0000000000000000000000000000000000000000000000000000000000000033",
})
content := paramstypes.NewCrossChainParameterChangeProposal(
"change smart contract params",
"change smart contract params",
paramChanges,
[]string{"0xB5EE9c977f4A1679Af2025FD6a1FaC7240c9D50D"},
)
govAcctAddress := authtypes.NewModuleAddress(govtypes.ModuleName).String()
contentMsg, _ := govv1.NewLegacyContent(content, govAcctAddress)
msg, _ := govv1.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, InitDeposit, from, "")

Changes

Notable changes:

  • add bool crossChain field to paramstype.parameterChangepPoposal
  • emit cross chain event in params handler which called by gov endBlocker

@alexgao001 alexgao001 changed the title Feat gov feat: use proposal for cross chain parameter governance Feb 17, 2023
@github-actions github-actions bot added the C:CLI label Feb 20, 2023
@@ -4,6 +4,9 @@ import (
"fmt"
"strings"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls fix the imports order

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make lint-fix does not find, what should fix?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can refer to the format.sh in greenfield repo

@@ -5,6 +5,8 @@ import (
"strconv"
"strings"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls fix the imports order

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

x/gov/module.go Outdated Show resolved Hide resolved
@unclezoro unclezoro merged commit 7707c68 into develop Feb 24, 2023
@unclezoro unclezoro deleted the feat-gov branch April 18, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants