-
Notifications
You must be signed in to change notification settings - Fork 370
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
feat(evmutil): implement MsgConvertCosmosCoinFromERC20 #1609
Conversation
@@ -54,6 +54,8 @@ Only Cosmos co-chain denominations that are in the `AllowedCosmosDenoms` param ( | |||
|
|||
The ERC20 contracts are deployed and managed by x/evmutil. The contract is deployed on first convert of the coin. Once deployed, the addresses of the contracts can be queried via the `DeployedCosmosCoinContracts` query (`deployed_cosmos_coin_contracts` endpoint). | |||
|
|||
If a denom is removed from the `AllowedCosmosDenoms` param, existing ERC20 tokens can be converted back to the underlying sdk.Coin via `MsgConvertCosmosCoinFromERC20`, but no conversions from sdk.Coin -> ERC via `MsgConvertCosmosCoinToERC20` are allowed. |
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.
do we have a test for this expected behaviour? Might be good to include if not.
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.
good idea, i've added a test of the full flow, including re-enabling the coin using the original contract address:
https://github.com/Kava-Labs/kava/pull/1609/files#diff-b41fd85eddf7b0e552e3551ed6991584ba52d5d9e7605f76facbb676139dadf1R654-R659
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.
👍
80ab4d9
to
ec47241
Compare
02beec0
to
7ec2266
Compare
111a84a
to
7b06210
Compare
// the test verifies the behavior for when a denom is removed from the params list | ||
// after conversions have been made: | ||
// - it should prevent more conversions from sdk -> evm for that denom | ||
// - existing erc20s should be allowed to get converted back to a sdk.Coins | ||
// - allowing the denom again should use existing contract | ||
func (suite *MsgServerSuite) TestConvertCosmosCoinForRemovedDenom() { |
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 addition here 👍
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.
I missed that last case of re-enabled when reviewing
Description
Adds message server implementation for MsgConvertCosmosCoinToERC20, with tests & spec updates.
Checklist