params

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 9 Imported by: 0

README

Params module

Usage

(Tx) Proposal parameter change
// Input arguments
paramChangeMsg := types.ParamChangeMsg{
    Title: "Staking param change",
    Description: "update max validators",
    Changes: []string{
        `{
            "subspace": "staking",
            "key": "MaxValidators",
            "value": 105
        }`,
    },
    Deposit: "1000",
}

// Input json file
paramChangeMsg := types.ParamChangeMsg{
    JsonFilePath: "./proposal.json"
}

txbytes, err := xplac.ParamChange(paramChangeMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)
(Query) Query params by using subspace
subspaceMsg := types.SubspaceMsg{
    Subspace: "staking",
    Key: "MaxValidators",
}

res, err := xplac.QuerySubspace(subspaceMsg).Query()

Documentation

Index

Constants

View Source
const (
	ParamsModule                     = "params"
	ParamsProposalParamChangeMsgType = "proposal-param-change"
	ParamsQuerySubpsaceMsgType       = "params-subspace"
)

Variables

This section is empty.

Functions

func MakeProposalParamChangeMsg

func MakeProposalParamChangeMsg(paramChangeMsg types.ParamChangeMsg, privKey key.PrivateKey, encodingConfig params.EncodingConfig) (govtypes.MsgSubmitProposal, error)

(Tx) make msg - param change

func MakeQueryParamsSubspaceMsg

func MakeQueryParamsSubspaceMsg(subspaceMsg types.SubspaceMsg) (paramsproposal.QueryParamsRequest, error)

(Query) make msg - subspace

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL