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

fix: remove legacy codes of wasm #640

Merged
merged 6 commits into from
Aug 22, 2022

Conversation

zemyblue
Copy link
Member

@zemyblue zemyblue commented Aug 10, 2022

Description

  • remove legacy codes of wasm (QueryRouter, Router)
    • This codes don't use any more.
  • remove duplicated Event in the wasm proposal handlers.
    • It is not even write the wrong codeId of smart contract.

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

@zemyblue zemyblue self-assigned this Aug 10, 2022
Signed-off-by: zemyblue <[email protected]>
@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #640 (3dfe8f4) into main (8679ec2) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #640      +/-   ##
==========================================
+ Coverage   60.21%   60.24%   +0.03%     
==========================================
  Files         817      815       -2     
  Lines       94990    94895      -95     
==========================================
- Hits        57201    57173      -28     
+ Misses      34320    34244      -76     
- Partials     3469     3478       +9     
Impacted Files Coverage Δ
x/wasm/keeper/msg_server.go 18.93% <ø> (+0.43%) ⬆️
x/wasm/keeper/proposal_handler.go 59.59% <100.00%> (-6.25%) ⬇️
x/token/msgs.go 34.51% <0.00%> (-4.07%) ⬇️
crypto/keys/internal/ecdsa/privkey.go 82.45% <0.00%> (-1.76%) ⬇️
x/wasm/keeper/keeper.go 85.74% <0.00%> (-0.36%) ⬇️
x/foundation/foundation.go 75.81% <0.00%> (+2.16%) ⬆️
x/foundation/msgs.go 41.34% <0.00%> (+3.84%) ⬆️
x/collection/msgs.go 42.03% <0.00%> (+7.40%) ⬆️
x/token/validation.go 87.27% <0.00%> (+14.54%) ⬆️
... and 1 more

Signed-off-by: zemyblue <[email protected]>
Copy link
Contributor

@dudong2 dudong2 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@da1suk8 da1suk8 left a comment

Choose a reason for hiding this comment

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

I have added a question, please could you check.

)
ctx.EventManager().EmitEvent(ourEvent)
return nil
return k.ClearContractAdmin(ctx, contractAddr, nil)
}
Copy link
Member

Choose a reason for hiding this comment

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

Please could I check handleClearAdminProposal

When checking
cosmos/wasmd@e9156be#diff-a5c1aab521b573562de4814c157ce3c9b7564672c24f0acafffdb003de9c16fb (L159(129)-L178(142))
https://github.com/CosmWasm/wasmd/blob/main/x/wasm/keeper/proposal_handler.go#L188-L201

It seems a little different, my understanding might be wrong, but please could you double check.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like it works as same as wasmd's code, but I think it is better to unify the code with wasmd's.

Copy link
Member Author

@zemyblue zemyblue Aug 17, 2022

Choose a reason for hiding this comment

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

I know the difference with wasmd. But I thought this code is better suited to the return pattern of handleUpdateAdminProposal.

BTW, EventTypeUpdateAdmin and EventTypeClearAdmin events are not defined in wasmd. I think these events seems to define only our code. And there is no event anywhere about ClearAdminProposal and UpdateAdminProposal. I think this events are necessary. What do you think, @shiki-tak and @loloicci ?

Copy link
Member

Choose a reason for hiding this comment

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

I understand, thank you.
But I also think it would be better to unify the code with wasmd's.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you @da1suk8.

And the governance process i shandled by cosmos-sdk gov module, and it seems there is a rule about proposal handler do not emit any events of type message anymore in cosmwasm/wasmd. So we need to remove this message type event.

CosmWasm/wasmd@e9156be

@zemyblue zemyblue requested review from loloicci and dudong2 August 18, 2022 10:17
@zemyblue zemyblue merged commit 86ccc34 into Finschia:main Aug 22, 2022
zemyblue added a commit that referenced this pull request Sep 5, 2022
* main:
  fix: wasm module's FIXME in the snapshotter.go file (#649)
  chore(deps): Bump actions/setup-go from 3.2.1 to 3.3.0 (#650)
  chore(deps): Bump actions/cache from 3.0.7 to 3.0.8 (#648)
  fix: remove legacy codes of wasm (#640)
  chore(deps): Bump github.com/mattn/go-isatty from 0.0.14 to 0.0.16 (#643)
  chore(deps): Bump actions/cache from 3.0.6 to 3.0.7 (#642)
  chore: change some minor things that haven't been fixed in #549 (#635)
  refactor: rename x/collection events (#639)
  feat: add additional fields into x/collection events (#638)
  refactor: rename x/token events (#637)
  feat: add creator into x/token EventIssue (#636)
  chore(deps): Bump github.com/coinbase/rosetta-sdk-go (#641)
  chore: change `Keeper.space` type to be same with cosmos-sdk
  refactor: remove SetBalance and SetSupply (#629)
  refactor: revert changes in x/slashing proto (#627)
  chore(deps): Bump actions/cache from 3.0.5 to 3.0.6 (#631)
  chore(deps): Bump github.com/prometheus/client_golang (#632)
  chore(deps): Bump actions/setup-go from 2.1.4 to 3.2.1 (#624)
  feat: add Query/TokenClassTypeName (#622)
  feat: add additional information into EventXXXChanged (#621)

Signed-off-by: zemyblue <[email protected]>

# Conflicts:
#	CHANGELOG.md
#	client/docs/statik/statik.go
#	simapp/app.go
#	x/wasm/types/events.go
@zemyblue zemyblue mentioned this pull request Oct 27, 2022
5 tasks
@zemyblue zemyblue mentioned this pull request Nov 28, 2022
5 tasks
@zemyblue zemyblue deleted the remove_legacy_codes_of_wasm branch December 23, 2022 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants