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 gov proposal simulations #1107

Merged
merged 10 commits into from
Dec 9, 2022
Merged

Add gov proposal simulations #1107

merged 10 commits into from
Dec 9, 2022

Conversation

pinosu
Copy link
Contributor

@pinosu pinosu commented Nov 25, 2022

Part of #1063
Add gov proposal simulations:

  • migrate contract proposal
  • pin contract proposal
  • unpin contract proposal
  • update instantiate config proposal
  • sudo contract proposal (commented out because it fails)
  • store and instantiate contract proposal (commented out because it fails)

@codecov
Copy link

codecov bot commented Nov 25, 2022

Codecov Report

Merging #1107 (cfa2ceb) into main (a589fe9) will decrease coverage by 0.22%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1107      +/-   ##
==========================================
- Coverage   59.95%   59.72%   -0.23%     
==========================================
  Files          54       54              
  Lines        7406     7434      +28     
==========================================
  Hits         4440     4440              
- Misses       2641     2669      +28     
  Partials      325      325              
Impacted Files Coverage Δ
x/wasm/types/proposal.go 52.09% <0.00%> (-3.25%) ⬇️

@pinosu pinosu force-pushed the 1063-gov_proposal_sim branch from 8faacec to 9a785e8 Compare November 25, 2022 13:06
@pinosu pinosu force-pushed the 1063-gov_proposal_sim branch from 1310833 to 56b3faa Compare December 6, 2022 13:50
@pinosu pinosu marked this pull request as ready for review December 6, 2022 15:11
@pinosu pinosu requested a review from alpe as a code owner December 6, 2022 15:11
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.

This looks great and simulation passed! 👏 🏄

// Simulate pin contract proposal
func SimulatePinContractProposal(wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn {
return func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) simtypes.Content {
codeID := codeSelector(ctx, wasmKeeper)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 I checked the doc and the execution is idempotent so it does not really matter if it was pinned before

simtypes.RandStringOfLength(r, 10),
simtypes.RandStringOfLength(r, 10),
[]types.AccessConfigUpdate{configUpdate},
)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

func NewUpdateInstantiateConfigProposal(
title string,
description string,
accessConfigUpdates []AccessConfigUpdate,
Copy link
Contributor

Choose a reason for hiding this comment

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

personal preference:

Suggested change
accessConfigUpdates []AccessConfigUpdate,
accessConfigUpdates ...AccessConfigUpdate,

@sonarcloud
Copy link

sonarcloud bot commented Dec 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pinosu pinosu merged commit c5abd33 into main Dec 9, 2022
@pinosu pinosu deleted the 1063-gov_proposal_sim branch December 9, 2022 11:40
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