testnet
GitHub

Msg/UpdateParams

UpdateParams(authority: string, params: Params) → MsgUpdateParamsResponse

Updates the parameters of the x/pcl module. This is a privileged transaction that can only be executed by the current module authority, which is typically the governance module. Its primary use is to set or change the PolicyAdmin address.

Parameters

Name Type Required Description
authority string The Bech32 address of the account authorized to update the module parameters. By default, this is the address of the x/gov module.
params object (Params) The new parameters to set for the module. Currently, this only contains the policy_admin field.

Returns

Type: object (MsgUpdateParamsResponse)

An empty response object indicating the successful update of parameters.

Errors

Code Name Description
sdkerror.ErrInvalidAddress InvalidAddress Returned if the provided `authority` address or the `policy_admin` address in `params` is not a valid Bech32 address.
sdkerror.ErrUnauthorized Unauthorized Returned if the `authority` address in the message does not match the module's configured authority address.

Examples

Set the initial Policy Admin via Governance Proposal

This example shows the content of a `proposal.json` file for an on-chain governance proposal to set the `policy_admin`. The `authority` is the governance module's own address.

{
  "messages": [
    {
      "@type": "/maroo.pcl.v1.MsgUpdateParams",
      "authority": "maroo10d07y265gmmuvt4z0w9aw880jnsr700j8y2k3g", // Governance module address
      "params": {
        "policy_admin": "maroo1q2r2gvtf3chcnp8e734svy4jy5wcf2fpd285a2"
      }
    }
  ],
  "title": "Set PCL Policy Admin",
  "summary": "This proposal sets the initial Policy Admin for the PCL module.",
  "deposit": "1000000000000000000000aokrw"
}

CLI command for submitting the proposal

After creating the JSON file, a user with sufficient stake can submit the proposal to the network.

marood tx gov submit-proposal proposal.json --from my_validator_key --chain-id maroo-testnet
ESC
Type to search