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

Add MsgStoreCode and MsgInstantiateContract support to simulations #831

Merged
merged 2 commits into from
May 3, 2022

Conversation

pinosu
Copy link
Contributor

@pinosu pinosu commented May 2, 2022

See #797

Based on #825

Add support for:

  • MsgStoreCode
  • MsgInstantiateContract

Simulations can be run with test-sim-multi-seed-short and make test-sim-import-export

@pinosu pinosu requested a review from alpe as a code owner May 2, 2022 21:44
@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #831 (8a8e9ba) into main (591ff72) will increase coverage by 0.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #831      +/-   ##
==========================================
+ Coverage   59.33%   59.34%   +0.01%     
==========================================
  Files          51       51              
  Lines        5884     5886       +2     
==========================================
+ Hits         3491     3493       +2     
  Misses       2142     2142              
  Partials      251      251              
Impacted Files Coverage Δ
x/wasm/module.go 49.45% <75.00%> (+1.13%) ⬆️
app/app.go 88.94% <100.00%> (ø)

Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 Excellent. Happy to see this started!

var codeID uint64
wasmKeeper.IterateCodeInfos(ctx, func(u uint64, info types.CodeInfo) bool {
if info.InstantiateConfig.Permission != types.AccessTypeEverybody {
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, just take the next

})

if codeID == 0 {
return simtypes.NoOpMsg(types.ModuleName, types.MsgInstantiateContract{}.Type(), "no codes with permission available"), nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

CodeID: codeID,
Label: simtypes.RandStringOfLength(r, 10),
Msg: []byte(`{}`),
Funds: simtypes.RandSubsetCoins(r, spendable),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pinosu pinosu merged commit 23c75b1 into main May 3, 2022
)

//go:embed testdata/reflect.wasm
var reflectContract []byte
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to embed from the keeper testdata so that we do not have to maintain copies of the file?

@alpe alpe deleted the 797-simulation branch May 10, 2023 08:53
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

Successfully merging this pull request may close these issues.

2 participants