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

ForceExecuteGovProposal #15

Open
iboss-ptk opened this issue Apr 5, 2023 · 0 comments
Open

ForceExecuteGovProposal #15

iboss-ptk opened this issue Apr 5, 2023 · 0 comments

Comments

@iboss-ptk
Copy link
Collaborator

iboss-ptk commented Apr 5, 2023

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{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant