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

Some multitest cleanup #341

Open
1 of 4 tasks
ethanfrey opened this issue Nov 22, 2021 · 2 comments
Open
1 of 4 tasks

Some multitest cleanup #341

ethanfrey opened this issue Nov 22, 2021 · 2 comments
Labels
M Medium task, 1-3 days work

Comments

@ethanfrey
Copy link
Contributor

ethanfrey commented Nov 22, 2021

Some issues arose when debuging multitests with tgrademsg.

  • We use Unauthorised everywhere, which is less than helpful when many contracts are involved. Let's make them more explicit. Starting with the TgradeMsg bindings - this should return something more clear, like "Missing Privilege". We can also consider using different terms for other contracts as well.
  • We need to better document how to promote contracts at the beginning of multitest so they can make privileged actions.
  • The comments on GovProposal::Migrate should be more clear
  • We should implement GovProposal::Instantiate (just like WasmMsg::Instantiate) and GovProposal::Migrate (which is like WasmMsg::Migrate but overrides the admin check, so it is always allowed)
@ueco-jb
Copy link

ueco-jb commented Nov 22, 2021

@ethanfrey

We need to better document how to promote contracts at the beginning of multitest so they can make privileged actions.

Actually promotion is very easy:

        app.promote(owner.as_str(), contract.as_str()).unwrap();

It's just important to know (or remember) to do it. Is it still worth documenting? Where, if so?

The comments on GovProposal::Migrate should be more clear

This needs some more explanation. I agree that existing "comments" provides little to no information:
https://github.com/confio/tgrade-contracts/blob/main/packages/bindings/src/gov.rs#L58
but what exactly would you see improved there?

implement GovProposal::Instantiate (just like WasmMsg::Instantiate)

What would be its purpose? WasmMsg::Instantiate instantiates a new contract from previously uploaded wasm code. There's already similar GovProposal::InstantiateContract message.
Actually same question for migrate version.

@ethanfrey
Copy link
Contributor Author

The point was that sometimes you do not have permission to do so (someone else's contract... in wasmd it is possible to upload code but not allow others to instantiate it)

The GovProposal variants lets you override any such permissions (eg. migrate Bart's contract), but only with approval of chain governance

@ueco-jb ueco-jb added the M Medium task, 1-3 days work label Nov 23, 2021
@ueco-jb ueco-jb removed their assignment Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M Medium task, 1-3 days work
Projects
None yet
Development

No branches or pull requests

2 participants