upgrade

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 12 Imported by: 0

README

Upgrade module

Usage

(Tx) Proposal software upgrade
softwareUpgradeMsg := types.SoftwareUpgradeMsg{
    UpgradeName: "Upgrade Name",
    Title: "Upgrade Title",
    Description: "Upgrade Description",
    UpgradeHeight:"6000",
    UpgradeInfo: `{"upgrade_info":"INFO"}`,
    Deposit: "1000",
}

txbytes, err := xplac.SoftwareUpgrade(softwareUpgradeMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)
(Tx) Proposal cancel software upgrade
cancelSoftwareUpgradeMsg := types.CancelSoftwareUpgradeMsg {
    Title: "Cancel software upgrade",
    Description: "Cancel software upgrade description",
    Deposit: "1000",
}

txbytes, err := xplac.CancelSoftwareUpgrade(cancelSoftwareUpgradeMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)
(Query) Upgrade applied
appliedMsg := types.AppliedMsg{
    UpgradeName: "upgrade-name",
}

res, err := xplac.UpgradeApplied(appliedMsg).Query()
(Query) Modules version
// Query specific module name
queryModulesVersionMsg := types.QueryModulesVersionMsg{
    ModuleName: "auth",
}

res, err := xplac.ModulesVersion(queryModulesVersionMsg).Query()

// Query all modules version
res, err := xplac.ModulesVersion().Query()
(Query) Upgrade plan
res, err := xplac.Plan().Query()

Documentation

Index

Constants

View Source
const (
	UpgradeModule                         = "upgrade"
	UpgradeProposalSoftwareUpgradeMsgType = "proposal-software-upgrade"
	UpgradeCancelSoftwareUpgradeMsgType   = "cancel-software-upgrade"
	UpgradeAppliedMsgType                 = "applied"
	UpgradeQueryModuleVersionsMsgType     = "upgrade-module-versions"
	UpgradeQueryAllModuleVersionsMsgType  = "upgrade-all-module-versions"
	UpgradePlanMsgType                    = "upgrade-plan"
)

Variables

This section is empty.

Functions

func MakeAppliedMsg

func MakeAppliedMsg(appliedMsg types.AppliedMsg) (upgradetypes.QueryAppliedPlanRequest, error)

(Query) make msg - applied

func MakeCancelSoftwareUpgradeMsg

func MakeCancelSoftwareUpgradeMsg(cancelSoftwareUpgradeMsg types.CancelSoftwareUpgradeMsg, from sdk.AccAddress) (govtypes.MsgSubmitProposal, error)

(Tx) make msg - cancel software upgrade

func MakePlanMsg

(Query) make msg - plan

func MakeProposalSoftwareUpgradeMsg

func MakeProposalSoftwareUpgradeMsg(softwareUpgradeMsg types.SoftwareUpgradeMsg, from sdk.AccAddress) (govtypes.MsgSubmitProposal, error)

(Tx) make msg - software upgrade

func MakeQueryAllModuleVersionMsg

func MakeQueryAllModuleVersionMsg() (upgradetypes.QueryModuleVersionsRequest, error)

(Query) make msg - all module versions

func MakeQueryModuleVersionMsg

func MakeQueryModuleVersionMsg(queryModulesVersionMsg types.QueryModulesVersionMsg) (upgradetypes.QueryModuleVersionsRequest, error)

(Query) make msg - module version

func NewCoreModule added in v0.1.2

func NewCoreModule() core.CoreModule

func QueryUpgrade

func QueryUpgrade(i core.QueryClient) (string, error)

Query client for upgrade module.

Types

type UpgradeExternal added in v0.1.2

type UpgradeExternal struct {
	Xplac provider.XplaClient
}

func NewUpgradeExternal added in v0.1.2

func NewUpgradeExternal(xplac provider.XplaClient) (e UpgradeExternal)

func (UpgradeExternal) CancelSoftwareUpgrade added in v0.1.2

func (e UpgradeExternal) CancelSoftwareUpgrade(cancelSoftwareUpgradeMsg types.CancelSoftwareUpgradeMsg) provider.XplaClient

Cancel the current software upgrade proposal.

func (UpgradeExternal) ModulesVersion added in v0.1.2

func (e UpgradeExternal) ModulesVersion(queryModulesVersionMsg ...types.QueryModulesVersionMsg) provider.XplaClient

Query the list of module versions.

func (UpgradeExternal) Plan added in v0.1.2

Query upgrade plan(if one exists).

func (UpgradeExternal) SoftwareUpgrade added in v0.1.2

func (e UpgradeExternal) SoftwareUpgrade(softwareUpgradeMsg types.SoftwareUpgradeMsg) provider.XplaClient

Submit a software upgrade proposal.

func (UpgradeExternal) UpgradeApplied added in v0.1.2

func (e UpgradeExternal) UpgradeApplied(appliedMsg types.AppliedMsg) provider.XplaClient

Block header for height at which a completed upgrade was applied.

Jump to

Keyboard shortcuts

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