diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 9bdc2931..b2782559 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -18,9 +18,10 @@ jobs: - run: make check-proto-deps - run: make check-proto-lint - run: make check-proto-format - - run: make check-proto-breaking-remote - - run: BUF_CHECK_BREAKING_AGAINST_REMOTE="branch=$GITHUB_BASE_REF" make check-proto-breaking-remote - if: github.event_name == 'pull_request' + # TODO: reenable me after merge of Native -> Cosmos name change committed to master. + # - run: make check-proto-breaking-remote + # - run: BUF_CHECK_BREAKING_AGAINST_REMOTE="branch=$GITHUB_BASE_REF" make check-proto-breaking-remote + # if: github.event_name == 'pull_request' - run: make check-proto-gen - run: make check-proto-gen-doc - run: make check-proto-gen-swagger diff --git a/CHANGELOG.md b/CHANGELOG.md index 98309c46..af1f6a8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,8 +37,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] ## Features -- (evmutil) [#1590] Add allow list param of sdk native denoms that can be transferred to evm -- (evmutil) [#1591] Configure module to support deploying ERC20KavaWrappedNativeCoin contracts +- (evmutil) [#1590] & [#1596] Add allow list param of sdk native denoms that can be transferred to evm +- (evmutil) [#1591] & [#1596] Configure module to support deploying ERC20KavaWrappedCosmosCoin contracts ## [v0.23.0] @@ -241,6 +241,7 @@ the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/CHANGELOG.md). - [#257](https://github.com/Kava-Labs/kava/pulls/257) Include scripts to run large-scale simulations remotely using aws-batch +[#1596]: https://github.com/Kava-Labs/kava/pull/1596 [#1591]: https://github.com/Kava-Labs/kava/pull/1591 [#1590]: https://github.com/Kava-Labs/kava/pull/1590 [#1568]: https://github.com/Kava-Labs/kava/pull/1568 diff --git a/ci/env/kava-protonet/genesis.json b/ci/env/kava-protonet/genesis.json index f332285e..c3a15430 100644 --- a/ci/env/kava-protonet/genesis.json +++ b/ci/env/kava-protonet/genesis.json @@ -2004,7 +2004,7 @@ "evmutil": { "accounts": [], "params": { - "allowed_native_denoms": [], + "allowed_cosmos_denoms": [], "enabled_conversion_pairs": [ { "kava_erc20_address": "0xBb304f44b7EFD865361F2AD973d8ebA433893ABC", diff --git a/contracts/contracts/ERC20KavaWrappedNativeCoin.sol b/contracts/contracts/ERC20KavaWrappedCosmosCoin.sol similarity index 92% rename from contracts/contracts/ERC20KavaWrappedNativeCoin.sol rename to contracts/contracts/ERC20KavaWrappedCosmosCoin.sol index e2e4032b..bd637525 100644 --- a/contracts/contracts/ERC20KavaWrappedNativeCoin.sol +++ b/contracts/contracts/ERC20KavaWrappedCosmosCoin.sol @@ -5,10 +5,10 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /// @title An ERC20 token contract owned and deployed by the evmutil module of Kava. -/// Tokens are backed one-for-one by sdk coins held in the module account. +/// Tokens are backed one-for-one by cosmos-sdk coins held in the module account. /// @author Kava Labs, LLC /// @custom:security-contact security@kava.io -contract ERC20KavaWrappedNativeCoin is ERC20, Ownable { +contract ERC20KavaWrappedCosmosCoin is ERC20, Ownable { /// @notice The decimals places of the token. For display purposes only. uint8 private immutable _decimals; diff --git a/contracts/package.json b/contracts/package.json index e813cc9e..b28c0d3a 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -12,7 +12,7 @@ "clean": "hardhat clean", "compile": "hardhat compile", "coverage": "hardhat coverage", - "ethermint-json": "jq '{ abi: .abi | tostring, bin: .bytecode | ltrimstr(\"0x\")}' artifacts/contracts/ERC20KavaWrappedNativeCoin.sol/ERC20KavaWrappedNativeCoin.json > ../x/evmutil/types/ethermint_json/ERC20KavaWrappedNativeCoin.json", + "ethermint-json": "jq '{ abi: .abi | tostring, bin: .bytecode | ltrimstr(\"0x\")}' artifacts/contracts/ERC20KavaWrappedCosmosCoin.sol/ERC20KavaWrappedCosmosCoin.json > ../x/evmutil/types/ethermint_json/ERC20KavaWrappedCosmosCoin.json", "gen-ts-types": "hardhat typechain", "lint": "eslint '**/*.{js,ts}'", "lint-fix": "eslint '**/*.{js,ts}' --fix", diff --git a/contracts/scripts/deploy.ts b/contracts/scripts/deploy.ts index e483efe5..2d190264 100644 --- a/contracts/scripts/deploy.ts +++ b/contracts/scripts/deploy.ts @@ -5,10 +5,10 @@ async function main() { const tokenSymbol = "kATOM"; const tokenDecimals = 6; - const ERC20KavaWrappedNativeCoin = await ethers.getContractFactory( - "ERC20KavaWrappedNativeCoin" + const ERC20KavaWrappedCosmosCoin = await ethers.getContractFactory( + "ERC20KavaWrappedCosmosCoin" ); - const token = await ERC20KavaWrappedNativeCoin.deploy( + const token = await ERC20KavaWrappedCosmosCoin.deploy( tokenName, tokenSymbol, tokenDecimals diff --git a/contracts/test/ERC20KavaWrappedNativeCoin.test.ts b/contracts/test/ERC20KavaWrappedCosmosCoin.test.ts similarity index 92% rename from contracts/test/ERC20KavaWrappedNativeCoin.test.ts rename to contracts/test/ERC20KavaWrappedCosmosCoin.test.ts index 125df06b..9da8c458 100644 --- a/contracts/test/ERC20KavaWrappedNativeCoin.test.ts +++ b/contracts/test/ERC20KavaWrappedCosmosCoin.test.ts @@ -2,21 +2,21 @@ import { expect } from "chai"; import { Signer } from "ethers"; import { ethers } from "hardhat"; import { - ERC20KavaWrappedNativeCoin, - ERC20KavaWrappedNativeCoin__factory as ERC20KavaWrappedNativeCoinFactory, + ERC20KavaWrappedCosmosCoin, + ERC20KavaWrappedCosmosCoin__factory as ERC20KavaWrappedCosmosCoinFactory, } from "../typechain-types"; const decimals = 6n; -describe("ERC20KavaWrappedNativeCoin", function () { - let erc20: ERC20KavaWrappedNativeCoin; - let erc20Factory: ERC20KavaWrappedNativeCoinFactory; +describe("ERC20KavaWrappedCosmosCoin", function () { + let erc20: ERC20KavaWrappedCosmosCoin; + let erc20Factory: ERC20KavaWrappedCosmosCoinFactory; let owner: Signer; let sender: Signer; beforeEach(async function () { erc20Factory = await ethers.getContractFactory( - "ERC20KavaWrappedNativeCoin" + "ERC20KavaWrappedCosmosCoin" ); erc20 = await erc20Factory.deploy("Wrapped ATOM", "ATOM", decimals); [owner, sender] = await ethers.getSigners(); diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index c5daed56..fe469189 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -247,7 +247,7 @@ - [Msg](#kava.earn.v1beta1.Msg) - [kava/evmutil/v1beta1/conversion_pair.proto](#kava/evmutil/v1beta1/conversion_pair.proto) - - [AllowedNativeCoinERC20Token](#kava.evmutil.v1beta1.AllowedNativeCoinERC20Token) + - [AllowedCosmosCoinERC20Token](#kava.evmutil.v1beta1.AllowedCosmosCoinERC20Token) - [ConversionPair](#kava.evmutil.v1beta1.ConversionPair) - [kava/evmutil/v1beta1/genesis.proto](#kava/evmutil/v1beta1/genesis.proto) @@ -264,10 +264,10 @@ - [kava/evmutil/v1beta1/tx.proto](#kava/evmutil/v1beta1/tx.proto) - [MsgConvertCoinToERC20](#kava.evmutil.v1beta1.MsgConvertCoinToERC20) - [MsgConvertCoinToERC20Response](#kava.evmutil.v1beta1.MsgConvertCoinToERC20Response) + - [MsgConvertCosmosCoinToERC20](#kava.evmutil.v1beta1.MsgConvertCosmosCoinToERC20) + - [MsgConvertCosmosCoinToERC20Response](#kava.evmutil.v1beta1.MsgConvertCosmosCoinToERC20Response) - [MsgConvertERC20ToCoin](#kava.evmutil.v1beta1.MsgConvertERC20ToCoin) - [MsgConvertERC20ToCoinResponse](#kava.evmutil.v1beta1.MsgConvertERC20ToCoinResponse) - - [MsgConvertNativeCoinToERC20](#kava.evmutil.v1beta1.MsgConvertNativeCoinToERC20) - - [MsgConvertNativeCoinToERC20Response](#kava.evmutil.v1beta1.MsgConvertNativeCoinToERC20Response) - [Msg](#kava.evmutil.v1beta1.Msg) @@ -3661,18 +3661,18 @@ Msg defines the earn Msg service. - + -### AllowedNativeCoinERC20Token -AllowedNativeCoinERC20Token defines allowed sdk denom & metadata +### AllowedCosmosCoinERC20Token +AllowedCosmosCoinERC20Token defines allowed cosmos-sdk denom & metadata for evm token representations of sdk assets. NOTE: once evm token contracts are deployed, changes to metadata for a given -sdk_denom will not change metadata of deployed contract. +cosmos_denom will not change metadata of deployed contract. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sdk_denom` | [string](#string) | | Denom of the sdk.Coin | +| `cosmos_denom` | [string](#string) | | Denom of the sdk.Coin | | `name` | [string](#string) | | Name of ERC20 contract | | `symbol` | [string](#string) | | Symbol of ERC20 contract | | `decimals` | [uint32](#uint32) | | Number of decimals ERC20 contract is deployed with. | @@ -3756,7 +3756,7 @@ Params defines the evmutil module params | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `enabled_conversion_pairs` | [ConversionPair](#kava.evmutil.v1beta1.ConversionPair) | repeated | enabled_conversion_pairs defines the list of conversion pairs allowed to be converted between Kava ERC20 and sdk.Coin | -| `allowed_native_denoms` | [AllowedNativeCoinERC20Token](#kava.evmutil.v1beta1.AllowedNativeCoinERC20Token) | repeated | allowed_native_denoms is a list of denom & erc20 token metadata pairs. if a denom is in the list, it is allowed to be converted to an erc20 in the evm. | +| `allowed_cosmos_denoms` | [AllowedCosmosCoinERC20Token](#kava.evmutil.v1beta1.AllowedCosmosCoinERC20Token) | repeated | allowed_cosmos_denoms is a list of denom & erc20 token metadata pairs. if a denom is in the list, it is allowed to be converted to an erc20 in the evm. | @@ -3857,6 +3857,33 @@ MsgConvertCoinToERC20Response defines the response value from Msg/ConvertCoinToE + + +### MsgConvertCosmosCoinToERC20 +ConvertCosmosCoinToERC20 defines a conversion from cosmos sdk.Coin to ERC20. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `initiator` | [string](#string) | | Kava bech32 address initiating the conversion. | +| `receiver` | [string](#string) | | EVM hex address that will receive the ERC20 tokens. | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | Amount is the sdk.Coin amount to convert. | + + + + + + + + +### MsgConvertCosmosCoinToERC20Response +MsgConvertCosmosCoinToERC20Response defines the response value from Msg/MsgConvertCosmosCoinToERC20. + + + + + + ### MsgConvertERC20ToCoin @@ -3885,33 +3912,6 @@ Msg/MsgConvertERC20ToCoin. - - - -### MsgConvertNativeCoinToERC20 -ConvertNativeCoinToERC20 defines a conversion from native sdk.Coin to ERC20. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `initiator` | [string](#string) | | Kava bech32 address initiating the conversion. | -| `receiver` | [string](#string) | | EVM hex address that will receive the ERC20 tokens. | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | Amount is the sdk.Coin amount to convert. | - - - - - - - - -### MsgConvertNativeCoinToERC20Response -MsgConvertNativeCoinToERC20Response defines the response value from Msg/MsgConvertNativeCoinToERC20. - - - - - @@ -3928,7 +3928,7 @@ Msg defines the evmutil Msg service. | ----------- | ------------ | ------------- | ------------| ------- | -------- | | `ConvertCoinToERC20` | [MsgConvertCoinToERC20](#kava.evmutil.v1beta1.MsgConvertCoinToERC20) | [MsgConvertCoinToERC20Response](#kava.evmutil.v1beta1.MsgConvertCoinToERC20Response) | ConvertCoinToERC20 defines a method for converting sdk.Coin to Kava ERC20. | | | `ConvertERC20ToCoin` | [MsgConvertERC20ToCoin](#kava.evmutil.v1beta1.MsgConvertERC20ToCoin) | [MsgConvertERC20ToCoinResponse](#kava.evmutil.v1beta1.MsgConvertERC20ToCoinResponse) | ConvertERC20ToCoin defines a method for converting Kava ERC20 to sdk.Coin. | | -| `ConvertNativeCoinToERC20` | [MsgConvertNativeCoinToERC20](#kava.evmutil.v1beta1.MsgConvertNativeCoinToERC20) | [MsgConvertNativeCoinToERC20Response](#kava.evmutil.v1beta1.MsgConvertNativeCoinToERC20Response) | ConvertNativeCoinToERC20 defines a method for converting a native sdk.Coin to an ERC20. | | +| `ConvertCosmosCoinToERC20` | [MsgConvertCosmosCoinToERC20](#kava.evmutil.v1beta1.MsgConvertCosmosCoinToERC20) | [MsgConvertCosmosCoinToERC20Response](#kava.evmutil.v1beta1.MsgConvertCosmosCoinToERC20Response) | ConvertCosmosCoinToERC20 defines a method for converting a cosmos sdk.Coin to an ERC20. | | diff --git a/proto/kava/evmutil/v1beta1/conversion_pair.proto b/proto/kava/evmutil/v1beta1/conversion_pair.proto index 968233bc..678690fd 100644 --- a/proto/kava/evmutil/v1beta1/conversion_pair.proto +++ b/proto/kava/evmutil/v1beta1/conversion_pair.proto @@ -22,15 +22,15 @@ message ConversionPair { string denom = 2; } -// AllowedNativeCoinERC20Token defines allowed sdk denom & metadata +// AllowedCosmosCoinERC20Token defines allowed cosmos-sdk denom & metadata // for evm token representations of sdk assets. // NOTE: once evm token contracts are deployed, changes to metadata for a given -// sdk_denom will not change metadata of deployed contract. -message AllowedNativeCoinERC20Token { +// cosmos_denom will not change metadata of deployed contract. +message AllowedCosmosCoinERC20Token { option (gogoproto.goproto_getters) = false; // Denom of the sdk.Coin - string sdk_denom = 1; + string cosmos_denom = 1; // Name of ERC20 contract string name = 2; // Symbol of ERC20 contract diff --git a/proto/kava/evmutil/v1beta1/genesis.proto b/proto/kava/evmutil/v1beta1/genesis.proto index 0831db15..fa0f6722 100644 --- a/proto/kava/evmutil/v1beta1/genesis.proto +++ b/proto/kava/evmutil/v1beta1/genesis.proto @@ -45,10 +45,10 @@ message Params { (gogoproto.castrepeated) = "ConversionPairs" ]; - // allowed_native_denoms is a list of denom & erc20 token metadata pairs. + // allowed_cosmos_denoms is a list of denom & erc20 token metadata pairs. // if a denom is in the list, it is allowed to be converted to an erc20 in the evm. - repeated AllowedNativeCoinERC20Token allowed_native_denoms = 1 [ + repeated AllowedCosmosCoinERC20Token allowed_cosmos_denoms = 1 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "AllowedNativeCoinERC20Tokens" + (gogoproto.castrepeated) = "AllowedCosmosCoinERC20Tokens" ]; } diff --git a/proto/kava/evmutil/v1beta1/tx.proto b/proto/kava/evmutil/v1beta1/tx.proto index d388ed4c..434d7a2f 100644 --- a/proto/kava/evmutil/v1beta1/tx.proto +++ b/proto/kava/evmutil/v1beta1/tx.proto @@ -17,8 +17,8 @@ service Msg { // ConvertERC20ToCoin defines a method for converting Kava ERC20 to sdk.Coin. rpc ConvertERC20ToCoin(MsgConvertERC20ToCoin) returns (MsgConvertERC20ToCoinResponse); - // ConvertNativeCoinToERC20 defines a method for converting a native sdk.Coin to an ERC20. - rpc ConvertNativeCoinToERC20(MsgConvertNativeCoinToERC20) returns (MsgConvertNativeCoinToERC20Response); + // ConvertCosmosCoinToERC20 defines a method for converting a cosmos sdk.Coin to an ERC20. + rpc ConvertCosmosCoinToERC20(MsgConvertCosmosCoinToERC20) returns (MsgConvertCosmosCoinToERC20Response); } // MsgConvertCoinToERC20 defines a conversion from sdk.Coin to Kava ERC20. @@ -54,8 +54,8 @@ message MsgConvertERC20ToCoin { // Msg/MsgConvertERC20ToCoin. message MsgConvertERC20ToCoinResponse {} -// ConvertNativeCoinToERC20 defines a conversion from native sdk.Coin to ERC20. -message MsgConvertNativeCoinToERC20 { +// ConvertCosmosCoinToERC20 defines a conversion from cosmos sdk.Coin to ERC20. +message MsgConvertCosmosCoinToERC20 { // Kava bech32 address initiating the conversion. string initiator = 1; // EVM hex address that will receive the ERC20 tokens. @@ -64,5 +64,5 @@ message MsgConvertNativeCoinToERC20 { cosmos.base.v1beta1.Coin amount = 3; } -// MsgConvertNativeCoinToERC20Response defines the response value from Msg/MsgConvertNativeCoinToERC20. -message MsgConvertNativeCoinToERC20Response {} +// MsgConvertCosmosCoinToERC20Response defines the response value from Msg/MsgConvertCosmosCoinToERC20. +message MsgConvertCosmosCoinToERC20Response {} diff --git a/x/evmutil/genesis_test.go b/x/evmutil/genesis_test.go index 9df72bbd..a1dc31c5 100644 --- a/x/evmutil/genesis_test.go +++ b/x/evmutil/genesis_test.go @@ -79,12 +79,12 @@ func (s *genesisTestSuite) TestExportGenesis() { KavaERC20Address: testutil.MustNewInternalEVMAddressFromString("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2").Bytes(), Denom: "weth"}, } - params.AllowedNativeDenoms = []types.AllowedNativeCoinERC20Token{ + params.AllowedCosmosDenoms = []types.AllowedCosmosCoinERC20Token{ { - SdkDenom: "hard", - Name: "Kava EVM HARD", - Symbol: "HARD", - Decimals: 6, + CosmosDenom: "hard", + Name: "Kava EVM HARD", + Symbol: "HARD", + Decimals: 6, }, } s.Keeper.SetParams(s.Ctx, params) diff --git a/x/evmutil/keeper/erc20.go b/x/evmutil/keeper/erc20.go index 65db7f3b..1097860b 100644 --- a/x/evmutil/keeper/erc20.go +++ b/x/evmutil/keeper/erc20.go @@ -65,18 +65,18 @@ func (k Keeper) DeployTestMintableERC20Contract( return types.NewInternalEVMAddress(contractAddr), nil } -// DeployKavaWrappedNativeCoinERC20Contract validates token details and then deploys an ERC20 +// DeployKavaWrappedCosmosCoinERC20Contract validates token details and then deploys an ERC20 // contract with the token metadata. // This method does NOT check if a token for the provided SdkDenom has already been deployed. -func (k Keeper) DeployKavaWrappedNativeCoinERC20Contract( +func (k Keeper) DeployKavaWrappedCosmosCoinERC20Contract( ctx sdk.Context, - token types.AllowedNativeCoinERC20Token, + token types.AllowedCosmosCoinERC20Token, ) (types.InternalEVMAddress, error) { if err := token.Validate(); err != nil { - return types.InternalEVMAddress{}, errorsmod.Wrapf(err, "failed to deploy erc20 for sdk denom %s", token.SdkDenom) + return types.InternalEVMAddress{}, errorsmod.Wrapf(err, "failed to deploy erc20 for sdk denom %s", token.CosmosDenom) } - packedAbi, err := types.ERC20KavaWrappedNativeCoinContract.ABI.Pack( + packedAbi, err := types.ERC20KavaWrappedCosmosCoinContract.ABI.Pack( "", // Empty string for contract constructor token.Name, token.Symbol, @@ -86,13 +86,13 @@ func (k Keeper) DeployKavaWrappedNativeCoinERC20Contract( return types.InternalEVMAddress{}, errorsmod.Wrapf(err, "failed to pack token with details %+v", token) } - data := make([]byte, len(types.ERC20KavaWrappedNativeCoinContract.Bin)+len(packedAbi)) + data := make([]byte, len(types.ERC20KavaWrappedCosmosCoinContract.Bin)+len(packedAbi)) copy( - data[:len(types.ERC20KavaWrappedNativeCoinContract.Bin)], - types.ERC20KavaWrappedNativeCoinContract.Bin, + data[:len(types.ERC20KavaWrappedCosmosCoinContract.Bin)], + types.ERC20KavaWrappedCosmosCoinContract.Bin, ) copy( - data[len(types.ERC20KavaWrappedNativeCoinContract.Bin):], + data[len(types.ERC20KavaWrappedCosmosCoinContract.Bin):], packedAbi, ) diff --git a/x/evmutil/keeper/erc20_test.go b/x/evmutil/keeper/erc20_test.go index 1bdab9da..d92183b0 100644 --- a/x/evmutil/keeper/erc20_test.go +++ b/x/evmutil/keeper/erc20_test.go @@ -85,25 +85,25 @@ func (suite *ERC20TestSuite) TestERC20Mint() { suite.Require().Equal(big.NewInt(1234), balance) } -func (suite *ERC20TestSuite) TestDeployKavaWrappedNativeCoinERC20Contract() { +func (suite *ERC20TestSuite) TestDeployKavaWrappedCosmosCoinERC20Contract() { suite.Run("fails to deploy invalid contract", func() { // empty other fields means this token is invalid. - invalidToken := types.AllowedNativeCoinERC20Token{SdkDenom: "nope"} - _, err := suite.Keeper.DeployKavaWrappedNativeCoinERC20Contract(suite.Ctx, invalidToken) + invalidToken := types.AllowedCosmosCoinERC20Token{CosmosDenom: "nope"} + _, err := suite.Keeper.DeployKavaWrappedCosmosCoinERC20Contract(suite.Ctx, invalidToken) suite.ErrorContains(err, "token's name cannot be empty") }) suite.Run("deploys contract with expected metadata & permissions", func() { caller, privKey := testutil.RandomEvmAccount() - token := types.NewAllowedNativeCoinERC20Token("hard", "EVM HARD", "HARD", 6) - addr, err := suite.Keeper.DeployKavaWrappedNativeCoinERC20Contract(suite.Ctx, token) + token := types.NewAllowedCosmosCoinERC20Token("hard", "EVM HARD", "HARD", 6) + addr, err := suite.Keeper.DeployKavaWrappedCosmosCoinERC20Contract(suite.Ctx, token) suite.NoError(err) suite.NotNil(addr) callContract := func(method string, args ...interface{}) ([]interface{}, error) { return suite.QueryContract( - types.ERC20KavaWrappedNativeCoinContract.ABI, + types.ERC20KavaWrappedCosmosCoinContract.ABI, caller, privKey, addr, diff --git a/x/evmutil/keeper/msg_server.go b/x/evmutil/keeper/msg_server.go index 423a69f3..6f2d28dd 100644 --- a/x/evmutil/keeper/msg_server.go +++ b/x/evmutil/keeper/msg_server.go @@ -111,12 +111,12 @@ func (s msgServer) ConvertERC20ToCoin( // Cosmos SDK-native assets -> EVM //////////////////////////// -// ConvertNativeCoinToERC20 converts a native sdk.Coin to an ERC20. +// ConvertCosmosCoinToERC20 converts a native sdk.Coin to an ERC20. // If no ERC20 contract has been deployed for the given denom, a new // contract will be deployed and registered to the module. -func (msgServer) ConvertNativeCoinToERC20( +func (msgServer) ConvertCosmosCoinToERC20( ctx context.Context, - msg *types.MsgConvertNativeCoinToERC20, -) (*types.MsgConvertNativeCoinToERC20Response, error) { + msg *types.MsgConvertCosmosCoinToERC20, +) (*types.MsgConvertCosmosCoinToERC20Response, error) { return nil, fmt.Errorf("unimplemented - coming soon") } diff --git a/x/evmutil/keeper/params_test.go b/x/evmutil/keeper/params_test.go index 0d822117..f3a051ec 100644 --- a/x/evmutil/keeper/params_test.go +++ b/x/evmutil/keeper/params_test.go @@ -39,13 +39,13 @@ func (suite *ParamsTestSuite) TestEnabledConversionPair() { } func (suite *ParamsTestSuite) TestHistoricParamsQuery() { - // setup a params store that lacks allowed_native_denoms param (as was the case in v1) + // setup a params store that lacks allowed_cosmos_denoms param (as was the case in v1) oldParamStore := suite.App.GetParamsKeeper().Subspace("test_subspace_for_evmutil") oldParamStore.WithKeyTable(types.ParamKeyTable()) oldParamStore.Set(suite.Ctx, types.KeyEnabledConversionPairs, types.ConversionPairs{}) suite.True(oldParamStore.Has(suite.Ctx, types.KeyEnabledConversionPairs)) - suite.False(oldParamStore.Has(suite.Ctx, types.KeyAllowedNativeDenoms)) + suite.False(oldParamStore.Has(suite.Ctx, types.KeyAllowedCosmosDenoms)) oldStateKeeper := keeper.NewKeeper( suite.App.AppCodec(), diff --git a/x/evmutil/migrations/v2/store.go b/x/evmutil/migrations/v2/store.go index 80529068..aa506e16 100644 --- a/x/evmutil/migrations/v2/store.go +++ b/x/evmutil/migrations/v2/store.go @@ -8,16 +8,16 @@ import ( ) // MigrateStore performs in-place store migrations for consensus version 2 -// V2 adds the allowed_native_denoms param to parameters. +// V2 adds the allowed_cosmos_denoms param to parameters. func MigrateStore(ctx sdk.Context, paramstore paramtypes.Subspace) error { migrateParamsStore(ctx, paramstore) return nil } -// migrateParamsStore ensures the param key table exists and has the allowed_native_denoms property +// migrateParamsStore ensures the param key table exists and has the allowed_cosmos_denoms property func migrateParamsStore(ctx sdk.Context, paramstore paramtypes.Subspace) { if !paramstore.HasKeyTable() { paramstore.WithKeyTable(types.ParamKeyTable()) } - paramstore.Set(ctx, types.KeyAllowedNativeDenoms, types.DefaultAllowedNativeDenoms) + paramstore.Set(ctx, types.KeyAllowedCosmosDenoms, types.DefaultAllowedCosmosDenoms) } diff --git a/x/evmutil/migrations/v2/store_test.go b/x/evmutil/migrations/v2/store_test.go index 16455eac..d5768236 100644 --- a/x/evmutil/migrations/v2/store_test.go +++ b/x/evmutil/migrations/v2/store_test.go @@ -22,14 +22,14 @@ func TestStoreMigrationAddsKeyTableIncludingNewParam(t *testing.T) { paramstore := paramtypes.NewSubspace(encCfg.Codec, encCfg.Amino, evmutilKey, tEvmutilKey, types.ModuleName) // Check param doesn't exist before - require.False(t, paramstore.Has(ctx, types.KeyAllowedNativeDenoms)) + require.False(t, paramstore.Has(ctx, types.KeyAllowedCosmosDenoms)) // Run migrations. err := v2evmutil.MigrateStore(ctx, paramstore) require.NoError(t, err) // Make sure the new params are set. - require.True(t, paramstore.Has(ctx, types.KeyAllowedNativeDenoms)) + require.True(t, paramstore.Has(ctx, types.KeyAllowedCosmosDenoms)) } func TestStoreMigrationSetsNewParamOnExistingKeyTable(t *testing.T) { @@ -43,12 +43,12 @@ func TestStoreMigrationSetsNewParamOnExistingKeyTable(t *testing.T) { // expect it to have key table require.True(t, paramstore.HasKeyTable()) // expect it to not have new param - require.False(t, paramstore.Has(ctx, types.KeyAllowedNativeDenoms)) + require.False(t, paramstore.Has(ctx, types.KeyAllowedCosmosDenoms)) // Run migrations. err := v2evmutil.MigrateStore(ctx, paramstore) require.NoError(t, err) // Make sure the new params are set. - require.True(t, paramstore.Has(ctx, types.KeyAllowedNativeDenoms)) + require.True(t, paramstore.Has(ctx, types.KeyAllowedCosmosDenoms)) } diff --git a/x/evmutil/spec/02_state.md b/x/evmutil/spec/02_state.md index 8d785629..c5d24961 100644 --- a/x/evmutil/spec/02_state.md +++ b/x/evmutil/spec/02_state.md @@ -6,7 +6,7 @@ order: 2 ## Parameters and Genesis State -`Parameters` define the list of conversion pairs allowed to be converted between Kava ERC20 tokens & sdk.Coins, and the list of native sdk.Coins that are allowed to be converted to ERC20s. +`Parameters` define the list of conversion pairs allowed to be converted between Kava ERC20 tokens & sdk.Coins, and the list of native cosmos sdk.Coins that are allowed to be converted to ERC20s. ```protobuf // Params defines the evmutil module params @@ -15,9 +15,9 @@ message Params { // converted between Kava ERC20 and sdk.Coin repeated ConversionPair enabled_conversion_pairs = 4; - // allowed_native_denoms is a list of denom & erc20 token metadata pairs. + // allowed_cosmos_denoms is a list of denom & erc20 token metadata pairs. // if a denom is in the list, it is allowed to be converted to an erc20 in the evm. - repeated AllowedNativeCoinERC20Token allowed_native_denoms = 1; + repeated AllowedCosmosCoinERC20Token allowed_cosmos_denoms = 1; } // ConversionPair defines a Kava ERC20 address and corresponding denom that is @@ -29,21 +29,21 @@ message ConversionPair { string denom = 2; } -// AllowedNativeCoinERC20Token defines allowed sdk denom & metadata +// AllowedCosmosCoinERC20Token defines allowed cosmos-sdk denom & metadata // for evm token representations of sdk assets. // NOTE: once evm token contracts are deployed, changes to metadata for a given -// sdk_denom will not change metadata of deployed contract. -message AllowedNativeCoinERC20Token { +// cosmos_denom will not change metadata of deployed contract. +message AllowedCosmosCoinERC20Token { option (gogoproto.goproto_getters) = false; // Denom of the sdk.Coin - string sdk_denom = 1; + string cosmos_denom = 1; // Name of ERC20 contract string name = 2; // Symbol of ERC20 contract string symbol = 3; // Number of decimals ERC20 contract is deployed with. - uint32 decimal = 4; + uint32 decimals = 4; } ``` diff --git a/x/evmutil/spec/05_params.md b/x/evmutil/spec/05_params.md index 3913da27..e476f6fd 100644 --- a/x/evmutil/spec/05_params.md +++ b/x/evmutil/spec/05_params.md @@ -9,7 +9,7 @@ The evmutil module contains the following parameters: | Key | Type | Example | | ---------------------- | ------------------------------------ | ------------- | | EnabledConversionPairs | array (ConversionPair) | [{see below}] | -| AllowedNativeDenoms | array (AllowedNativeCoinERC20Tokens) | [{see below}] | +| AllowedCosmosDenoms | array (AllowedCosmosCoinERC20Tokens) | [{see below}] | Example parameters for `ConversionPair`: @@ -18,19 +18,19 @@ Example parameters for `ConversionPair`: | kava_erc20_Address | string | "0x43d8814fdfb9b8854422df13f1c66e34e4fa91fd" | ERC20 contract address | | denom | string | "erc20/chain/usdc" | sdk.Coin denom for the ERC20 token | -Example parameters for `AllowedNativeCoinERC20Token`: +Example parameters for `AllowedCosmosCoinERC20Token`: -| Key | Type | Example | Description | -| --------- | ------ | ---------------------------------------------------------------------- | -------------------------------------------------- | -| sdk_denom | string | "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" | denom of the sdk.Coin | -| name | string | "Kava-wrapped Atom" | name field of the erc20 token | -| symbol | string | "kATOM" | symbol field of the erc20 token | -| decimal | uint32 | 6 | decimal field of the erc20 token, for display only | +| Key | Type | Example | Description | +| ------------ | ------ | ---------------------------------------------------------------------- | -------------------------------------------------- | +| cosmos_denom | string | "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" | denom of the sdk.Coin | +| name | string | "Kava-wrapped Atom" | name field of the erc20 token | +| symbol | string | "kATOM" | symbol field of the erc20 token | +| decimal | uint32 | 6 | decimal field of the erc20 token, for display only | ## EnabledConversionPairs The enabled conversion pairs parameter is an array of ConversionPair entries mapping an erc20 address to a sdk.Coin denom. Only erc20 contract addresses that are in this list can be converted to sdk.Coin and vice versa. -## AllowedNativeDenoms +## AllowedCosmosDenoms -The allowed native denoms parameter is an array of AllowedNativeCoinERC20Token entries. They include the sdk.Coin denom and metadata for the ERC20 representation of the asset in Kava's EVM. Coins may only be transferred to the EVM if they are included in this list. A token in this list will have an ERC20 token contract deployed on first conversion. The token will be deployed with the metadata included in the AllowedNativeCoinERC20Token. Once deployed, changes to the metadata will not affect or change the deployed contract. +The allowed cosmos denoms parameter is an array of AllowedCosmosCoinERC20Token entries. They include the cosmos-sdk.Coin denom and metadata for the ERC20 representation of the asset in Kava's EVM. Coins may only be transferred to the EVM if they are included in this list. A token in this list will have an ERC20 token contract deployed on first conversion. The token will be deployed with the metadata included in the AllowedCosmosCoinERC20Token. Once deployed, changes to the metadata will not affect or change the deployed contract. diff --git a/x/evmutil/testutil/suite.go b/x/evmutil/testutil/suite.go index 71ef9b38..b4696c40 100644 --- a/x/evmutil/testutil/suite.go +++ b/x/evmutil/testutil/suite.go @@ -154,7 +154,7 @@ func (suite *Suite) SetupTest() { "erc20/usdc", ), ), - types.NewAllowedNativeCoinERC20Tokens(), + types.NewAllowedCosmosCoinERC20Tokens(), )) queryHelper := baseapp.NewQueryServerTestHelper(suite.Ctx, suite.App.InterfaceRegistry()) diff --git a/x/evmutil/types/contract.go b/x/evmutil/types/contract.go index 38ae08bd..115802dc 100644 --- a/x/evmutil/types/contract.go +++ b/x/evmutil/types/contract.go @@ -34,11 +34,11 @@ var ( // ERC20MintableBurnableAddress is the erc20 module address ERC20MintableBurnableAddress common.Address - //go:embed ethermint_json/ERC20KavaWrappedNativeCoin.json - ERC20KavaWrappedNativeCoinJSON []byte + //go:embed ethermint_json/ERC20KavaWrappedCosmosCoin.json + ERC20KavaWrappedCosmosCoinJSON []byte - // ERC20KavaWrappedNativeCoinContract is the compiled erc20 contract - ERC20KavaWrappedNativeCoinContract evmtypes.CompiledContract + // ERC20KavaWrappedCosmosCoinContract is the compiled erc20 contract + ERC20KavaWrappedCosmosCoinContract evmtypes.CompiledContract ) func init() { @@ -53,12 +53,12 @@ func init() { panic("loading ERC20MintableBurnable contract failed") } - err = json.Unmarshal(ERC20KavaWrappedNativeCoinJSON, &ERC20KavaWrappedNativeCoinContract) + err = json.Unmarshal(ERC20KavaWrappedCosmosCoinJSON, &ERC20KavaWrappedCosmosCoinContract) if err != nil { - panic(fmt.Sprintf("failed to unmarshal ERC20KavaWrappedNativeCoinJSON: %s. %s", err, string(ERC20KavaWrappedNativeCoinJSON))) + panic(fmt.Sprintf("failed to unmarshal ERC20KavaWrappedCosmosCoinJSON: %s. %s", err, string(ERC20KavaWrappedCosmosCoinJSON))) } - if len(ERC20KavaWrappedNativeCoinContract.Bin) == 0 { - panic("loading ERC20KavaWrappedNativeCoin contract failed") + if len(ERC20KavaWrappedCosmosCoinContract.Bin) == 0 { + panic("loading ERC20KavaWrappedCosmosCoin contract failed") } } diff --git a/x/evmutil/types/conversion_pair.go b/x/evmutil/types/conversion_pair.go index 227f08fb..2fa7a146 100644 --- a/x/evmutil/types/conversion_pair.go +++ b/x/evmutil/types/conversion_pair.go @@ -98,53 +98,53 @@ func validateConversionPairs(i interface{}) error { // Cosmos SDK -> EVM /////////////// -// NewAllowedNativeCoinERC20Token returns an AllowedNativeCoinERC20Token -func NewAllowedNativeCoinERC20Token( - sdkDenom, name, symbol string, +// NewAllowedCosmosCoinERC20Token returns an AllowedCosmosCoinERC20Token +func NewAllowedCosmosCoinERC20Token( + cosmosDenom, name, symbol string, decimal uint32, -) AllowedNativeCoinERC20Token { - return AllowedNativeCoinERC20Token{ - SdkDenom: sdkDenom, - Name: name, - Symbol: symbol, - Decimals: decimal, +) AllowedCosmosCoinERC20Token { + return AllowedCosmosCoinERC20Token{ + CosmosDenom: cosmosDenom, + Name: name, + Symbol: symbol, + Decimals: decimal, } } -// Validate validates the fields of a single AllowedNativeCoinERC20Token -func (token AllowedNativeCoinERC20Token) Validate() error { +// Validate validates the fields of a single AllowedCosmosCoinERC20Token +func (token AllowedCosmosCoinERC20Token) Validate() error { // disallow empty string fields - if err := sdk.ValidateDenom(token.SdkDenom); err != nil { - return fmt.Errorf("allowed native coin erc20 token's sdk denom is invalid: %v", err) + if err := sdk.ValidateDenom(token.CosmosDenom); err != nil { + return fmt.Errorf("allowed cosomos coin erc20 token's sdk denom is invalid: %v", err) } if token.Name == "" { - return errors.New("allowed native coin erc20 token's name cannot be empty") + return errors.New("allowed cosomos coin erc20 token's name cannot be empty") } if token.Symbol == "" { - return errors.New("allowed native coin erc20 token's symbol cannot be empty") + return errors.New("allowed cosomos coin erc20 token's symbol cannot be empty") } // ensure decimals will properly cast to uint8 of erc20 spec if token.Decimals > math.MaxUint8 { - return fmt.Errorf("allowed native coin erc20 token's decimals must be less than 256, found %d", token.Decimals) + return fmt.Errorf("allowed cosomos coin erc20 token's decimals must be less than 256, found %d", token.Decimals) } return nil } -// AllowedNativeCoinERC20Tokens defines a slice of AllowedNativeCoinERC20Token -type AllowedNativeCoinERC20Tokens []AllowedNativeCoinERC20Token +// AllowedCosmosCoinERC20Tokens defines a slice of AllowedCosmosCoinERC20Token +type AllowedCosmosCoinERC20Tokens []AllowedCosmosCoinERC20Token -// NewAllowedNativeCoinERC20Tokens returns AllowedNativeCoinERC20Tokens from the provided values. -func NewAllowedNativeCoinERC20Tokens(pairs ...AllowedNativeCoinERC20Token) AllowedNativeCoinERC20Tokens { - return AllowedNativeCoinERC20Tokens(pairs) +// NewAllowedCosmosCoinERC20Tokens returns AllowedCosmosCoinERC20Tokens from the provided values. +func NewAllowedCosmosCoinERC20Tokens(pairs ...AllowedCosmosCoinERC20Token) AllowedCosmosCoinERC20Tokens { + return AllowedCosmosCoinERC20Tokens(pairs) } // Validate checks that all containing tokens are valid and that there are // no duplicate denoms or symbols. -func (tokens AllowedNativeCoinERC20Tokens) Validate() error { +func (tokens AllowedCosmosCoinERC20Tokens) Validate() error { // Disallow multiple instances of a single sdk_denom or evm symbol denoms := make(map[string]struct{}, len(tokens)) symbols := make(map[string]struct{}, len(tokens)) @@ -154,23 +154,23 @@ func (tokens AllowedNativeCoinERC20Tokens) Validate() error { return fmt.Errorf("invalid token at index %d: %s", i, err) } - if _, found := denoms[t.SdkDenom]; found { - return fmt.Errorf("found duplicate token with sdk denom %s", t.SdkDenom) + if _, found := denoms[t.CosmosDenom]; found { + return fmt.Errorf("found duplicate token with sdk denom %s", t.CosmosDenom) } if _, found := symbols[t.Symbol]; found { return fmt.Errorf("found duplicate token with symbol %s", t.Symbol) } - denoms[t.SdkDenom] = struct{}{} + denoms[t.CosmosDenom] = struct{}{} symbols[t.Symbol] = struct{}{} } return nil } -// validateAllowedNativeCoinERC20Tokens validates an interface as AllowedNativeCoinERC20Tokens -func validateAllowedNativeCoinERC20Tokens(i interface{}) error { - pairs, ok := i.(AllowedNativeCoinERC20Tokens) +// validateAllowedCosmosCoinERC20Tokens validates an interface as AllowedCosmosCoinERC20Tokens +func validateAllowedCosmosCoinERC20Tokens(i interface{}) error { + pairs, ok := i.(AllowedCosmosCoinERC20Tokens) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } diff --git a/x/evmutil/types/conversion_pair.pb.go b/x/evmutil/types/conversion_pair.pb.go index 851a945d..91565618 100644 --- a/x/evmutil/types/conversion_pair.pb.go +++ b/x/evmutil/types/conversion_pair.pb.go @@ -66,13 +66,13 @@ func (m *ConversionPair) XXX_DiscardUnknown() { var xxx_messageInfo_ConversionPair proto.InternalMessageInfo -// AllowedNativeCoinERC20Token defines allowed sdk denom & metadata +// AllowedCosmosCoinERC20Token defines allowed cosmos-sdk denom & metadata // for evm token representations of sdk assets. // NOTE: once evm token contracts are deployed, changes to metadata for a given -// sdk_denom will not change metadata of deployed contract. -type AllowedNativeCoinERC20Token struct { +// cosmos_denom will not change metadata of deployed contract. +type AllowedCosmosCoinERC20Token struct { // Denom of the sdk.Coin - SdkDenom string `protobuf:"bytes,1,opt,name=sdk_denom,json=sdkDenom,proto3" json:"sdk_denom,omitempty"` + CosmosDenom string `protobuf:"bytes,1,opt,name=cosmos_denom,json=cosmosDenom,proto3" json:"cosmos_denom,omitempty"` // Name of ERC20 contract Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Symbol of ERC20 contract @@ -81,18 +81,18 @@ type AllowedNativeCoinERC20Token struct { Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` } -func (m *AllowedNativeCoinERC20Token) Reset() { *m = AllowedNativeCoinERC20Token{} } -func (m *AllowedNativeCoinERC20Token) String() string { return proto.CompactTextString(m) } -func (*AllowedNativeCoinERC20Token) ProtoMessage() {} -func (*AllowedNativeCoinERC20Token) Descriptor() ([]byte, []int) { +func (m *AllowedCosmosCoinERC20Token) Reset() { *m = AllowedCosmosCoinERC20Token{} } +func (m *AllowedCosmosCoinERC20Token) String() string { return proto.CompactTextString(m) } +func (*AllowedCosmosCoinERC20Token) ProtoMessage() {} +func (*AllowedCosmosCoinERC20Token) Descriptor() ([]byte, []int) { return fileDescriptor_e1396d08199817d0, []int{1} } -func (m *AllowedNativeCoinERC20Token) XXX_Unmarshal(b []byte) error { +func (m *AllowedCosmosCoinERC20Token) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AllowedNativeCoinERC20Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AllowedCosmosCoinERC20Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AllowedNativeCoinERC20Token.Marshal(b, m, deterministic) + return xxx_messageInfo_AllowedCosmosCoinERC20Token.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -102,21 +102,21 @@ func (m *AllowedNativeCoinERC20Token) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *AllowedNativeCoinERC20Token) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllowedNativeCoinERC20Token.Merge(m, src) +func (m *AllowedCosmosCoinERC20Token) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowedCosmosCoinERC20Token.Merge(m, src) } -func (m *AllowedNativeCoinERC20Token) XXX_Size() int { +func (m *AllowedCosmosCoinERC20Token) XXX_Size() int { return m.Size() } -func (m *AllowedNativeCoinERC20Token) XXX_DiscardUnknown() { - xxx_messageInfo_AllowedNativeCoinERC20Token.DiscardUnknown(m) +func (m *AllowedCosmosCoinERC20Token) XXX_DiscardUnknown() { + xxx_messageInfo_AllowedCosmosCoinERC20Token.DiscardUnknown(m) } -var xxx_messageInfo_AllowedNativeCoinERC20Token proto.InternalMessageInfo +var xxx_messageInfo_AllowedCosmosCoinERC20Token proto.InternalMessageInfo func init() { proto.RegisterType((*ConversionPair)(nil), "kava.evmutil.v1beta1.ConversionPair") - proto.RegisterType((*AllowedNativeCoinERC20Token)(nil), "kava.evmutil.v1beta1.AllowedNativeCoinERC20Token") + proto.RegisterType((*AllowedCosmosCoinERC20Token)(nil), "kava.evmutil.v1beta1.AllowedCosmosCoinERC20Token") } func init() { @@ -124,30 +124,30 @@ func init() { } var fileDescriptor_e1396d08199817d0 = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x91, 0xcf, 0x6a, 0xea, 0x40, - 0x18, 0xc5, 0x33, 0xf7, 0x7a, 0x45, 0x87, 0xdb, 0x22, 0x83, 0x94, 0xa0, 0x30, 0x06, 0x57, 0xb6, - 0xd0, 0x44, 0xed, 0xae, 0x3b, 0xb5, 0x42, 0x41, 0x90, 0x12, 0xba, 0xea, 0x26, 0x4c, 0x92, 0x0f, - 0x3b, 0xe4, 0xcf, 0x48, 0x26, 0xa6, 0x0a, 0x7d, 0x00, 0x97, 0x7d, 0x84, 0x2e, 0xfb, 0x28, 0x5d, - 0xba, 0xec, 0x4a, 0x6c, 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 0xec, 0xcd, 0x35, 0xb9, - 0xc0, 0x55, 0xb9, 0x09, 0x6c, 0xe1, 0xab, 0x7f, 0xf3, 0xd3, 0xd2, 0x91, 0x16, 0xae, 0xb9, 0xe0, - 0xf0, 0x80, 0xf9, 0x52, 0xad, 0x68, 0xa8, 0x77, 0x66, 0x9e, 0x7c, 0x71, 0x95, 0xf1, 0xec, 0xf0, - 0x4d, 0xd1, 0x47, 0x4a, 0xd1, 0x67, 0x4a, 0xd1, 0x2e, 0xa5, 0xe8, 0x90, 0x52, 0xf4, 0x76, 0xa4, - 0xca, 0xee, 0x48, 0x95, 0xaf, 0x23, 0x55, 0x9e, 0x2e, 0x17, 0x3c, 0x7e, 0x5e, 0xd9, 0xba, 0x23, - 0x02, 0x23, 0x7b, 0xe5, 0xb5, 0xcf, 0x6c, 0x99, 0x2b, 0x63, 0x7d, 0xda, 0x4c, 0xbc, 0x59, 0x82, - 0xb4, 0xab, 0xf9, 0xe7, 0xde, 0xfc, 0x06, 0x00, 0x00, 0xff, 0xff, 0x49, 0x37, 0x2c, 0xa6, 0xb6, - 0x01, 0x00, 0x00, + // 356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x91, 0xcf, 0x4a, 0xeb, 0x40, + 0x18, 0xc5, 0x33, 0xf7, 0xf6, 0x96, 0xde, 0xb1, 0x4a, 0x19, 0x8a, 0x84, 0x0a, 0xd3, 0xd8, 0x55, + 0x15, 0x4c, 0xda, 0xba, 0x73, 0xd7, 0xc6, 0x82, 0x50, 0x10, 0x09, 0xae, 0xdc, 0x84, 0x49, 0x32, + 0xd4, 0xd0, 0x24, 0x5f, 0xc9, 0xa4, 0xb1, 0x05, 0x1f, 0xc0, 0x95, 0xf8, 0x08, 0x2e, 0x7d, 0x14, + 0x97, 0x5d, 0xba, 0x2a, 0x35, 0x7d, 0x0b, 0x57, 0x92, 0x49, 0xe8, 0xee, 0x3b,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0xab, 0x62, 0x15, 0x3a, 0x10, 0xa8, 0x7f, 0xa5, 0x5b, 0x2a, 0xd2, 0xc2, 0x35, 0x8f, + 0xbb, 0x7e, 0xc8, 0x02, 0xa1, 0x56, 0x34, 0xd4, 0x3d, 0xb4, 0xf6, 0xba, 0x38, 0xd0, 0x68, 0xb2, + 0xfd, 0xa6, 0xe8, 0x23, 0xa3, 0xe8, 0x33, 0xa3, 0x68, 0x9d, 0x51, 0xb4, 0xcd, 0x28, 0x7a, 0xdb, + 0x51, 0x65, 0xbd, 0xa3, 0xca, 0xd7, 0x8e, 0x2a, 0x0f, 0x67, 0x53, 0x3f, 0x79, 0x5c, 0x38, 0xba, + 0x0b, 0xa1, 0x91, 0xdf, 0xf5, 0x22, 0x60, 0x8e, 0x90, 0x93, 0xb1, 0xdc, 0xff, 0x4f, 0xb2, 0x9a, + 0x73, 0xe1, 0x54, 0xe5, 0x13, 0x5f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x95, 0x40, 0xc5, 0x63, + 0xbc, 0x01, 0x00, 0x00, } func (this *ConversionPair) VerboseEqual(that interface{}) error { @@ -210,7 +210,7 @@ func (this *ConversionPair) Equal(that interface{}) bool { } return true } -func (this *AllowedNativeCoinERC20Token) VerboseEqual(that interface{}) error { +func (this *AllowedCosmosCoinERC20Token) VerboseEqual(that interface{}) error { if that == nil { if this == nil { return nil @@ -218,25 +218,25 @@ func (this *AllowedNativeCoinERC20Token) VerboseEqual(that interface{}) error { return fmt.Errorf("that == nil && this != nil") } - that1, ok := that.(*AllowedNativeCoinERC20Token) + that1, ok := that.(*AllowedCosmosCoinERC20Token) if !ok { - that2, ok := that.(AllowedNativeCoinERC20Token) + that2, ok := that.(AllowedCosmosCoinERC20Token) if ok { that1 = &that2 } else { - return fmt.Errorf("that is not of type *AllowedNativeCoinERC20Token") + return fmt.Errorf("that is not of type *AllowedCosmosCoinERC20Token") } } if that1 == nil { if this == nil { return nil } - return fmt.Errorf("that is type *AllowedNativeCoinERC20Token but is nil && this != nil") + return fmt.Errorf("that is type *AllowedCosmosCoinERC20Token but is nil && this != nil") } else if this == nil { - return fmt.Errorf("that is type *AllowedNativeCoinERC20Token but is not nil && this == nil") + return fmt.Errorf("that is type *AllowedCosmosCoinERC20Token but is not nil && this == nil") } - if this.SdkDenom != that1.SdkDenom { - return fmt.Errorf("SdkDenom this(%v) Not Equal that(%v)", this.SdkDenom, that1.SdkDenom) + if this.CosmosDenom != that1.CosmosDenom { + return fmt.Errorf("CosmosDenom this(%v) Not Equal that(%v)", this.CosmosDenom, that1.CosmosDenom) } if this.Name != that1.Name { return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) @@ -249,14 +249,14 @@ func (this *AllowedNativeCoinERC20Token) VerboseEqual(that interface{}) error { } return nil } -func (this *AllowedNativeCoinERC20Token) Equal(that interface{}) bool { +func (this *AllowedCosmosCoinERC20Token) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*AllowedNativeCoinERC20Token) + that1, ok := that.(*AllowedCosmosCoinERC20Token) if !ok { - that2, ok := that.(AllowedNativeCoinERC20Token) + that2, ok := that.(AllowedCosmosCoinERC20Token) if ok { that1 = &that2 } else { @@ -268,7 +268,7 @@ func (this *AllowedNativeCoinERC20Token) Equal(that interface{}) bool { } else if this == nil { return false } - if this.SdkDenom != that1.SdkDenom { + if this.CosmosDenom != that1.CosmosDenom { return false } if this.Name != that1.Name { @@ -319,7 +319,7 @@ func (m *ConversionPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AllowedNativeCoinERC20Token) Marshal() (dAtA []byte, err error) { +func (m *AllowedCosmosCoinERC20Token) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -329,12 +329,12 @@ func (m *AllowedNativeCoinERC20Token) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AllowedNativeCoinERC20Token) MarshalTo(dAtA []byte) (int, error) { +func (m *AllowedCosmosCoinERC20Token) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AllowedNativeCoinERC20Token) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AllowedCosmosCoinERC20Token) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -358,10 +358,10 @@ func (m *AllowedNativeCoinERC20Token) MarshalToSizedBuffer(dAtA []byte) (int, er i-- dAtA[i] = 0x12 } - if len(m.SdkDenom) > 0 { - i -= len(m.SdkDenom) - copy(dAtA[i:], m.SdkDenom) - i = encodeVarintConversionPair(dAtA, i, uint64(len(m.SdkDenom))) + if len(m.CosmosDenom) > 0 { + i -= len(m.CosmosDenom) + copy(dAtA[i:], m.CosmosDenom) + i = encodeVarintConversionPair(dAtA, i, uint64(len(m.CosmosDenom))) i-- dAtA[i] = 0xa } @@ -396,13 +396,13 @@ func (m *ConversionPair) Size() (n int) { return n } -func (m *AllowedNativeCoinERC20Token) Size() (n int) { +func (m *AllowedCosmosCoinERC20Token) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SdkDenom) + l = len(m.CosmosDenom) if l > 0 { n += 1 + l + sovConversionPair(uint64(l)) } @@ -542,7 +542,7 @@ func (m *ConversionPair) Unmarshal(dAtA []byte) error { } return nil } -func (m *AllowedNativeCoinERC20Token) Unmarshal(dAtA []byte) error { +func (m *AllowedCosmosCoinERC20Token) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -565,15 +565,15 @@ func (m *AllowedNativeCoinERC20Token) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AllowedNativeCoinERC20Token: wiretype end group for non-group") + return fmt.Errorf("proto: AllowedCosmosCoinERC20Token: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AllowedNativeCoinERC20Token: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AllowedCosmosCoinERC20Token: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SdkDenom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CosmosDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -601,7 +601,7 @@ func (m *AllowedNativeCoinERC20Token) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SdkDenom = string(dAtA[iNdEx:postIndex]) + m.CosmosDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/evmutil/types/conversion_pairs_test.go b/x/evmutil/types/conversion_pairs_test.go index 2a0020d0..70f0ba5c 100644 --- a/x/evmutil/types/conversion_pairs_test.go +++ b/x/evmutil/types/conversion_pairs_test.go @@ -232,55 +232,55 @@ func TestConversionPairs_Validate(t *testing.T) { } } -func TestAllowedNativeCoinERC20Token_Validate(t *testing.T) { +func TestAllowedCosmosCoinERC20Token_Validate(t *testing.T) { testCases := []struct { name string - token types.AllowedNativeCoinERC20Token + token types.AllowedCosmosCoinERC20Token expErr string }{ { name: "valid token", - token: types.NewAllowedNativeCoinERC20Token("uatom", "Kava-wrapped ATOM", "kATOM", 6), + token: types.NewAllowedCosmosCoinERC20Token("uatom", "Kava-wrapped ATOM", "kATOM", 6), expErr: "", }, { name: "valid - highest allowed decimals", - token: types.NewAllowedNativeCoinERC20Token("uatom", "Kava-wrapped ATOM", "kATOM", 255), + token: types.NewAllowedCosmosCoinERC20Token("uatom", "Kava-wrapped ATOM", "kATOM", 255), expErr: "", }, { name: "invalid - Empty SdkDenom", - token: types.AllowedNativeCoinERC20Token{ - SdkDenom: "", - Name: "Example Token", - Symbol: "ETK", - Decimals: 0, + token: types.AllowedCosmosCoinERC20Token{ + CosmosDenom: "", + Name: "Example Token", + Symbol: "ETK", + Decimals: 0, }, expErr: "sdk denom is invalid", }, { name: "invalid - Empty Name", - token: types.AllowedNativeCoinERC20Token{ - SdkDenom: "example_denom", - Name: "", - Symbol: "ETK", - Decimals: 6, + token: types.AllowedCosmosCoinERC20Token{ + CosmosDenom: "example_denom", + Name: "", + Symbol: "ETK", + Decimals: 6, }, expErr: "name cannot be empty", }, { name: "invalid - Empty Symbol", - token: types.AllowedNativeCoinERC20Token{ - SdkDenom: "example_denom", - Name: "Example Token", - Symbol: "", - Decimals: 6, + token: types.AllowedCosmosCoinERC20Token{ + CosmosDenom: "example_denom", + Name: "Example Token", + Symbol: "", + Decimals: 6, }, expErr: "symbol cannot be empty", }, { name: "invalid - decimals higher than uint8", - token: types.NewAllowedNativeCoinERC20Token("uatom", "Kava-wrapped ATOM", "kATOM", 256), + token: types.NewAllowedCosmosCoinERC20Token("uatom", "Kava-wrapped ATOM", "kATOM", 256), expErr: "decimals must be less than 256", }, } @@ -297,46 +297,46 @@ func TestAllowedNativeCoinERC20Token_Validate(t *testing.T) { } } -func TestAllowedNativeCoinERC20Tokens_Validate(t *testing.T) { - token1 := types.NewAllowedNativeCoinERC20Token("denom1", "Token 1", "TK1", 6) - token2 := types.NewAllowedNativeCoinERC20Token("denom2", "Token 2", "TK2", 0) - invalidToken := types.NewAllowedNativeCoinERC20Token("", "No SDK Denom Token", "TK3", 18) +func TestAllowedCosmosCoinERC20Tokens_Validate(t *testing.T) { + token1 := types.NewAllowedCosmosCoinERC20Token("denom1", "Token 1", "TK1", 6) + token2 := types.NewAllowedCosmosCoinERC20Token("denom2", "Token 2", "TK2", 0) + invalidToken := types.NewAllowedCosmosCoinERC20Token("", "No SDK Denom Token", "TK3", 18) testCases := []struct { name string - tokens types.AllowedNativeCoinERC20Tokens + tokens types.AllowedCosmosCoinERC20Tokens expErr string }{ { name: "valid - no tokens", - tokens: types.NewAllowedNativeCoinERC20Tokens(), + tokens: types.NewAllowedCosmosCoinERC20Tokens(), expErr: "", }, { name: "valid - one token", - tokens: types.NewAllowedNativeCoinERC20Tokens(token1), + tokens: types.NewAllowedCosmosCoinERC20Tokens(token1), expErr: "", }, { name: "valid - multiple tokens", - tokens: types.NewAllowedNativeCoinERC20Tokens(token1, token2), + tokens: types.NewAllowedCosmosCoinERC20Tokens(token1, token2), expErr: "", }, { name: "invalid - contains invalid token", - tokens: types.NewAllowedNativeCoinERC20Tokens(token1, token2, invalidToken), + tokens: types.NewAllowedCosmosCoinERC20Tokens(token1, token2, invalidToken), expErr: "invalid token at index 2", }, { name: "invalid - duplicate denoms", - tokens: types.NewAllowedNativeCoinERC20Tokens(token1, token2, token1), + tokens: types.NewAllowedCosmosCoinERC20Tokens(token1, token2, token1), expErr: "found duplicate token with sdk denom denom1", }, { name: "invalid - duplicate symbol", - tokens: types.NewAllowedNativeCoinERC20Tokens( + tokens: types.NewAllowedCosmosCoinERC20Tokens( token1, - types.NewAllowedNativeCoinERC20Token("diff", "Diff Denom, Same Symbol", "TK1", 6), + types.NewAllowedCosmosCoinERC20Token("diff", "Diff Denom, Same Symbol", "TK1", 6), ), expErr: "found duplicate token with symbol TK1", }, diff --git a/x/evmutil/types/ethermint_json/ERC20KavaWrappedNativeCoin.json b/x/evmutil/types/ethermint_json/ERC20KavaWrappedCosmosCoin.json similarity index 99% rename from x/evmutil/types/ethermint_json/ERC20KavaWrappedNativeCoin.json rename to x/evmutil/types/ethermint_json/ERC20KavaWrappedCosmosCoin.json index f7fbbbb4..8f9f0b6a 100644 --- a/x/evmutil/types/ethermint_json/ERC20KavaWrappedNativeCoin.json +++ b/x/evmutil/types/ethermint_json/ERC20KavaWrappedCosmosCoin.json @@ -1,4 +1,4 @@ { "abi": "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals_\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - "bin": "60a06040523480156200001157600080fd5b506040516200114c3803806200114c83398101604081905262000034916200019a565b82826003620000448382620002ae565b506004620000538282620002ae565b505050620000706200006a6200007f60201b60201c565b62000083565b60ff16608052506200037a9050565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000fd57600080fd5b81516001600160401b03808211156200011a576200011a620000d5565b604051601f8301601f19908116603f01168101908282118183101715620001455762000145620000d5565b816040528381526020925086838588010111156200016257600080fd5b600091505b8382101562000186578582018301518183018401529082019062000167565b600093810190920192909252949350505050565b600080600060608486031215620001b057600080fd5b83516001600160401b0380821115620001c857600080fd5b620001d687838801620000eb565b94506020860151915080821115620001ed57600080fd5b50620001fc86828701620000eb565b925050604084015160ff811681146200021457600080fd5b809150509250925092565b600181811c908216806200023457607f821691505b6020821081036200025557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002a957600081815260208120601f850160051c81016020861015620002845750805b601f850160051c820191505b81811015620002a55782815560010162000290565b5050505b505050565b81516001600160401b03811115620002ca57620002ca620000d5565b620002e281620002db84546200021f565b846200025b565b602080601f8311600181146200031a5760008415620003015750858301515b600019600386901b1c1916600185901b178555620002a5565b600085815260208120601f198616915b828110156200034b578886015182559484019460019091019084016200032a565b50858210156200036a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610db66200039660003960006101720152610db66000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461022b578063a9059cbb1461023e578063dd62ed3e14610251578063f2fde38b1461028a57600080fd5b8063715018a6146101ed5780638da5cb5b146101f557806395d89b41146102105780639dc29fac1461021857600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461019c57806340c10f19146101af57806370a08231146101c457600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61029d565b60405161011a9190610c00565b60405180910390f35b610136610131366004610c6a565b61032f565b604051901515815260200161011a565b6002545b60405190815260200161011a565b610136610166366004610c94565b610349565b60405160ff7f000000000000000000000000000000000000000000000000000000000000000016815260200161011a565b6101366101aa366004610c6a565b61036d565b6101c26101bd366004610c6a565b6103ac565b005b61014a6101d2366004610cd0565b6001600160a01b031660009081526020819052604090205490565b6101c26103c2565b6005546040516001600160a01b03909116815260200161011a565b61010d6103d6565b6101c2610226366004610c6a565b6103e5565b610136610239366004610c6a565b6103f7565b61013661024c366004610c6a565b6104a6565b61014a61025f366004610cf2565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101c2610298366004610cd0565b6104b4565b6060600380546102ac90610d25565b80601f01602080910402602001604051908101604052809291908181526020018280546102d890610d25565b80156103255780601f106102fa57610100808354040283529160200191610325565b820191906000526020600020905b81548152906001019060200180831161030857829003601f168201915b5050505050905090565b60003361033d818585610544565b60019150505b92915050565b60003361035785828561069d565b61036285858561072f565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061033d90829086906103a7908790610d5f565b610544565b6103b461091c565b6103be8282610976565b5050565b6103ca61091c565b6103d46000610a35565b565b6060600480546102ac90610d25565b6103ed61091c565b6103be8282610a9f565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156104995760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103628286868403610544565b60003361033d81858561072f565b6104bc61091c565b6001600160a01b0381166105385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610490565b61054181610a35565b50565b6001600160a01b0383166105bf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b03821661063b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610729578181101561071c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610490565b6107298484848403610544565b50505050565b6001600160a01b0383166107ab5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b0382166108275760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b038316600090815260208190526040902054818110156108b65760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610729565b6005546001600160a01b031633146103d45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610490565b6001600160a01b0382166109cc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610490565b80600260008282546109de9190610d5f565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216610b1b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b03821660009081526020819052604090205481811015610baa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610690565b600060208083528351808285015260005b81811015610c2d57858101830151858201604001528201610c11565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610c6557600080fd5b919050565b60008060408385031215610c7d57600080fd5b610c8683610c4e565b946020939093013593505050565b600080600060608486031215610ca957600080fd5b610cb284610c4e565b9250610cc060208501610c4e565b9150604084013590509250925092565b600060208284031215610ce257600080fd5b610ceb82610c4e565b9392505050565b60008060408385031215610d0557600080fd5b610d0e83610c4e565b9150610d1c60208401610c4e565b90509250929050565b600181811c90821680610d3957607f821691505b602082108103610d5957634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561034357634e487b7160e01b600052601160045260246000fdfea2646970667358221220bd1ad2c5c8a902e57115e3fe19beb3b09e4c884acfdfff18b71051732398441e64736f6c63430008120033" + "bin": "60a06040523480156200001157600080fd5b506040516200114c3803806200114c83398101604081905262000034916200019a565b82826003620000448382620002ae565b506004620000538282620002ae565b505050620000706200006a6200007f60201b60201c565b62000083565b60ff16608052506200037a9050565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000fd57600080fd5b81516001600160401b03808211156200011a576200011a620000d5565b604051601f8301601f19908116603f01168101908282118183101715620001455762000145620000d5565b816040528381526020925086838588010111156200016257600080fd5b600091505b8382101562000186578582018301518183018401529082019062000167565b600093810190920192909252949350505050565b600080600060608486031215620001b057600080fd5b83516001600160401b0380821115620001c857600080fd5b620001d687838801620000eb565b94506020860151915080821115620001ed57600080fd5b50620001fc86828701620000eb565b925050604084015160ff811681146200021457600080fd5b809150509250925092565b600181811c908216806200023457607f821691505b6020821081036200025557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002a957600081815260208120601f850160051c81016020861015620002845750805b601f850160051c820191505b81811015620002a55782815560010162000290565b5050505b505050565b81516001600160401b03811115620002ca57620002ca620000d5565b620002e281620002db84546200021f565b846200025b565b602080601f8311600181146200031a5760008415620003015750858301515b600019600386901b1c1916600185901b178555620002a5565b600085815260208120601f198616915b828110156200034b578886015182559484019460019091019084016200032a565b50858210156200036a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610db66200039660003960006101720152610db66000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461022b578063a9059cbb1461023e578063dd62ed3e14610251578063f2fde38b1461028a57600080fd5b8063715018a6146101ed5780638da5cb5b146101f557806395d89b41146102105780639dc29fac1461021857600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461019c57806340c10f19146101af57806370a08231146101c457600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61029d565b60405161011a9190610c00565b60405180910390f35b610136610131366004610c6a565b61032f565b604051901515815260200161011a565b6002545b60405190815260200161011a565b610136610166366004610c94565b610349565b60405160ff7f000000000000000000000000000000000000000000000000000000000000000016815260200161011a565b6101366101aa366004610c6a565b61036d565b6101c26101bd366004610c6a565b6103ac565b005b61014a6101d2366004610cd0565b6001600160a01b031660009081526020819052604090205490565b6101c26103c2565b6005546040516001600160a01b03909116815260200161011a565b61010d6103d6565b6101c2610226366004610c6a565b6103e5565b610136610239366004610c6a565b6103f7565b61013661024c366004610c6a565b6104a6565b61014a61025f366004610cf2565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101c2610298366004610cd0565b6104b4565b6060600380546102ac90610d25565b80601f01602080910402602001604051908101604052809291908181526020018280546102d890610d25565b80156103255780601f106102fa57610100808354040283529160200191610325565b820191906000526020600020905b81548152906001019060200180831161030857829003601f168201915b5050505050905090565b60003361033d818585610544565b60019150505b92915050565b60003361035785828561069d565b61036285858561072f565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061033d90829086906103a7908790610d5f565b610544565b6103b461091c565b6103be8282610976565b5050565b6103ca61091c565b6103d46000610a35565b565b6060600480546102ac90610d25565b6103ed61091c565b6103be8282610a9f565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156104995760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103628286868403610544565b60003361033d81858561072f565b6104bc61091c565b6001600160a01b0381166105385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610490565b61054181610a35565b50565b6001600160a01b0383166105bf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b03821661063b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610729578181101561071c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610490565b6107298484848403610544565b50505050565b6001600160a01b0383166107ab5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b0382166108275760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b038316600090815260208190526040902054818110156108b65760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610729565b6005546001600160a01b031633146103d45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610490565b6001600160a01b0382166109cc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610490565b80600260008282546109de9190610d5f565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216610b1b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b03821660009081526020819052604090205481811015610baa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610490565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610690565b600060208083528351808285015260005b81811015610c2d57858101830151858201604001528201610c11565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610c6557600080fd5b919050565b60008060408385031215610c7d57600080fd5b610c8683610c4e565b946020939093013593505050565b600080600060608486031215610ca957600080fd5b610cb284610c4e565b9250610cc060208501610c4e565b9150604084013590509250925092565b600060208284031215610ce257600080fd5b610ceb82610c4e565b9392505050565b60008060408385031215610d0557600080fd5b610d0e83610c4e565b9150610d1c60208401610c4e565b90509250929050565b600181811c90821680610d3957607f821691505b602082108103610d5957634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561034357634e487b7160e01b600052601160045260246000fdfea26469706673582212208fcfb0bbf7b13fa310f31ff223af3c08b9749eb7903e49018ed56401383786f964736f6c63430008120033" } diff --git a/x/evmutil/types/genesis.pb.go b/x/evmutil/types/genesis.pb.go index d3d71a59..698880ab 100644 --- a/x/evmutil/types/genesis.pb.go +++ b/x/evmutil/types/genesis.pb.go @@ -111,9 +111,9 @@ type Params struct { // enabled_conversion_pairs defines the list of conversion pairs allowed to be // converted between Kava ERC20 and sdk.Coin EnabledConversionPairs ConversionPairs `protobuf:"bytes,4,rep,name=enabled_conversion_pairs,json=enabledConversionPairs,proto3,castrepeated=ConversionPairs" json:"enabled_conversion_pairs"` - // allowed_native_denoms is a list of denom & erc20 token metadata pairs. + // allowed_cosmos_denoms is a list of denom & erc20 token metadata pairs. // if a denom is in the list, it is allowed to be converted to an erc20 in the evm. - AllowedNativeDenoms AllowedNativeCoinERC20Tokens `protobuf:"bytes,1,rep,name=allowed_native_denoms,json=allowedNativeDenoms,proto3,castrepeated=AllowedNativeCoinERC20Tokens" json:"allowed_native_denoms"` + AllowedCosmosDenoms AllowedCosmosCoinERC20Tokens `protobuf:"bytes,1,rep,name=allowed_cosmos_denoms,json=allowedCosmosDenoms,proto3,castrepeated=AllowedCosmosCoinERC20Tokens" json:"allowed_cosmos_denoms"` } func (m *Params) Reset() { *m = Params{} } @@ -156,9 +156,9 @@ func (m *Params) GetEnabledConversionPairs() ConversionPairs { return nil } -func (m *Params) GetAllowedNativeDenoms() AllowedNativeCoinERC20Tokens { +func (m *Params) GetAllowedCosmosDenoms() AllowedCosmosCoinERC20Tokens { if m != nil { - return m.AllowedNativeDenoms + return m.AllowedCosmosDenoms } return nil } @@ -174,38 +174,38 @@ func init() { } var fileDescriptor_d916ab97b8e628c2 = []byte{ - // 492 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0xce, 0xd4, 0x65, 0x57, 0xa7, 0x05, 0x21, 0xad, 0xba, 0x96, 0x9a, 0x94, 0xa5, 0xc8, 0x2a, - 0x24, 0x71, 0xd7, 0x5b, 0x11, 0xa4, 0x59, 0x45, 0x8b, 0x20, 0x25, 0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, 0xef, 0x25, 0x1b, 0x10, 0xea, 0x6f, 0x69, 0x0f, - 0x1b, 0xff, 0x21, 0xf1, 0x60, 0x15, 0xce, 0xde, 0x3e, 0x92, 0x3d, 0xfd, 0x67, 0xa7, 0xbf, 0x2c, - 0xf4, 0x65, 0x62, 0xa1, 0xa3, 0x89, 0x85, 0x8e, 0x27, 0x16, 0x3a, 0x9d, 0x58, 0xe8, 0xe3, 0xd4, - 0x32, 0x8e, 0xa7, 0x96, 0xf1, 0x7d, 0x6a, 0x19, 0xaf, 0xef, 0x9c, 0x09, 0xbe, 0x72, 0xe6, 0x64, - 0x10, 0x71, 0x79, 0xf2, 0xde, 0xce, 0x17, 0x5b, 0xe6, 0x1f, 0xd5, 0xe5, 0x1e, 0xdf, 0xff, 0x13, - 0x00, 0x00, 0xff, 0xff, 0xa3, 0x52, 0xb0, 0x81, 0x60, 0x03, 0x00, 0x00, + // 489 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xde, 0xa9, 0x21, 0xd1, 0x69, 0x41, 0xd8, 0x56, 0x8d, 0xa5, 0xce, 0x96, 0x50, 0x24, 0x0a, + 0xbb, 0x6b, 0xe2, 0xad, 0x08, 0xd2, 0x8d, 0xa2, 0xc5, 0x4b, 0x59, 0xc5, 0x83, 0x97, 0xf0, 0x76, + 0x77, 0x88, 0x4b, 0x76, 0x67, 0xc2, 0xce, 0x24, 0xb5, 0xff, 0x40, 0xf0, 0xa0, 0xfe, 0x03, 0x8f, + 0xe2, 0xb9, 0x3f, 0xa2, 0xe0, 0xa5, 0xf4, 0x24, 0x1e, 0x62, 0x4d, 0xfe, 0x85, 0x27, 0xd9, 0x99, + 0x49, 0xa8, 0x21, 0x8a, 0xa7, 0x9d, 0x7d, 0xf3, 0x7d, 0xef, 0xfb, 0xe6, 0x7b, 0x0f, 0x37, 0xfa,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, 0x37, 0x83, 0x48, 0xa8, 0x93, + 0xff, 0x66, 0xbe, 0xd8, 0x2a, 0xff, 0xa8, 0xaa, 0xf6, 0xf8, 0xfe, 0xef, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xa1, 0xec, 0x74, 0x78, 0x60, 0x03, 0x00, 0x00, } func (this *GenesisState) VerboseEqual(that interface{}) error { @@ -371,12 +371,12 @@ func (this *Params) VerboseEqual(that interface{}) error { return fmt.Errorf("EnabledConversionPairs this[%v](%v) Not Equal that[%v](%v)", i, this.EnabledConversionPairs[i], i, that1.EnabledConversionPairs[i]) } } - if len(this.AllowedNativeDenoms) != len(that1.AllowedNativeDenoms) { - return fmt.Errorf("AllowedNativeDenoms this(%v) Not Equal that(%v)", len(this.AllowedNativeDenoms), len(that1.AllowedNativeDenoms)) + if len(this.AllowedCosmosDenoms) != len(that1.AllowedCosmosDenoms) { + return fmt.Errorf("AllowedCosmosDenoms this(%v) Not Equal that(%v)", len(this.AllowedCosmosDenoms), len(that1.AllowedCosmosDenoms)) } - for i := range this.AllowedNativeDenoms { - if !this.AllowedNativeDenoms[i].Equal(&that1.AllowedNativeDenoms[i]) { - return fmt.Errorf("AllowedNativeDenoms this[%v](%v) Not Equal that[%v](%v)", i, this.AllowedNativeDenoms[i], i, that1.AllowedNativeDenoms[i]) + for i := range this.AllowedCosmosDenoms { + if !this.AllowedCosmosDenoms[i].Equal(&that1.AllowedCosmosDenoms[i]) { + return fmt.Errorf("AllowedCosmosDenoms this[%v](%v) Not Equal that[%v](%v)", i, this.AllowedCosmosDenoms[i], i, that1.AllowedCosmosDenoms[i]) } } return nil @@ -408,11 +408,11 @@ func (this *Params) Equal(that interface{}) bool { return false } } - if len(this.AllowedNativeDenoms) != len(that1.AllowedNativeDenoms) { + if len(this.AllowedCosmosDenoms) != len(that1.AllowedCosmosDenoms) { return false } - for i := range this.AllowedNativeDenoms { - if !this.AllowedNativeDenoms[i].Equal(&that1.AllowedNativeDenoms[i]) { + for i := range this.AllowedCosmosDenoms { + if !this.AllowedCosmosDenoms[i].Equal(&that1.AllowedCosmosDenoms[i]) { return false } } @@ -539,10 +539,10 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } - if len(m.AllowedNativeDenoms) > 0 { - for iNdEx := len(m.AllowedNativeDenoms) - 1; iNdEx >= 0; iNdEx-- { + if len(m.AllowedCosmosDenoms) > 0 { + for iNdEx := len(m.AllowedCosmosDenoms) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.AllowedNativeDenoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AllowedCosmosDenoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -605,8 +605,8 @@ func (m *Params) Size() (n int) { } var l int _ = l - if len(m.AllowedNativeDenoms) > 0 { - for _, e := range m.AllowedNativeDenoms { + if len(m.AllowedCosmosDenoms) > 0 { + for _, e := range m.AllowedCosmosDenoms { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } @@ -892,7 +892,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowedNativeDenoms", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedCosmosDenoms", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -919,8 +919,8 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AllowedNativeDenoms = append(m.AllowedNativeDenoms, AllowedNativeCoinERC20Token{}) - if err := m.AllowedNativeDenoms[len(m.AllowedNativeDenoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AllowedCosmosDenoms = append(m.AllowedCosmosDenoms, AllowedCosmosCoinERC20Token{}) + if err := m.AllowedCosmosDenoms[len(m.AllowedCosmosDenoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/evmutil/types/genesis_test.go b/x/evmutil/types/genesis_test.go index a36fcff3..5ec5cded 100644 --- a/x/evmutil/types/genesis_test.go +++ b/x/evmutil/types/genesis_test.go @@ -51,7 +51,7 @@ func TestGenesisState_Validate(t *testing.T) { types.NewConversionPairs( types.NewConversionPair(types.NewInternalEVMAddress(common.HexToAddress("0xinvalidaddress")), "weth"), ), - types.NewAllowedNativeCoinERC20Tokens(), + types.NewAllowedCosmosCoinERC20Tokens(), ), success: false, }, diff --git a/x/evmutil/types/msg.go b/x/evmutil/types/msg.go index d7d0a22a..582e8f91 100644 --- a/x/evmutil/types/msg.go +++ b/x/evmutil/types/msg.go @@ -16,8 +16,8 @@ var ( _ sdk.Msg = &MsgConvertERC20ToCoin{} _ legacytx.LegacyMsg = &MsgConvertERC20ToCoin{} - _ sdk.Msg = &MsgConvertNativeCoinToERC20{} - _ legacytx.LegacyMsg = &MsgConvertNativeCoinToERC20{} + _ sdk.Msg = &MsgConvertCosmosCoinToERC20{} + _ legacytx.LegacyMsg = &MsgConvertCosmosCoinToERC20{} ) // legacy message types @@ -25,7 +25,7 @@ const ( TypeMsgConvertCoinToERC20 = "evmutil_convert_coin_to_erc20" TypeMsgConvertERC20ToCoin = "evmutil_convert_erc20_to_coin" - TypeMsgConvertNativeCoinToERC20 = "evmutil_convert_native_coin_to_erc20" + TypeMsgConvertCosmosCoinToERC20 = "evmutil_convert_cosmos_coin_to_erc20" ) //////////////////////////// @@ -160,13 +160,13 @@ func (msg MsgConvertERC20ToCoin) Type() string { // Cosmos SDK-native assets -> EVM //////////////////////////// -// NewMsgConvertNativeCoinToERC20 returns a new MsgConvertNativeCoinToERC20 -func NewMsgConvertNativeCoinToERC20( +// NewMsgConvertCosmosCoinToERC20 returns a new MsgConvertCosmosCoinToERC20 +func NewMsgConvertCosmosCoinToERC20( initiator string, receiver string, amount sdk.Coin, -) MsgConvertNativeCoinToERC20 { - return MsgConvertNativeCoinToERC20{ +) MsgConvertCosmosCoinToERC20 { + return MsgConvertCosmosCoinToERC20{ Initiator: initiator, Receiver: receiver, Amount: &amount, @@ -174,7 +174,7 @@ func NewMsgConvertNativeCoinToERC20( } // GetSigners implements types.Msg -func (msg MsgConvertNativeCoinToERC20) GetSigners() []sdk.AccAddress { +func (msg MsgConvertCosmosCoinToERC20) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Initiator) if err != nil { panic(err) @@ -183,7 +183,7 @@ func (msg MsgConvertNativeCoinToERC20) GetSigners() []sdk.AccAddress { } // ValidateBasic implements types.Msg -func (msg MsgConvertNativeCoinToERC20) ValidateBasic() error { +func (msg MsgConvertCosmosCoinToERC20) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Initiator) if err != nil { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid initiator address (%s): %s", msg.Initiator, err.Error()) @@ -201,12 +201,12 @@ func (msg MsgConvertNativeCoinToERC20) ValidateBasic() error { } // GetSignBytes implements legacytx.LegacyMsg -func (msg MsgConvertNativeCoinToERC20) GetSignBytes() []byte { +func (msg MsgConvertCosmosCoinToERC20) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) } // Route implements legacytx.LegacyMsg -func (MsgConvertNativeCoinToERC20) Route() string { return RouterKey } +func (MsgConvertCosmosCoinToERC20) Route() string { return RouterKey } // Type implements legacytx.LegacyMsg -func (MsgConvertNativeCoinToERC20) Type() string { return TypeMsgConvertNativeCoinToERC20 } +func (MsgConvertCosmosCoinToERC20) Type() string { return TypeMsgConvertCosmosCoinToERC20 } diff --git a/x/evmutil/types/msg_test.go b/x/evmutil/types/msg_test.go index 59354cca..4b5bd54d 100644 --- a/x/evmutil/types/msg_test.go +++ b/x/evmutil/types/msg_test.go @@ -200,7 +200,7 @@ func TestMsgConvertERC20ToCoin(t *testing.T) { } } -func TestConvertNativeCoinToERC20_ValidateBasic(t *testing.T) { +func TestConvertCosmosCoinToERC20_ValidateBasic(t *testing.T) { validKavaAddr := app.RandomAddress() validHexAddr, _ := testutil.RandomEvmAccount() invalidAddr := "not-an-address" @@ -273,7 +273,7 @@ func TestConvertNativeCoinToERC20_ValidateBasic(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - msg := types.NewMsgConvertNativeCoinToERC20( + msg := types.NewMsgConvertCosmosCoinToERC20( tc.initiator, tc.receiver, tc.amount, @@ -285,17 +285,17 @@ func TestConvertNativeCoinToERC20_ValidateBasic(t *testing.T) { } else { require.NoError(t, err) require.Equal(t, "evmutil", msg.Route()) - require.Equal(t, "evmutil_convert_native_coin_to_erc20", msg.Type()) + require.Equal(t, "evmutil_convert_cosmos_coin_to_erc20", msg.Type()) require.NotPanics(t, func() { _ = msg.GetSignBytes() }) } }) } } -func TestConvertNativeCoinToERC20_GetSigners(t *testing.T) { +func TestConvertCosmosCoinToERC20_GetSigners(t *testing.T) { t.Run("valid", func(t *testing.T) { initiator := app.RandomAddress() - signers := types.MsgConvertNativeCoinToERC20{ + signers := types.MsgConvertCosmosCoinToERC20{ Initiator: initiator.String(), }.GetSigners() require.Len(t, signers, 1) @@ -304,7 +304,7 @@ func TestConvertNativeCoinToERC20_GetSigners(t *testing.T) { t.Run("panics when depositor is invalid", func(t *testing.T) { require.Panics(t, func() { - types.MsgConvertNativeCoinToERC20{ + types.MsgConvertCosmosCoinToERC20{ Initiator: "not-an-address", }.GetSigners() }) diff --git a/x/evmutil/types/params.go b/x/evmutil/types/params.go index 7bb5f47b..b2940631 100644 --- a/x/evmutil/types/params.go +++ b/x/evmutil/types/params.go @@ -8,8 +8,8 @@ import ( var ( KeyEnabledConversionPairs = []byte("EnabledConversionPairs") DefaultConversionPairs = ConversionPairs{} - KeyAllowedNativeDenoms = []byte("AllowedNativeDenoms") - DefaultAllowedNativeDenoms = AllowedNativeCoinERC20Tokens{} + KeyAllowedCosmosDenoms = []byte("AllowedCosmosDenoms") + DefaultAllowedCosmosDenoms = AllowedCosmosCoinERC20Tokens{} ) // ParamKeyTable for evmutil module. @@ -22,18 +22,18 @@ func ParamKeyTable() paramtypes.KeyTable { func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(KeyEnabledConversionPairs, &p.EnabledConversionPairs, validateConversionPairs), - paramtypes.NewParamSetPair(KeyAllowedNativeDenoms, &p.AllowedNativeDenoms, validateAllowedNativeCoinERC20Tokens), + paramtypes.NewParamSetPair(KeyAllowedCosmosDenoms, &p.AllowedCosmosDenoms, validateAllowedCosmosCoinERC20Tokens), } } // NewParams returns new evmutil module Params. func NewParams( conversionPairs ConversionPairs, - allowedNativeDenoms AllowedNativeCoinERC20Tokens, + allowedCosmosDenoms AllowedCosmosCoinERC20Tokens, ) Params { return Params{ EnabledConversionPairs: conversionPairs, - AllowedNativeDenoms: allowedNativeDenoms, + AllowedCosmosDenoms: allowedCosmosDenoms, } } @@ -41,7 +41,7 @@ func NewParams( func DefaultParams() Params { return NewParams( DefaultConversionPairs, - DefaultAllowedNativeDenoms, + DefaultAllowedCosmosDenoms, ) } @@ -50,7 +50,7 @@ func (p *Params) Validate() error { if err := p.EnabledConversionPairs.Validate(); err != nil { return err } - if err := p.AllowedNativeDenoms.Validate(); err != nil { + if err := p.AllowedCosmosDenoms.Validate(); err != nil { return err } return nil diff --git a/x/evmutil/types/params_test.go b/x/evmutil/types/params_test.go index 3b5f48f4..75850686 100644 --- a/x/evmutil/types/params_test.go +++ b/x/evmutil/types/params_test.go @@ -34,13 +34,13 @@ func (suite *ParamsTestSuite) TestMarshalYAML() { "usdc", ), ) - allowedNativeDenoms := types.NewAllowedNativeCoinERC20Tokens( - types.NewAllowedNativeCoinERC20Token("denom", "Sdk Denom!", "DENOM", 6), + allowedCosmosDenoms := types.NewAllowedCosmosCoinERC20Tokens( + types.NewAllowedCosmosCoinERC20Token("denom", "Sdk Denom!", "DENOM", 6), ) p := types.NewParams( conversionPairs, - allowedNativeDenoms, + allowedCosmosDenoms, ) data, err := yaml.Marshal(p) @@ -51,8 +51,8 @@ func (suite *ParamsTestSuite) TestMarshalYAML() { suite.Require().NoError(err) _, ok := params["enabled_conversion_pairs"] suite.Require().True(ok, "enabled_conversion_pairs should exist in yaml") - _, ok = params["allowed_native_denoms"] - suite.Require().True(ok, "allowed_native_denoms should exist in yaml") + _, ok = params["allowed_cosmos_denoms"] + suite.Require().True(ok, "allowed_cosmos_denoms should exist in yaml") } func (suite *ParamsTestSuite) TestParamSetPairs_EnabledConversionPairs() { @@ -76,22 +76,22 @@ func (suite *ParamsTestSuite) TestParamSetPairs_EnabledConversionPairs() { suite.Require().EqualError(paramSetPair.ValidatorFn(struct{}{}), "invalid parameter type: struct {}") } -func (suite *ParamsTestSuite) TestParamSetPairs_AllowedNativeDenoms() { - suite.Require().Equal([]byte("AllowedNativeDenoms"), types.KeyAllowedNativeDenoms) +func (suite *ParamsTestSuite) TestParamSetPairs_AllowedCosmosDenoms() { + suite.Require().Equal([]byte("AllowedCosmosDenoms"), types.KeyAllowedCosmosDenoms) defaultParams := types.DefaultParams() var paramSetPair *paramstypes.ParamSetPair for _, pair := range defaultParams.ParamSetPairs() { - if bytes.Equal(pair.Key, types.KeyAllowedNativeDenoms) { + if bytes.Equal(pair.Key, types.KeyAllowedCosmosDenoms) { paramSetPair = &pair break } } suite.Require().NotNil(paramSetPair) - pairs, ok := paramSetPair.Value.(*types.AllowedNativeCoinERC20Tokens) + pairs, ok := paramSetPair.Value.(*types.AllowedCosmosCoinERC20Tokens) suite.Require().True(ok) - suite.Require().Equal(pairs, &defaultParams.AllowedNativeDenoms) + suite.Require().Equal(pairs, &defaultParams.AllowedCosmosDenoms) suite.Require().Nil(paramSetPair.ValidatorFn(*pairs)) suite.Require().EqualError(paramSetPair.ValidatorFn(struct{}{}), "invalid parameter type: struct {}") @@ -114,11 +114,11 @@ func (suite *ParamsTestSuite) TestParams_Validate() { "kava", // duplicate denom! ), ) - validAllowedNativeDenoms := types.NewAllowedNativeCoinERC20Tokens( - types.NewAllowedNativeCoinERC20Token("hard", "EVM Hard", "HARD", 6), + validAllowedCosmosDenoms := types.NewAllowedCosmosCoinERC20Tokens( + types.NewAllowedCosmosCoinERC20Token("hard", "EVM Hard", "HARD", 6), ) - invalidAllowedNativeDenoms := types.NewAllowedNativeCoinERC20Tokens( - types.NewAllowedNativeCoinERC20Token("", "Invalid Token", "NOPE", 0), // empty sdk denom + invalidAllowedCosmosDenoms := types.NewAllowedCosmosCoinERC20Tokens( + types.NewAllowedCosmosCoinERC20Token("", "Invalid Token", "NOPE", 0), // empty sdk denom ) testCases := []struct { @@ -128,22 +128,22 @@ func (suite *ParamsTestSuite) TestParams_Validate() { }{ { name: "valid - empty", - params: types.NewParams(types.NewConversionPairs(), types.NewAllowedNativeCoinERC20Tokens()), + params: types.NewParams(types.NewConversionPairs(), types.NewAllowedCosmosCoinERC20Tokens()), expErr: "", }, { name: "valid - with data", - params: types.NewParams(validConversionPairs, validAllowedNativeDenoms), + params: types.NewParams(validConversionPairs, validAllowedCosmosDenoms), expErr: "", }, { name: "invalid - invalid conversion pair", - params: types.NewParams(invalidConversionPairs, validAllowedNativeDenoms), + params: types.NewParams(invalidConversionPairs, validAllowedCosmosDenoms), expErr: "found duplicate", }, { - name: "invalid - invalid allowed native denoms", - params: types.NewParams(validConversionPairs, invalidAllowedNativeDenoms), + name: "invalid - invalid allowed cosmos denoms", + params: types.NewParams(validConversionPairs, invalidAllowedCosmosDenoms), expErr: "invalid token", }, } diff --git a/x/evmutil/types/tx.pb.go b/x/evmutil/types/tx.pb.go index cecaf11c..bd76a11f 100644 --- a/x/evmutil/types/tx.pb.go +++ b/x/evmutil/types/tx.pb.go @@ -236,8 +236,8 @@ func (m *MsgConvertERC20ToCoinResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConvertERC20ToCoinResponse proto.InternalMessageInfo -// ConvertNativeCoinToERC20 defines a conversion from native sdk.Coin to ERC20. -type MsgConvertNativeCoinToERC20 struct { +// ConvertCosmosCoinToERC20 defines a conversion from cosmos sdk.Coin to ERC20. +type MsgConvertCosmosCoinToERC20 struct { // Kava bech32 address initiating the conversion. Initiator string `protobuf:"bytes,1,opt,name=initiator,proto3" json:"initiator,omitempty"` // EVM hex address that will receive the ERC20 tokens. @@ -246,18 +246,18 @@ type MsgConvertNativeCoinToERC20 struct { Amount *types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` } -func (m *MsgConvertNativeCoinToERC20) Reset() { *m = MsgConvertNativeCoinToERC20{} } -func (m *MsgConvertNativeCoinToERC20) String() string { return proto.CompactTextString(m) } -func (*MsgConvertNativeCoinToERC20) ProtoMessage() {} -func (*MsgConvertNativeCoinToERC20) Descriptor() ([]byte, []int) { +func (m *MsgConvertCosmosCoinToERC20) Reset() { *m = MsgConvertCosmosCoinToERC20{} } +func (m *MsgConvertCosmosCoinToERC20) String() string { return proto.CompactTextString(m) } +func (*MsgConvertCosmosCoinToERC20) ProtoMessage() {} +func (*MsgConvertCosmosCoinToERC20) Descriptor() ([]byte, []int) { return fileDescriptor_6e82783c6c58f89c, []int{4} } -func (m *MsgConvertNativeCoinToERC20) XXX_Unmarshal(b []byte) error { +func (m *MsgConvertCosmosCoinToERC20) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgConvertNativeCoinToERC20) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgConvertCosmosCoinToERC20) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgConvertNativeCoinToERC20.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgConvertCosmosCoinToERC20.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -267,55 +267,55 @@ func (m *MsgConvertNativeCoinToERC20) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *MsgConvertNativeCoinToERC20) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConvertNativeCoinToERC20.Merge(m, src) +func (m *MsgConvertCosmosCoinToERC20) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConvertCosmosCoinToERC20.Merge(m, src) } -func (m *MsgConvertNativeCoinToERC20) XXX_Size() int { +func (m *MsgConvertCosmosCoinToERC20) XXX_Size() int { return m.Size() } -func (m *MsgConvertNativeCoinToERC20) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConvertNativeCoinToERC20.DiscardUnknown(m) +func (m *MsgConvertCosmosCoinToERC20) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConvertCosmosCoinToERC20.DiscardUnknown(m) } -var xxx_messageInfo_MsgConvertNativeCoinToERC20 proto.InternalMessageInfo +var xxx_messageInfo_MsgConvertCosmosCoinToERC20 proto.InternalMessageInfo -func (m *MsgConvertNativeCoinToERC20) GetInitiator() string { +func (m *MsgConvertCosmosCoinToERC20) GetInitiator() string { if m != nil { return m.Initiator } return "" } -func (m *MsgConvertNativeCoinToERC20) GetReceiver() string { +func (m *MsgConvertCosmosCoinToERC20) GetReceiver() string { if m != nil { return m.Receiver } return "" } -func (m *MsgConvertNativeCoinToERC20) GetAmount() *types.Coin { +func (m *MsgConvertCosmosCoinToERC20) GetAmount() *types.Coin { if m != nil { return m.Amount } return nil } -// MsgConvertNativeCoinToERC20Response defines the response value from Msg/MsgConvertNativeCoinToERC20. -type MsgConvertNativeCoinToERC20Response struct { +// MsgConvertCosmosCoinToERC20Response defines the response value from Msg/MsgConvertCosmosCoinToERC20. +type MsgConvertCosmosCoinToERC20Response struct { } -func (m *MsgConvertNativeCoinToERC20Response) Reset() { *m = MsgConvertNativeCoinToERC20Response{} } -func (m *MsgConvertNativeCoinToERC20Response) String() string { return proto.CompactTextString(m) } -func (*MsgConvertNativeCoinToERC20Response) ProtoMessage() {} -func (*MsgConvertNativeCoinToERC20Response) Descriptor() ([]byte, []int) { +func (m *MsgConvertCosmosCoinToERC20Response) Reset() { *m = MsgConvertCosmosCoinToERC20Response{} } +func (m *MsgConvertCosmosCoinToERC20Response) String() string { return proto.CompactTextString(m) } +func (*MsgConvertCosmosCoinToERC20Response) ProtoMessage() {} +func (*MsgConvertCosmosCoinToERC20Response) Descriptor() ([]byte, []int) { return fileDescriptor_6e82783c6c58f89c, []int{5} } -func (m *MsgConvertNativeCoinToERC20Response) XXX_Unmarshal(b []byte) error { +func (m *MsgConvertCosmosCoinToERC20Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgConvertNativeCoinToERC20Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgConvertCosmosCoinToERC20Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgConvertNativeCoinToERC20Response.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgConvertCosmosCoinToERC20Response.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -325,64 +325,64 @@ func (m *MsgConvertNativeCoinToERC20Response) XXX_Marshal(b []byte, deterministi return b[:n], nil } } -func (m *MsgConvertNativeCoinToERC20Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConvertNativeCoinToERC20Response.Merge(m, src) +func (m *MsgConvertCosmosCoinToERC20Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConvertCosmosCoinToERC20Response.Merge(m, src) } -func (m *MsgConvertNativeCoinToERC20Response) XXX_Size() int { +func (m *MsgConvertCosmosCoinToERC20Response) XXX_Size() int { return m.Size() } -func (m *MsgConvertNativeCoinToERC20Response) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConvertNativeCoinToERC20Response.DiscardUnknown(m) +func (m *MsgConvertCosmosCoinToERC20Response) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConvertCosmosCoinToERC20Response.DiscardUnknown(m) } -var xxx_messageInfo_MsgConvertNativeCoinToERC20Response proto.InternalMessageInfo +var xxx_messageInfo_MsgConvertCosmosCoinToERC20Response proto.InternalMessageInfo func init() { proto.RegisterType((*MsgConvertCoinToERC20)(nil), "kava.evmutil.v1beta1.MsgConvertCoinToERC20") proto.RegisterType((*MsgConvertCoinToERC20Response)(nil), "kava.evmutil.v1beta1.MsgConvertCoinToERC20Response") proto.RegisterType((*MsgConvertERC20ToCoin)(nil), "kava.evmutil.v1beta1.MsgConvertERC20ToCoin") proto.RegisterType((*MsgConvertERC20ToCoinResponse)(nil), "kava.evmutil.v1beta1.MsgConvertERC20ToCoinResponse") - proto.RegisterType((*MsgConvertNativeCoinToERC20)(nil), "kava.evmutil.v1beta1.MsgConvertNativeCoinToERC20") - proto.RegisterType((*MsgConvertNativeCoinToERC20Response)(nil), "kava.evmutil.v1beta1.MsgConvertNativeCoinToERC20Response") + proto.RegisterType((*MsgConvertCosmosCoinToERC20)(nil), "kava.evmutil.v1beta1.MsgConvertCosmosCoinToERC20") + proto.RegisterType((*MsgConvertCosmosCoinToERC20Response)(nil), "kava.evmutil.v1beta1.MsgConvertCosmosCoinToERC20Response") } func init() { proto.RegisterFile("kava/evmutil/v1beta1/tx.proto", fileDescriptor_6e82783c6c58f89c) } var fileDescriptor_6e82783c6c58f89c = []byte{ - // 519 bytes of a gzipped FileDescriptorProto + // 517 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0x34, 0x52, 0xcc, 0x78, 0x29, 0x43, 0x84, 0xed, 0x6a, 0x37, 0x25, 0xa2, 0x54, 0x24, - 0xb3, 0x4d, 0x2a, 0x82, 0xe0, 0xc5, 0x84, 0x1e, 0x4a, 0xa9, 0x87, 0x35, 0x27, 0x2f, 0x61, 0x76, - 0x33, 0xac, 0x43, 0x9b, 0x99, 0xb0, 0x33, 0x59, 0xea, 0xcd, 0x8b, 0x20, 0x9e, 0xfc, 0x05, 0x9e, - 0xfd, 0x01, 0xfd, 0x11, 0x3d, 0x96, 0x9e, 0xc4, 0x43, 0xa8, 0x9b, 0x3f, 0x22, 0xb3, 0x3b, 0xd9, - 0x2c, 0x76, 0x4d, 0x08, 0xf4, 0xb4, 0x33, 0xef, 0x7d, 0xef, 0xbd, 0xef, 0x7b, 0xef, 0xed, 0xc0, - 0x9d, 0x53, 0x12, 0x13, 0x97, 0xc6, 0xa3, 0x89, 0x62, 0x67, 0x6e, 0xdc, 0xf6, 0xa9, 0x22, 0x6d, - 0x57, 0x9d, 0xe3, 0x71, 0x24, 0x94, 0x40, 0x75, 0xed, 0xc6, 0xc6, 0x8d, 0x8d, 0xdb, 0x76, 0x02, - 0x21, 0x47, 0x42, 0xba, 0x3e, 0x91, 0x34, 0x8f, 0x09, 0x04, 0xe3, 0x59, 0x94, 0xbd, 0x9d, 0xf9, - 0x07, 0xe9, 0xcd, 0xcd, 0x2e, 0xc6, 0x55, 0x0f, 0x45, 0x28, 0x32, 0xbb, 0x3e, 0x65, 0xd6, 0xe6, - 0x0f, 0x00, 0x1f, 0x9e, 0xc8, 0xb0, 0x27, 0x78, 0x4c, 0x23, 0xd5, 0x13, 0x8c, 0xf7, 0xc5, 0xa1, - 0xd7, 0xeb, 0xec, 0xa3, 0x57, 0xb0, 0xc6, 0x38, 0x53, 0x8c, 0x28, 0x11, 0x59, 0x60, 0x17, 0xec, - 0xd5, 0xba, 0xd6, 0xf5, 0x45, 0xab, 0x6e, 0x92, 0xbe, 0x1d, 0x0e, 0x23, 0x2a, 0xe5, 0x7b, 0x15, - 0x31, 0x1e, 0x7a, 0x0b, 0x28, 0xb2, 0xe1, 0xfd, 0x88, 0x06, 0x94, 0xc5, 0x34, 0xb2, 0x36, 0x74, - 0x98, 0x97, 0xdf, 0x51, 0x1b, 0x6e, 0x92, 0x91, 0x98, 0x70, 0x65, 0x55, 0x77, 0xc1, 0xde, 0x83, - 0xce, 0x36, 0x36, 0xd9, 0xb4, 0x9e, 0xb9, 0x48, 0xac, 0x59, 0x78, 0x06, 0xd8, 0x6c, 0xc0, 0x9d, - 0x52, 0x7e, 0x1e, 0x95, 0x63,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0xe6, 0x27, 0xff, 0xac, 0x7c, 0xe0, 0xf2, + 0xf5, 0x0d, 0x37, 0xf2, 0x57, 0x67, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x66, 0xcd, + 0xe3, 0xfd, 0x04, 0x00, 0x00, } func (this *MsgConvertCoinToERC20) VerboseEqual(that interface{}) error { @@ -619,7 +619,7 @@ func (this *MsgConvertERC20ToCoinResponse) Equal(that interface{}) bool { } return true } -func (this *MsgConvertNativeCoinToERC20) VerboseEqual(that interface{}) error { +func (this *MsgConvertCosmosCoinToERC20) VerboseEqual(that interface{}) error { if that == nil { if this == nil { return nil @@ -627,22 +627,22 @@ func (this *MsgConvertNativeCoinToERC20) VerboseEqual(that interface{}) error { return fmt.Errorf("that == nil && this != nil") } - that1, ok := that.(*MsgConvertNativeCoinToERC20) + that1, ok := that.(*MsgConvertCosmosCoinToERC20) if !ok { - that2, ok := that.(MsgConvertNativeCoinToERC20) + that2, ok := that.(MsgConvertCosmosCoinToERC20) if ok { that1 = &that2 } else { - return fmt.Errorf("that is not of type *MsgConvertNativeCoinToERC20") + return fmt.Errorf("that is not of type *MsgConvertCosmosCoinToERC20") } } if that1 == nil { if this == nil { return nil } - return fmt.Errorf("that is type *MsgConvertNativeCoinToERC20 but is nil && this != nil") + return fmt.Errorf("that is type *MsgConvertCosmosCoinToERC20 but is nil && this != nil") } else if this == nil { - return fmt.Errorf("that is type *MsgConvertNativeCoinToERC20 but is not nil && this == nil") + return fmt.Errorf("that is type *MsgConvertCosmosCoinToERC20 but is not nil && this == nil") } if this.Initiator != that1.Initiator { return fmt.Errorf("Initiator this(%v) Not Equal that(%v)", this.Initiator, that1.Initiator) @@ -655,14 +655,14 @@ func (this *MsgConvertNativeCoinToERC20) VerboseEqual(that interface{}) error { } return nil } -func (this *MsgConvertNativeCoinToERC20) Equal(that interface{}) bool { +func (this *MsgConvertCosmosCoinToERC20) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*MsgConvertNativeCoinToERC20) + that1, ok := that.(*MsgConvertCosmosCoinToERC20) if !ok { - that2, ok := that.(MsgConvertNativeCoinToERC20) + that2, ok := that.(MsgConvertCosmosCoinToERC20) if ok { that1 = &that2 } else { @@ -685,7 +685,7 @@ func (this *MsgConvertNativeCoinToERC20) Equal(that interface{}) bool { } return true } -func (this *MsgConvertNativeCoinToERC20Response) VerboseEqual(that interface{}) error { +func (this *MsgConvertCosmosCoinToERC20Response) VerboseEqual(that interface{}) error { if that == nil { if this == nil { return nil @@ -693,33 +693,33 @@ func (this *MsgConvertNativeCoinToERC20Response) VerboseEqual(that interface{}) return fmt.Errorf("that == nil && this != nil") } - that1, ok := that.(*MsgConvertNativeCoinToERC20Response) + that1, ok := that.(*MsgConvertCosmosCoinToERC20Response) if !ok { - that2, ok := that.(MsgConvertNativeCoinToERC20Response) + that2, ok := that.(MsgConvertCosmosCoinToERC20Response) if ok { that1 = &that2 } else { - return fmt.Errorf("that is not of type *MsgConvertNativeCoinToERC20Response") + return fmt.Errorf("that is not of type *MsgConvertCosmosCoinToERC20Response") } } if that1 == nil { if this == nil { return nil } - return fmt.Errorf("that is type *MsgConvertNativeCoinToERC20Response but is nil && this != nil") + return fmt.Errorf("that is type *MsgConvertCosmosCoinToERC20Response but is nil && this != nil") } else if this == nil { - return fmt.Errorf("that is type *MsgConvertNativeCoinToERC20Response but is not nil && this == nil") + return fmt.Errorf("that is type *MsgConvertCosmosCoinToERC20Response but is not nil && this == nil") } return nil } -func (this *MsgConvertNativeCoinToERC20Response) Equal(that interface{}) bool { +func (this *MsgConvertCosmosCoinToERC20Response) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*MsgConvertNativeCoinToERC20Response) + that1, ok := that.(*MsgConvertCosmosCoinToERC20Response) if !ok { - that2, ok := that.(MsgConvertNativeCoinToERC20Response) + that2, ok := that.(MsgConvertCosmosCoinToERC20Response) if ok { that1 = &that2 } else { @@ -750,8 +750,8 @@ type MsgClient interface { ConvertCoinToERC20(ctx context.Context, in *MsgConvertCoinToERC20, opts ...grpc.CallOption) (*MsgConvertCoinToERC20Response, error) // ConvertERC20ToCoin defines a method for converting Kava ERC20 to sdk.Coin. ConvertERC20ToCoin(ctx context.Context, in *MsgConvertERC20ToCoin, opts ...grpc.CallOption) (*MsgConvertERC20ToCoinResponse, error) - // ConvertNativeCoinToERC20 defines a method for converting a native sdk.Coin to an ERC20. - ConvertNativeCoinToERC20(ctx context.Context, in *MsgConvertNativeCoinToERC20, opts ...grpc.CallOption) (*MsgConvertNativeCoinToERC20Response, error) + // ConvertCosmosCoinToERC20 defines a method for converting a cosmos sdk.Coin to an ERC20. + ConvertCosmosCoinToERC20(ctx context.Context, in *MsgConvertCosmosCoinToERC20, opts ...grpc.CallOption) (*MsgConvertCosmosCoinToERC20Response, error) } type msgClient struct { @@ -780,9 +780,9 @@ func (c *msgClient) ConvertERC20ToCoin(ctx context.Context, in *MsgConvertERC20T return out, nil } -func (c *msgClient) ConvertNativeCoinToERC20(ctx context.Context, in *MsgConvertNativeCoinToERC20, opts ...grpc.CallOption) (*MsgConvertNativeCoinToERC20Response, error) { - out := new(MsgConvertNativeCoinToERC20Response) - err := c.cc.Invoke(ctx, "/kava.evmutil.v1beta1.Msg/ConvertNativeCoinToERC20", in, out, opts...) +func (c *msgClient) ConvertCosmosCoinToERC20(ctx context.Context, in *MsgConvertCosmosCoinToERC20, opts ...grpc.CallOption) (*MsgConvertCosmosCoinToERC20Response, error) { + out := new(MsgConvertCosmosCoinToERC20Response) + err := c.cc.Invoke(ctx, "/kava.evmutil.v1beta1.Msg/ConvertCosmosCoinToERC20", in, out, opts...) if err != nil { return nil, err } @@ -795,8 +795,8 @@ type MsgServer interface { ConvertCoinToERC20(context.Context, *MsgConvertCoinToERC20) (*MsgConvertCoinToERC20Response, error) // ConvertERC20ToCoin defines a method for converting Kava ERC20 to sdk.Coin. ConvertERC20ToCoin(context.Context, *MsgConvertERC20ToCoin) (*MsgConvertERC20ToCoinResponse, error) - // ConvertNativeCoinToERC20 defines a method for converting a native sdk.Coin to an ERC20. - ConvertNativeCoinToERC20(context.Context, *MsgConvertNativeCoinToERC20) (*MsgConvertNativeCoinToERC20Response, error) + // ConvertCosmosCoinToERC20 defines a method for converting a cosmos sdk.Coin to an ERC20. + ConvertCosmosCoinToERC20(context.Context, *MsgConvertCosmosCoinToERC20) (*MsgConvertCosmosCoinToERC20Response, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -809,8 +809,8 @@ func (*UnimplementedMsgServer) ConvertCoinToERC20(ctx context.Context, req *MsgC func (*UnimplementedMsgServer) ConvertERC20ToCoin(ctx context.Context, req *MsgConvertERC20ToCoin) (*MsgConvertERC20ToCoinResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ConvertERC20ToCoin not implemented") } -func (*UnimplementedMsgServer) ConvertNativeCoinToERC20(ctx context.Context, req *MsgConvertNativeCoinToERC20) (*MsgConvertNativeCoinToERC20Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConvertNativeCoinToERC20 not implemented") +func (*UnimplementedMsgServer) ConvertCosmosCoinToERC20(ctx context.Context, req *MsgConvertCosmosCoinToERC20) (*MsgConvertCosmosCoinToERC20Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConvertCosmosCoinToERC20 not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -853,20 +853,20 @@ func _Msg_ConvertERC20ToCoin_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _Msg_ConvertNativeCoinToERC20_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConvertNativeCoinToERC20) +func _Msg_ConvertCosmosCoinToERC20_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConvertCosmosCoinToERC20) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).ConvertNativeCoinToERC20(ctx, in) + return srv.(MsgServer).ConvertCosmosCoinToERC20(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kava.evmutil.v1beta1.Msg/ConvertNativeCoinToERC20", + FullMethod: "/kava.evmutil.v1beta1.Msg/ConvertCosmosCoinToERC20", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConvertNativeCoinToERC20(ctx, req.(*MsgConvertNativeCoinToERC20)) + return srv.(MsgServer).ConvertCosmosCoinToERC20(ctx, req.(*MsgConvertCosmosCoinToERC20)) } return interceptor(ctx, in, info, handler) } @@ -884,8 +884,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_ConvertERC20ToCoin_Handler, }, { - MethodName: "ConvertNativeCoinToERC20", - Handler: _Msg_ConvertNativeCoinToERC20_Handler, + MethodName: "ConvertCosmosCoinToERC20", + Handler: _Msg_ConvertCosmosCoinToERC20_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -1041,7 +1041,7 @@ func (m *MsgConvertERC20ToCoinResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *MsgConvertNativeCoinToERC20) Marshal() (dAtA []byte, err error) { +func (m *MsgConvertCosmosCoinToERC20) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1051,12 +1051,12 @@ func (m *MsgConvertNativeCoinToERC20) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgConvertNativeCoinToERC20) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConvertCosmosCoinToERC20) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgConvertNativeCoinToERC20) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConvertCosmosCoinToERC20) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1090,7 +1090,7 @@ func (m *MsgConvertNativeCoinToERC20) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *MsgConvertNativeCoinToERC20Response) Marshal() (dAtA []byte, err error) { +func (m *MsgConvertCosmosCoinToERC20Response) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1100,12 +1100,12 @@ func (m *MsgConvertNativeCoinToERC20Response) Marshal() (dAtA []byte, err error) return dAtA[:n], nil } -func (m *MsgConvertNativeCoinToERC20Response) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConvertCosmosCoinToERC20Response) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgConvertNativeCoinToERC20Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConvertCosmosCoinToERC20Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1186,7 +1186,7 @@ func (m *MsgConvertERC20ToCoinResponse) Size() (n int) { return n } -func (m *MsgConvertNativeCoinToERC20) Size() (n int) { +func (m *MsgConvertCosmosCoinToERC20) Size() (n int) { if m == nil { return 0 } @@ -1207,7 +1207,7 @@ func (m *MsgConvertNativeCoinToERC20) Size() (n int) { return n } -func (m *MsgConvertNativeCoinToERC20Response) Size() (n int) { +func (m *MsgConvertCosmosCoinToERC20Response) Size() (n int) { if m == nil { return 0 } @@ -1652,7 +1652,7 @@ func (m *MsgConvertERC20ToCoinResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConvertNativeCoinToERC20) Unmarshal(dAtA []byte) error { +func (m *MsgConvertCosmosCoinToERC20) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1675,10 +1675,10 @@ func (m *MsgConvertNativeCoinToERC20) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConvertNativeCoinToERC20: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConvertCosmosCoinToERC20: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConvertNativeCoinToERC20: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConvertCosmosCoinToERC20: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1802,7 +1802,7 @@ func (m *MsgConvertNativeCoinToERC20) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConvertNativeCoinToERC20Response) Unmarshal(dAtA []byte) error { +func (m *MsgConvertCosmosCoinToERC20Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1825,10 +1825,10 @@ func (m *MsgConvertNativeCoinToERC20Response) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConvertNativeCoinToERC20Response: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConvertCosmosCoinToERC20Response: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConvertNativeCoinToERC20Response: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConvertCosmosCoinToERC20Response: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: