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

Bump proto #563

Merged
merged 12 commits into from
Jul 27, 2021
Merged

Bump proto #563

merged 12 commits into from
Jul 27, 2021

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Jul 27, 2021

Closes #558

  • Rename fields in proto
  • Rename fields in CLI / REST
  • All tests pass
  • Bump version to v1

@codecov
Copy link

codecov bot commented Jul 27, 2021

Codecov Report

Merging #563 (d643241) into master (b2adcc4) will increase coverage by 0.03%.
The diff coverage is 82.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #563      +/-   ##
==========================================
+ Coverage   59.61%   59.65%   +0.03%     
==========================================
  Files          45       45              
  Lines        5260     5260              
==========================================
+ Hits         3136     3138       +2     
+ Misses       1893     1892       -1     
+ Partials      231      230       -1     
Impacted Files Coverage Δ
x/wasm/client/cli/gov_tx.go 0.00% <0.00%> (ø)
x/wasm/client/cli/new_tx.go 0.00% <0.00%> (ø)
x/wasm/keeper/msg_server.go 0.00% <0.00%> (ø)
x/wasm/client/cli/tx.go 25.97% <100.00%> (ø)
x/wasm/keeper/handler_plugin_encoders.go 80.88% <100.00%> (ø)
x/wasm/keeper/proposal_handler.go 71.42% <100.00%> (ø)
x/wasm/types/proposal.go 83.33% <100.00%> (ø)
x/wasm/types/test_fixtures.go 95.12% <100.00%> (ø)
x/wasm/types/tx.go 40.00% <100.00%> (ø)
x/wasm/keeper/keeper.go 85.38% <0.00%> (+0.37%) ⬆️

@ethanfrey ethanfrey marked this pull request as ready for review July 27, 2021 07:47
@ethanfrey ethanfrey requested a review from alpe as a code owner July 27, 2021 07:47
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

🐎

// MigrateMsg json encoded message to be passed to the contract on migration
bytes migrate_msg = 6;
// Msg json encoded message to be passed to the contract on migration
bytes msg = 6;
Copy link
Member

Choose a reason for hiding this comment

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

Nice changes. I was wondering: why is there no ExecuteContractProposal? Would this be useful?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm.. what would it do?

Migrate will override any other auth.

InstantiateProposal is useful if we want to instantiate a code ID which is governance restricted (you can set it so only governance can create new contracts, to avoid eg. everyone making cw20 tokens on a non-DeFi chain)

What would the Execute Proposal do?

All I can think of is to execute a message as an arbitrary account. Which is as powerful as "allow governance to forge a message from arbitrary user". You can make an issue to describe this idea if you think it would be useful and let's wait for Alex to discuss it.

x/wasm/client/proposal_handler_test.go Outdated Show resolved Hide resolved
x/wasm/types/proposal.go Outdated Show resolved Hide resolved
x/wasm/types/proposal.go Outdated Show resolved Hide resolved
x/wasm/types/proposal_test.go Outdated Show resolved Hide resolved
x/wasm/types/proposal_test.go Outdated Show resolved Hide resolved
x/wasm/types/proposal_test.go Outdated Show resolved Hide resolved
x/wasm/types/proposal_test.go Outdated Show resolved Hide resolved
@@ -82,7 +82,7 @@ type WasmerEngine interface {
// replace it. This allows it to run a migration step if needed, or return an error if unable to migrate
// the given data.
//
// MigrateMsg has some data on how to perform the migration.
// Msg has some data on how to perform the migration.
Copy link
Member

Choose a reason for hiding this comment

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

This propably refers to the argument migrateMsg which is not renamed. Let's use the variable name here in text, no matter which one we use.

Copy link
Member Author

Choose a reason for hiding this comment

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

Over aggressive renaming.

Should I rename the variables in this interface as well? I guess it has nothing to do with proto and is non API-breaking, so we can do it later.

Copy link
Member

Choose a reason for hiding this comment

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

I don't mind. I don't even understand why this file exist and those signatures are not imported from wasmvm.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an interface that matches wasmvm (the implementation), but allows him to swap out the vm with a mock that let's us test mock contracts in Go. This makes for much simpler unit testing of the higher level logic (eg. go contract that returns such and such events in reply, then see how the are assembled through the keeper)

@ethanfrey ethanfrey merged commit f6002fe into master Jul 27, 2021
@ethanfrey ethanfrey deleted the 558-bump-proto branch July 27, 2021 12:52
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.

Bump proto definitions to version 1
2 participants