osmosis-labs/beaker

Trace store-code-proposal execution and update code_id

iboss-ptk opened this issue · 0 comments

After store code proposal success, the state does not get updated with it

  • implement hook in instantiate/migrate to check prroposal result
  • implement beaker wasm proposal sync-state

Without this, contract instantiate/migrate will never use code stored via proposal unless manually update the state file

Investigation

According to this line of code, at EndBlocker if proposal is passed and get executed, it should re-emit events (and hopefully contextualized with the proposal).

So potential execution plan to get code_id from proposal_id is:

Todo

  • move code to wasm.rs
  • implement cosmos.rs in client function to perform the code extraction
  • add tests
  • hook
    • instantiate
    • migrate
  • implement prompt
    • prompt only state update found
    • -y, --yes to skip the prompt, still log