Skip to content

ForceExecuteGovProposal #15

@iboss-ptk

Description

@iboss-ptk

The idea here is to allow governance gated execution without voting in test.

Here is some implementation idea on go side:

// libosmosistesttube/main.go

//export ForceExecuteGovProposal
func ForceExecuteGovProposal(envId uint64, path, proposalTypeUrl, base64ProposalBytes string) *C.char {
	env := loadEnv(envId)

	// get router 
	govRouter := govkeeper.Keeper.Router(*env.App.GovKeeper)

	// unmarshal content from base64ProposalBytes and proposalTypeUrl
        // every proposal type implement `Content` interface
	// we might need to create a proposal type registry to fetch the correct type to unmarshal
	// but if you find a way to unmarshal without registry, that would be better
	content = ...
	err := govRouter.GetRoute(path)(env.Ctx, content)

	if err {
		return encodeErrToResultBytes(result.ExecuteError, err)
	}

	return encodeBytesResultBytes([]byte{})
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions