-
Notifications
You must be signed in to change notification settings - Fork 402
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 Weighted Operations to simulation #825
Conversation
3d7b798
to
f23006f
Compare
f23006f
to
e11bfe7
Compare
Codecov Report
@@ Coverage Diff @@
## main #825 +/- ##
==========================================
- Coverage 59.37% 59.30% -0.08%
==========================================
Files 51 51
Lines 5898 5885 -13
==========================================
- Hits 3502 3490 -12
+ Misses 2144 2143 -1
Partials 252 252
|
* Convert MaxWasmSize to var Also removes redundant maxWasmSize param * Convert MaxWasmSize to int * Update CHANGELOG * Complete max wasm size changes * Update compile flags Co-authored-by: Cole Brown <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice start!
Please rebase and use CodeInfos to find a code id
@@ -2,6 +2,10 @@ | |||
|
|||
## [Unreleased](https://github.com/CosmWasm/wasmd/tree/HEAD) | |||
|
|||
**Merged pull requests:** | |||
|
|||
- Consolidate MaxWasmSize constraints into a single var [\#826](https://github.com/CosmWasm/wasmd/pull/826) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 this is in main
already. I think you PR was not rebased proper
@@ -20,4 +20,6 @@ const ( | |||
DefaultWeightCommunitySpendProposal int = 5 | |||
DefaultWeightTextProposal int = 5 | |||
DefaultWeightParamChangeProposal int = 5 | |||
DefaultWeightMsgStoreCode int = 100 | |||
DefaultWeightMsgInstantiateContract int = 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this high as well to get some load on our module
return true | ||
}) | ||
|
||
if contractInfo.Equal(types.ContractInfo{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to look for a CodeInfo here. The system won't have contract instances in the beginning and you abort here so that none will be created
return simtypes.NoOpMsg(types.ModuleName, types.MsgInstantiateContract{}.Type(), "no contracts available"), nil, nil | ||
} | ||
|
||
spendable := bk.SpendableCoins(ctx, simAccount.Address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice to send some tokens. 💸
Test accounts will get broke fast though. How about sending a random amount with simtypes.RandSubset as the sdk does?
|
||
msg := types.MsgInstantiateContract{ | ||
Sender: simAccount.Address.String(), | ||
Admin: contractInfo.Admin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a random account address here. Empty string is valid too.
Sender: simAccount.Address.String(), | ||
Admin: contractInfo.Admin, | ||
CodeID: contractInfo.CodeID, | ||
Label: simtypes.RandStringOfLength(r, 10), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Admin: contractInfo.Admin, | ||
CodeID: contractInfo.CodeID, | ||
Label: simtypes.RandStringOfLength(r, 10), | ||
Msg: []byte(fmt.Sprintf(`{"%s": "%s"}`, simtypes.RandStringOfLength(r, 10), simtypes.RandStringOfLength(r, 10))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reflect contract expects an empty object on instantiation
Closing in favour of #831 |
See #797
Add support for:
MsgStoreCode
MsgInstantiateContract
Simulations can be run with
test-sim-multi-seed-short
andmake test-sim-import-export