-
Notifications
You must be signed in to change notification settings - Fork 572
feat(template): scaffold simulation testing templates with simapp
#1731
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
Conversation
lumtis
left a comment
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.
👍
Haven't tested yet. I may see that there are some issues with the integration tests
I refactoring suggestion I have is to try to separate the different types of file modification in the different files now that we have many different types of things that are scaffolded.
So putting moduleSimulationModify in templates/map/simulation.go for example.
|
Pretty neat💯 For the operations scaffolding, I would personally prefer avoiding scaffolding everything in I would suggest having the template: And scaffolding the operation in |
|
I got this error when runnnig the simulation: I think it would be fine to return an empty operation with |
starport/templates/module/create/simapp/x/{{moduleName}}/simulation/simap.go.plush
Outdated
Show resolved
Hide resolved
|
If I run commands from the PR's description, it returns the following (see the gist). Is this the expected result? https://gist.github.com/fadeev/68c1abff3b7912bf8ce9f7c785d4910e |
|
@fadeev and @lubtd, the reason is an issue with the bank and the account module for simulations. It's fixed. You can try now. |
fadeev
left a comment
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.
Great work! Excited about simapp being included with Starport! 🙌
lumtis
left a comment
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.
👍
...ort/templates/typed/list/stargate/messages/x/{{moduleName}}/simulation/{{typeName}}.go.plush
Outdated
Show resolved
Hide resolved
lumtis
left a comment
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 great👍
Just one last thing: it seems the delete operation (for list, map or single) is never called. I don't know if it may be related to the wight we define.
We can track the issue if we don't solve it for this PR
…gnite#1731) * scaffold simapp template * add one line space * add support to old chains * improve the noOpMsg description * improve todo comment for simap weight value * reuse msg simap scaffold code * split the simulation methods into a new file * fix merge from develop * fix some typos * scaffold simulaiton package for module * fix msg signer for plush templates * fix auth and bank keeper panic * add expetec keepers for auth and bank modules * add creator to all msgs * fix already exist simulation entry * fix expected keeper conflicts for bank and account * use existing objs from store to create the update and delete simulation messages * fix missing imports for simulation * create a method to find account easilly * fix simap failures * remove automatcly added fields for template Co-authored-by: İlker G. Öztürk <[email protected]> Co-authored-by: Lucas Bertrand <[email protected]>
close #1702
Description
This PR adds the simulation manager into the
app.gofor new scaffolded chains. Creates themodule_simultation.gofor new modules and also for old chains withoutsimapafter scaffolding new messages. Keeping the compatibility for old scaffolded chains.How to test
Scaffold a new chain:
Scaffold messages and types:
Run the simulation:
go test -v -benchmem -run=^$ -bench ^BenchmarkSimulation ./app